diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java
new file mode 100644
index 0000000..f9752fe
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java
@@ -0,0 +1,200 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.api;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.junit.rules.TestWatcher;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.rules.MyTestWatcher;
+import org.openecomp.sdc.ci.tests.run.StartTest;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+public abstract class AttSdcTest {
+
+	public static StringBuilder doc = new StringBuilder();
+	public static String file = null;
+	public static Config config = null;
+	// protected Gson gson = new Gson();
+	protected Gson prettyGson = new GsonBuilder().setPrettyPrinting().create();
+
+	protected TestName testName = null;
+	protected Logger logger = null;
+
+	protected static boolean displayException = false;
+
+	public AttSdcTest(TestName testName, String className) {
+		super();
+
+		StartTest.enableLogger();
+
+		this.testName = testName;
+		this.logger = LoggerFactory.getLogger(className);
+
+		String displayEx = System.getProperty("displayException");
+		if (displayEx != null && Boolean.valueOf(displayEx).booleanValue()) {
+			displayException = true;
+		}
+
+	}
+
+	@Rule
+	public TestWatcher tw = new MyTestWatcher(this);
+
+	@BeforeClass
+	public static void beforeClass() {
+		doc = new StringBuilder();
+		doc.append(
+				"<Html><head><style>th{background-color: gray;color: white;height: 30px;}td {color: black;height: 30px;}.fail {background-color: #FF5555;width: 100px;text-align: center;}.success {background-color: #00FF00;width: 100px;text-align: center;}.name {width: 200px;background-color: #F0F0F0;}.message {width: 300px;background-color: #F0F0F0;}</style>");
+
+		doc.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
+		doc.append(
+				"<link rel=\"stylesheet\" href=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css\">");
+
+		doc.append("</head><body>");
+
+		doc.append("<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>");
+		doc.append("<script src=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"></script>");
+
+		doc.append("<table>");
+
+		doc.append("<tr>");
+		doc.append("<th>").append("Test Name").append("</th>");
+		doc.append("<th>").append("Status").append("</th>");
+		doc.append("<th>").append("Message").append("</th>");
+
+		if (displayException) {
+			doc.append("<th>").append("Exception").append("</th>");
+		}
+		doc.append("</tr>");
+	}
+
+	@AfterClass
+	public static void afterClass() {
+		doc.append("<table>");
+		// writeToFile("./" + ConfigAttOdlIt.REPORT_FILE , doc.toString());
+		FileUtils.writeToFile(
+				Config.instance().getOutputFolder() + File.separator + file + StartTest.timeOfTest + ".html",
+				doc.toString());
+
+	}
+
+	@Before
+	public void beforeTest() throws FileNotFoundException {
+		file = FileUtils.getFileName(this.getClass().getName());
+		config = Utils.getConfig();
+		assertTrue(config != null);		
+	}
+
+	@After
+	public void afterTest() throws FileNotFoundException {
+
+	}
+
+	public void addTestSummary(String testName, boolean isSuccess) {
+		addTestSummary(testName, isSuccess, null);
+	}
+
+	public void addTestSummary(String testName, boolean isSuccess, Throwable exception) {
+
+		String message = exception == null ? "" : exception.getMessage();
+
+		String result = (isSuccess) ? "success" : "fail";
+		doc.append("<tr>");
+		doc.append("<td class=\"name\">").append(testName).append("</td>");
+		doc.append("<td class=\"" + result + "\">").append(result).append("</td>");
+		doc.append("<td class=\"message\">").append(message).append("</td>");
+
+		if (displayException) {
+			// doc.append("<td
+			// class=\"message\">").append(convertExceptionToString(exception)).append("</td>");
+			doc.append("<td class=\"message\">");
+
+			doc.append("<button type=\"button\" class=\"btn btn-info\" data-toggle=\"collapse\" data-target=\"#demo"
+					+ testName + "\">Simple collapsible</button>");
+			doc.append("<div id=\"demo" + testName + "\" class=\"collapse out\">");
+
+			doc.append(convertExceptionToString(exception));
+
+			doc.append("</div>");
+			doc.append("</td>");
+		}
+
+		doc.append("</tr>");
+
+		if (isSuccess) {
+			logger.debug("Test {} {}",testName,(isSuccess ? " SUCCEEDED " : " FAILED with error " + message));
+		} else {
+			logger.error("Test {} {}",testName,(isSuccess ? " SUCCEEDED " : " FAILED with error " + message));
+		}
+	}
+
+	private String convertExceptionToString(Throwable exception) {
+
+		if (exception == null) {
+			return "";
+		}
+
+		StringWriter sw = new StringWriter();
+		exception.printStackTrace(new PrintWriter(sw));
+		String exceptionAsString = sw.toString();
+
+		return exceptionAsString;
+	}
+
+	public Logger getLogger() {
+		return logger;
+	}
+
+	protected boolean ignoreDueToBug(String bug) {
+
+		List<String> bugs = config.getBugs();
+
+		if (bugs != null && bugs.size() > 0) {
+			for (String bugNumber : bugs) {
+				if (bugNumber.startsWith(bug)) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
new file mode 100644
index 0000000..a9cc119
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
@@ -0,0 +1,607 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.api;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.ImmutableTriple;
+import org.apache.log4j.Logger;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.neo4j.GraphEdgeLabels;
+import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
+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.model.Component;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.slf4j.LoggerFactory;
+import org.testng.ITestContext;
+import org.testng.ITestResult;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+import com.aventstack.extentreports.Status;
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.thinkaurelius.titan.core.TitanVertex;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.LoggerContext;
+
+public abstract class ComponentBaseTest {
+
+//	private static Logger logger = LoggerFactory.getLogger(ComponentBaseTest.class.getName());
+	
+	protected static Logger logger= Logger.getLogger(ComponentBaseTest.class);	
+	
+
+	// public ComponentBaseTest(TestName testName, String className) {
+	// super(testName, className);
+	// }
+
+	protected static ExtentReports extentReport;
+	public static final String REPORT_FOLDER = "./ExtentReport/";
+	private static final String VERSIONS_INFO_FILE_NAME = "versions.info";
+	private static final String REPORT_FILE_NAME = "SDC_CI_Extent_Report.html";
+	protected static TitanGraph titanGraph;
+	private static Config myconfig;
+	public static Config config;
+	
+	
+	
+	/**************** METHODS ****************/
+	public static ExtentTest getExtendTest() {
+		return ExtentTestManager.getTest();
+	}
+
+	public static enum ComponentOperationEnum {
+		CREATE_COMPONENT, UPDATE_COMPONENT, GET_COMPONENT, DELETE_COMPONENT, CHANGE_STATE_CHECKIN, CHANGE_STATE_CHECKOUT, CHANGE_STATE_UNDO_CHECKOUT
+	};
+
+	public ComponentBaseTest(TestName name, String name2) {
+		// TODO Auto-generated constructor stub
+		LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
+		lc.getLogger("com.thinkaurelius").setLevel(Level.INFO);
+		lc.getLogger("com.datastax").setLevel(Level.INFO);
+		lc.getLogger("io.netty").setLevel(Level.INFO);
+		lc.getLogger("c.d").setLevel(Level.INFO);
+	}
+
+	@BeforeSuite(alwaysRun = true)
+	public static void openTitan(ITestContext context) throws Exception {
+				
+		logger.info("<<<BeforeSuite>>>");
+		myconfig = Utils.getConfig();
+		config = Utils.getConfig();
+
+		File dir = new File(REPORT_FOLDER);
+		try {
+			FileUtils.deleteDirectory(dir);
+		} catch (IOException e) {
+		}
+		dir.mkdir();
+		
+		System.out.println("BeforeSuite  - get reporter");
+		extentReport = ExtentManager.getReporter(REPORT_FOLDER + REPORT_FILE_NAME);
+		
+		String onboardVersion = AutomationUtils.getOnboardVersion();
+		String osVersion = AutomationUtils.getOSVersion();
+		String envData = myconfig.getUrl();
+		// TODO: uncomment config file
+//		extentReport.loadConfig(AutomationUtils.getConfigFile(CONFIG_FILE));
+		
+		extentReport.setSystemInfo("Onboard Version", onboardVersion);
+		extentReport.setSystemInfo("OS Version", osVersion);
+		extentReport.setSystemInfo("ExecutedOn", envData);
+		extentReport.setSystemInfo("SuiteName", context.getName());
+		AutomationUtils.createVersionsInfoFile(REPORT_FOLDER + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData);
+
+		System.out.println("BeforeSuite - open titan");
+		openTitanLogic();
+		
+		System.out.println("BeforeSuite - createConsumer");
+		AtomicOperationUtils.createDefaultConsumer(true);
+		
+		System.out.println("BeforeSuite - performClean");
+		performClean();
+	}
+
+	protected static void openTitanLogic() throws Exception {
+	
+		logger.trace(config.toString());
+		String titanConfigFilePath = myconfig.getTitanPropertiesFile();
+		titanGraph = TitanFactory.open(titanConfigFilePath);
+		assertNotNull(titanGraph);
+		
+	}
+	
+	@AfterClass(alwaysRun = true)
+	public synchronized static void cleanAfterClass() throws Exception{
+		
+//		System.out.println("<<<<<<<<class name>>>>>"+method.getDeclaringClass());
+//		System.out.println("<<<<<<<<class name>>>>>"+method.getName());
+		
+		
+		System.out.println("delete components AfterClass");
+		deleteCreatedComponents(getCatalogAsMap());
+//		extentReport.flush();
+
+	}
+	
+	@AfterSuite(alwaysRun = true)
+	public static void shutdownTitan() throws Exception {
+		
+		System.out.println("AfterSuite  - flush report");
+		extentReport.flush();
+		System.out.println("AfterSuite  - perform clean");
+		performClean();
+		System.out.println("AfterSuite  - close report");
+//		extentReport.close();
+		System.out.println("AfterSuite  - close titan");
+		shutdownTitanLogic();
+		System.out.println("AfterSuite  - suite ended");
+	}
+
+	protected static void shutdownTitanLogic() {
+		if (titanGraph.isOpen()) {
+			titanGraph.close();
+		}
+		CassandraUtils.close();
+	}
+
+	@BeforeMethod(alwaysRun = true)
+	public void beforeState(java.lang.reflect.Method method) throws Exception {
+
+
+		ExtentTestManager.startTest(method.getName());
+		String[] parts = this.getClass().getName().toString().split("\\.");
+		String lastOne1 = parts[parts.length-1];
+		String lastOne2 = parts[parts.length-2];
+		getExtendTest().assignCategory(lastOne2 + "-" + lastOne1);
+		getExtendTest().log(Status.INFO, "Test started");
+
+	}
+	
+	@AfterMethod(alwaysRun = true)
+	public void afterState(ITestResult result) throws Exception {
+
+		String testName = result.getName();
+		Throwable throwable = result.getThrowable();
+		int status = result.getStatus();
+		
+		switch(status){
+		case ITestResult.SUCCESS:				
+			getExtendTest().log(Status.PASS, "Test Result : <span class='label success'>Success</span>");
+			break;
+				
+		case ITestResult.FAILURE:
+			getExtendTest().log(Status.ERROR, "ERROR - The following exepction occured");
+			getExtendTest().log(Status.ERROR, result.getThrowable());
+			getExtendTest().log(Status.FAIL, "<span class='label failure'>Failure</span>");
+			break;
+			
+		case ITestResult.SKIP:
+			getExtendTest().log(Status.SKIP, "SKIP - The following exepction occured");
+			break;
+		default:
+			break;
+		}
+
+
+	   	ExtentTestManager.endTest();
+    	extentReport.flush();
+		
+
+	}
+
+	protected static void performClean() throws Exception, FileNotFoundException {
+//		cleanComponents();
+		deleteCreatedComponents(getCatalogAsMap());
+		CassandraUtils.truncateAllKeyspaces();
+	}
+
+	public void verifyErrorCode(RestResponse response, String action, int expectedCode) {
+		assertNotNull("check response object is not null after " + action, response);
+		assertNotNull("check error code exists in response after " + action, response.getErrorCode());
+		assertEquals("Check response code after  + action" + action, expectedCode, response.getErrorCode().intValue());
+	}
+
+	private static void cleanComponents() throws Exception {
+
+		// Components to delete
+		List<String> vfResourcesToDelete = new ArrayList<String>();
+		List<String> nonVfResourcesToDelete = new ArrayList<String>();
+		List<String> servicesToDelete = new ArrayList<String>();
+		List<String> productsToDelete = new ArrayList<String>();
+
+		// Categories to delete
+		List<ImmutableTriple<String, String, String>> productGroupingsToDelete = new ArrayList<>();
+		List<ImmutablePair<String, String>> productSubsToDelete = new ArrayList<>();
+		List<ImmutablePair<String, String>> resourceSubsToDelete = new ArrayList<>();
+		List<String> productCategoriesToDelete = new ArrayList<>();
+		List<String> resourceCategoriesToDelete = new ArrayList<String>();
+		List<String> serviceCategoriesToDelete = new ArrayList<String>();
+
+		List<String> resourcesNotToDelete = config.getResourcesNotToDelete();
+		List<String> resourceCategoriesNotToDelete = config.getResourceCategoriesNotToDelete();
+		List<String> serviceCategoriesNotToDelete = config.getServiceCategoriesNotToDelete();
+
+		Iterable<TitanVertex> vertices = titanGraph.query().has(GraphPropertiesDictionary.LABEL.getProperty(), NodeTypeEnum.Resource.getName()).vertices();
+		if (vertices != null) {
+			Iterator<TitanVertex> iter = vertices.iterator();
+			while (iter.hasNext()) {
+				Vertex vertex = iter.next();
+				Boolean isAbstract = vertex.value(GraphPropertiesDictionary.IS_ABSTRACT.getProperty());
+				// if (!isAbstract) {
+				String name = vertex.value(GraphPropertiesDictionary.NAME.getProperty());
+				String version = vertex.value(GraphPropertiesDictionary.VERSION.getProperty());
+
+				if ((resourcesNotToDelete != null && !resourcesNotToDelete.contains(name)) || (version != null && !version.equals("1.0"))) {
+					String id = vertex.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+					String resourceType = vertex.value(GraphPropertiesDictionary.RESOURCE_TYPE.getProperty());
+					if (name.startsWith("ci")) {
+						if (resourceType.equals(ResourceTypeEnum.VF.name())) {
+							vfResourcesToDelete.add(id);
+						} else {
+							nonVfResourcesToDelete.add(id);
+						}
+					}
+				} else if ((resourcesNotToDelete != null && !resourcesNotToDelete.contains(name)) || (version != null && version.equals("1.0"))) {
+					if ((boolean) vertex.value(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()) == false) {
+						vertex.property(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty(), true);
+					}
+				}
+				// }
+			}
+		}
+		vertices = titanGraph.query().has(GraphPropertiesDictionary.LABEL.getProperty(), NodeTypeEnum.Service.getName()).vertices();
+		if (vertices != null) {
+			Iterator<TitanVertex> iter = vertices.iterator();
+			while (iter.hasNext()) {
+				Vertex vertex = iter.next();
+				String id = vertex.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+				String name = vertex.value(GraphPropertiesDictionary.NAME.getProperty());
+				if (name.startsWith("ci")) {
+					servicesToDelete.add(id);
+				}
+			}
+		}
+
+		vertices = titanGraph.query().has(GraphPropertiesDictionary.LABEL.getProperty(), NodeTypeEnum.Product.getName()).vertices();
+		if (vertices != null) {
+			Iterator<TitanVertex> iter = vertices.iterator();
+			while (iter.hasNext()) {
+				Vertex vertex = iter.next();
+				String id = vertex.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+				String name = vertex.value(GraphPropertiesDictionary.NAME.getProperty());
+				if (name.startsWith("Ci")) {
+					productsToDelete.add(id);
+				}
+			}
+		}
+
+		// Getting categories
+
+		vertices = titanGraph.query().has(GraphPropertiesDictionary.LABEL.getProperty(), NodeTypeEnum.ResourceNewCategory.getName()).vertices();
+		if (vertices != null) {
+			Iterator<TitanVertex> iter = vertices.iterator();
+			while (iter.hasNext()) {
+				Vertex category = iter.next();
+				String name = category.value(GraphPropertiesDictionary.NAME.getProperty());
+				if (!resourceCategoriesNotToDelete.contains(name)) {
+					String catId = category.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+					resourceCategoriesToDelete.add(catId);
+					Iterator<Vertex> subs = category.vertices(Direction.OUT, GraphEdgeLabels.SUB_CATEGORY.getProperty());
+					while (subs.hasNext()) {
+						Vertex sub = subs.next();
+						String subCatId = sub.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+						resourceSubsToDelete.add(new ImmutablePair<String, String>(catId, subCatId));
+					}
+				}
+			}
+		}
+
+		vertices = titanGraph.query().has(GraphPropertiesDictionary.LABEL.getProperty(), NodeTypeEnum.ServiceNewCategory.getName()).vertices();
+		if (vertices != null) {
+			Iterator<TitanVertex> iter = vertices.iterator();
+			while (iter.hasNext()) {
+				Vertex category = iter.next();
+				String name = category.value(GraphPropertiesDictionary.NAME.getProperty());
+				if (!serviceCategoriesNotToDelete.contains(name)) {
+					String id = category.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+					serviceCategoriesToDelete.add(id);
+				}
+			}
+		}
+
+		vertices = titanGraph.query().has(GraphPropertiesDictionary.LABEL.getProperty(), NodeTypeEnum.ProductCategory.getName()).vertices();
+		if (vertices != null) {
+			Iterator<TitanVertex> iter = vertices.iterator();
+			while (iter.hasNext()) {
+				Vertex category = iter.next();
+				String catId = category.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+				productCategoriesToDelete.add(catId);
+				Iterator<Vertex> subs = category.vertices(Direction.OUT, GraphEdgeLabels.SUB_CATEGORY.getProperty());
+				while (subs.hasNext()) {
+					Vertex sub = subs.next();
+					String subCatId = sub.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+					productSubsToDelete.add(new ImmutablePair<String, String>(catId, subCatId));
+					Iterator<Vertex> groupings = sub.vertices(Direction.OUT, GraphEdgeLabels.GROUPING.getProperty());
+					while (groupings.hasNext()) {
+						Vertex grouping = groupings.next();
+						String groupId = grouping.value(GraphPropertiesDictionary.UNIQUE_ID.getProperty());
+						productGroupingsToDelete.add(new ImmutableTriple<String, String, String>(catId, subCatId, groupId));
+					}
+				}
+
+			}
+		}
+
+		titanGraph.tx().commit();
+
+		String adminId = UserRoleEnum.ADMIN.getUserId();
+		String productStrategistId = UserRoleEnum.PRODUCT_STRATEGIST1.getUserId();
+
+		// Component delete
+		for (String id : productsToDelete) {
+			RestResponse deleteProduct = ProductRestUtils.deleteProduct(id, productStrategistId);
+
+		}
+		for (String id : servicesToDelete) {
+			RestResponse deleteServiceById = ServiceRestUtils.deleteServiceById(id, adminId);
+
+		}
+		for (String id : vfResourcesToDelete) {
+			RestResponse deleteResource = ResourceRestUtils.deleteResource(id, adminId);
+
+		}
+
+		for (String id : nonVfResourcesToDelete) {
+			RestResponse deleteResource = ResourceRestUtils.deleteResource(id, adminId);
+
+		}
+
+		// Categories delete - product
+		String componentType = BaseRestUtils.PRODUCT_COMPONENT_TYPE;
+		for (ImmutableTriple<String, String, String> triple : productGroupingsToDelete) {
+			CategoryRestUtils.deleteGrouping(triple.getRight(), triple.getMiddle(), triple.getLeft(), productStrategistId, componentType);
+		}
+		for (ImmutablePair<String, String> pair : productSubsToDelete) {
+			CategoryRestUtils.deleteSubCategory(pair.getRight(), pair.getLeft(), productStrategistId, componentType);
+		}
+		for (String id : productCategoriesToDelete) {
+			CategoryRestUtils.deleteCategory(id, productStrategistId, componentType);
+		}
+
+		// Categories delete - resource
+		componentType = BaseRestUtils.RESOURCE_COMPONENT_TYPE;
+		for (ImmutablePair<String, String> pair : resourceSubsToDelete) {
+			CategoryRestUtils.deleteSubCategory(pair.getRight(), pair.getLeft(), adminId, componentType);
+		}
+		for (String id : resourceCategoriesToDelete) {
+			CategoryRestUtils.deleteCategory(id, adminId, componentType);
+		}
+		// Categories delete - resource
+		componentType = BaseRestUtils.SERVICE_COMPONENT_TYPE;
+		for (String id : serviceCategoriesToDelete) {
+			CategoryRestUtils.deleteCategory(id, adminId, componentType);
+		}
+
+	}
+
+	private static void deleteCreatedComponents(Map<String, List<Component>> convertCatalogResponseToJavaObject) throws IOException {
+		final String userId = UserRoleEnum.DESIGNER.getUserId();
+		
+		List<Component> resourcesArrayList = convertCatalogResponseToJavaObject.get(ComponentTypeEnum.PRODUCT_PARAM_NAME);
+		if (resourcesArrayList.size() > 0) {
+			List<String> collect = buildCollectionUniqueId(resourcesArrayList);
+			for (String uId : collect) {
+				ProductRestUtils.deleteProduct(uId, userId);
+			}
+		}
+		
+		
+		resourcesArrayList = convertCatalogResponseToJavaObject.get(ComponentTypeEnum.SERVICE_PARAM_NAME);
+		if (resourcesArrayList.size() > 0) {
+			List<String> collect = buildCollectionUniqueId(resourcesArrayList);
+			for (String uId : collect) {
+				ServiceRestUtils.markServiceToDelete(uId, userId);
+			}
+			ServiceRestUtils.deleteMarkedServices(userId);
+		}
+
+		
+		resourcesArrayList = convertCatalogResponseToJavaObject.get(ComponentTypeEnum.RESOURCE_PARAM_NAME);
+
+		// List<String> collect = resourcesArrayList.stream().filter(s ->
+		// s.getName().startsWith("ci")).map(e ->
+		// e.getUniqueId()).collect(Collectors.toList());
+
+		// List<Map<String, String>> collect =
+		// resourcesArrayList.stream().filter(s ->
+		// s.getName().startsWith("ci")).map(e ->
+		// e.getAllVersions()).collect(Collectors.toList());
+		/*
+		 * List<String> collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith("ci")) .flatMap(e -> e.getAllVersions().values().stream()).collect(Collectors.toList());
+		 */
+
+		if (!CollectionUtils.isEmpty(resourcesArrayList)) {
+			List<String> collect = buildCollectionUniqueId(resourcesArrayList);
+			for (String uId : collect) {
+				ResourceRestUtils.markResourceToDelete(uId, userId);
+			}
+			ResourceRestUtils.deleteMarkedResources(userId);
+		}
+
+	
+
+	}
+
+	private void deleteCollection(List<Component> componentArrayList, Consumer<String> deleteHandler) {
+
+		if (componentArrayList.size() > 0) {
+			List<String> collect = buildCollectionUniqueId(componentArrayList);
+			for (String uId : collect) {
+				deleteHandler.accept(uId);
+				// ProductRestUtils.deleteProduct(uId, userId);
+			}
+		}
+	}
+
+	protected static List<String> buildCollectionUniqueId(List<Component> resourcesArrayList) {
+
+		// Stream<String> flatMap = resourcesArrayList.stream().filter(s ->
+		// s.getName().startsWith("ci")).map(e -> e.getAllVersions()).map( e ->
+		// e.values()).flatMap( e -> e.stream());
+
+		// List<String> collect = resourcesArrayList.stream()
+		// //
+		// .filter(s -> s.getName().startsWith("ci") )
+		// //
+		// .map(e -> e.getUniqueId())
+
+		// .map( e -> e.values())
+		// .filter(out -> out!=null )
+		// .flatMap( e -> e.stream())
+		// .collect(Collectors.toList());
+
+		// List<String> collect = resourcesArrayList.stream().filter(s ->
+		// s.getName().startsWith("ci"))
+		// .flatMap(e ->
+		// e.getAllVersions().values().stream()).collect(Collectors.toList());
+		ComponentTypeEnum componentTypeEnum = resourcesArrayList.get(0).getComponentType();
+ 
+		List<String> genericCollection = new ArrayList<String>();
+		
+		resourcesArrayList.stream().filter(s -> s.getName().toLowerCase().startsWith("ci") && !s.getName().toLowerCase().equals("cindervolume")).map(e -> e.getUniqueId()).collect(Collectors.toList()).forEach((i) -> {
+			buildCollectionBaseOnComponentType(componentTypeEnum, genericCollection, i);
+		});
+		
+	
+		//
+
+		// List<String> collect =
+		// genericCollection.stream().collect(Collectors.toList());
+
+		return genericCollection;
+	}
+
+	public static void buildCollectionBaseOnComponentType(ComponentTypeEnum componentTypeEnum,
+			List<String> genericCollection, String i) {
+		try {
+			switch (componentTypeEnum) {
+			case RESOURCE:
+				RestResponse resource = ResourceRestUtils.getResource(i);
+				Resource convertResourceResponseToJavaObject = ResponseParser.convertResourceResponseToJavaObject(resource.getResponse());
+				Map<String, String> allVersions = convertResourceResponseToJavaObject.getAllVersions();
+				Collection<String> values = allVersions.values();
+				genericCollection.addAll(values);
+					
+				break;
+			case SERVICE:
+				RestResponse service = ServiceRestUtils.getService(i);
+				Service convertServiceResponseToJavaObject = ResponseParser.convertServiceResponseToJavaObject(service.getResponse());
+				allVersions = convertServiceResponseToJavaObject.getAllVersions();
+				values = allVersions.values();
+				genericCollection.addAll(values);
+
+				break;
+					
+
+			case PRODUCT:
+				RestResponse product = ProductRestUtils.getProduct(i);
+				Product convertProductResponseToJavaObject = ResponseParser.convertProductResponseToJavaObject(product.getResponse());
+				allVersions = convertProductResponseToJavaObject.getAllVersions();
+				values = allVersions.values();
+				genericCollection.addAll(values);
+
+				break;
+
+			// default:
+			// break;
+			}
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+	}
+
+	protected static Map<String, List<Component>> getCatalogAsMap() throws Exception {
+		RestResponse catalog = CatalogRestUtils.getCatalog(UserRoleEnum.DESIGNER.getUserId());
+		Map<String, List<Component>> convertCatalogResponseToJavaObject = ResponseParser.convertCatalogResponseToJavaObject(catalog.getResponse());
+		return convertCatalogResponseToJavaObject;
+	}
+	protected Resource createVfFromCSAR(User sdncModifierDetails, String csarId) throws Exception {
+		// create new resource from Csar
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+
+		resourceDetails.setCsarUUID(csarId);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource createdResource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
+		return createdResource;
+	}
+	
+
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java
new file mode 100644
index 0000000..47efca6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java
@@ -0,0 +1,764 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.api;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.Function;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+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.User;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.Assert;
+
+public class ComponentInstanceBaseTest extends ComponentBaseTest {
+	public static final String acceptHeaderData = "application/json";
+	// Req/cap of container component
+	protected Map<String, List<CapabilityDefinition>> expectedContainerCapabilities;
+	protected Map<String, List<RequirementDefinition>> expectedContainerRequirements;
+	protected Map<String, Map<String, List<RequirementDefinition>>> removedRequirements;
+	protected Map<String, ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>> expectedContInstReqCap;
+
+	protected User sdncPsDetails1;
+	protected User sdncPsDetails2;
+	protected User sdncPmDetails1;
+	protected User sdncPmDetails2;
+	protected User sdncDesignerDetails;
+	protected User sdncAdminDetails;
+	protected User sdncTesterDetails;
+	protected ResourceReqDetails resourceDetailsVFC_01;
+	protected ResourceReqDetails resourceDetailsVFC_02;
+	protected ResourceReqDetails resourceDetailsVF_01;
+	protected ResourceReqDetails resourceDetailsVF_02;
+	protected ResourceReqDetails resourceDetailsCP_01;
+	protected ResourceReqDetails resourceDetailsCP_02;
+	protected ResourceReqDetails resourceDetailsVL_01;
+	protected ResourceReqDetails resourceDetailsVL_02;
+	protected ServiceReqDetails serviceDetails_01;
+	protected ServiceReqDetails serviceDetails_02;
+	protected ServiceReqDetails serviceDetails_03;
+	protected ProductReqDetails productDetails_01;
+	protected ProductReqDetails productDetails_02;
+
+	public void init() {
+		// Req/caps of inner componentInstances
+		expectedContainerCapabilities = new LinkedHashMap<String, List<CapabilityDefinition>>();
+		expectedContainerRequirements = new LinkedHashMap<String, List<RequirementDefinition>>();
+		removedRequirements = new HashMap<>();
+		expectedContInstReqCap = new HashMap<>();
+
+		sdncPsDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+		sdncPsDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST2);
+		sdncPmDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		sdncPmDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER2);
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		resourceDetailsVFC_01 = ElementFactory.getDefaultResourceByType("ciVFC100", NormativeTypesEnum.SOFTWARE_COMPONENT, ResourceCategoryEnum.GENERIC_DATABASE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VFC.toString()); // resourceType = VFC
+		resourceDetailsVFC_02 = ElementFactory.getDefaultResourceByType("ciVFC200", NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VFC.toString());
+		resourceDetailsVF_01 = ElementFactory.getDefaultResourceByType("ciVF100", NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VF.toString());
+		resourceDetailsVF_02 = ElementFactory.getDefaultResourceByType("ciVF200", NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VF.toString());
+		resourceDetailsCP_01 = ElementFactory.getDefaultResourceByType("ciCP100", NormativeTypesEnum.PORT, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(), ResourceTypeEnum.CP.toString());
+		resourceDetailsCP_02 = ElementFactory.getDefaultResourceByType("ciCP200", NormativeTypesEnum.PORT, ResourceCategoryEnum.GENERIC_DATABASE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.CP.toString());
+		resourceDetailsVL_01 = ElementFactory.getDefaultResourceByType("ciVL100", NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VL.toString());
+		resourceDetailsVL_02 = ElementFactory.getDefaultResourceByType("ciVL200", NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VL.toString());
+		serviceDetails_01 = ElementFactory.getDefaultService("ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncDesignerDetails.getUserId());
+		serviceDetails_02 = ElementFactory.getDefaultService("ciNewtestservice2", ServiceCategoriesEnum.MOBILITY, sdncDesignerDetails.getUserId());
+		serviceDetails_03 = ElementFactory.getDefaultService("ciNewtestservice3", ServiceCategoriesEnum.MOBILITY, sdncDesignerDetails.getUserId());
+		productDetails_01 = ElementFactory.getDefaultProduct("ciProduct01");
+		productDetails_02 = ElementFactory.getDefaultProduct("ciProduct02");
+	}
+
+	public ComponentInstanceBaseTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	public void verifyVFReqCap(String componentId) throws Exception {
+		RestResponse restResponse = ResourceRestUtils.getResource(componentId);
+		Resource resource = ResponseParser.parseToObject(restResponse.getResponse(), Resource.class);
+		verifyReqCap(resource);
+	}
+
+	public void verifyServiceReqCap(String componentId) throws Exception {
+		RestResponse restResponse = ServiceRestUtils.getService(componentId, sdncDesignerDetails);
+		Service service = ResponseParser.parseToObject(restResponse.getResponse(), Service.class);
+		verifyReqCap(service);
+	}
+
+	public void verifyProductReqCap(String componentId) throws Exception {
+		RestResponse restResponse = ProductRestUtils.getProduct(componentId, sdncPsDetails1.getUserId());
+		Product product = ResponseParser.parseToObject(restResponse.getResponse(), Product.class);
+		verifyReqCap(product);
+	}
+
+	public void verifyReqCap(Component actualComponent) {
+		verifyContainerReqCap(actualComponent);
+		verifyCompInstReqCap(actualComponent);
+	}
+
+	public RestResponse changeServiceInstanceVersion(String componentUniqueId, String serviceInstanceToReplaceUniqueId, String serviceUniqueId, User sdncModifierDetails, ComponentTypeEnum componentType, boolean isHighestLevel) throws Exception {
+		RestResponse changeResourceInstanceVersion = ProductRestUtils.changeServiceInstanceVersion(componentUniqueId, serviceInstanceToReplaceUniqueId, serviceUniqueId, sdncModifierDetails, componentType);
+		if (changeResourceInstanceVersion.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS) && isHighestLevel) {
+			/*
+			 * // Add RI Capabilities and Requirements to expected MAP --> expectedVfCapabilities and expectedVfRequirements
+			 * 
+			 * ComponentInstance componentInstance = ResponseParser.parseToObjectUsingMapper( changeResourceInstanceVersion.getResponse(), ComponentInstance.class); addCompInstReqCapToExpected(componentInstance, componentType);
+			 */
+		}
+		return changeResourceInstanceVersion;
+	}
+
+	protected void updateExpectedReqCapAfterChangeLifecycleState(String oldContainerUniqueIdToReplace, String newContainerUniqueId) {
+
+		// Update of container req/cap
+
+		Set<String> compInstKeysToChange = new HashSet<>();
+
+		for (String expKey : expectedContainerCapabilities.keySet()) {
+			List<CapabilityDefinition> expCapList = expectedContainerCapabilities.get(expKey);
+			for (CapabilityDefinition cap : expCapList) {
+				String ownerId = cap.getOwnerId();
+
+				if (ownerId.contains(oldContainerUniqueIdToReplace)) {
+					compInstKeysToChange.add(ownerId);
+					cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+				}
+			}
+		}
+
+		for (String expKey : expectedContainerRequirements.keySet()) {
+			List<RequirementDefinition> expCapList = expectedContainerRequirements.get(expKey);
+			for (RequirementDefinition cap : expCapList) {
+				String ownerId = cap.getOwnerId();
+				if (ownerId.contains(oldContainerUniqueIdToReplace)) {
+					compInstKeysToChange.add(ownerId);
+					cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+				}
+			}
+		}
+
+		// Update of internal comp instances req/cap
+		for (String oldKey : compInstKeysToChange) {
+			ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> immutablePair = expectedContInstReqCap.get(oldKey);
+			if (immutablePair != null) {
+				expectedContInstReqCap.remove(oldKey);
+				String newKey = oldKey.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId);
+				expectedContInstReqCap.put(newKey, immutablePair);
+			}
+		}
+
+		// Update of removed req
+		for (String oldKey : compInstKeysToChange) {
+			Map<String, List<RequirementDefinition>> map = removedRequirements.get(oldKey);
+			if (map != null) {
+				removedRequirements.remove(oldKey);
+				String newKey = oldKey.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId);
+				Collection<List<RequirementDefinition>> values = map.values();
+				if (values != null) {
+					for (List<RequirementDefinition> list : values) {
+						for (RequirementDefinition reqDef : list) {
+							reqDef.setOwnerId(reqDef.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+						}
+					}
+				}
+				removedRequirements.put(newKey, map);
+			}
+		}
+	}
+
+	private void verifyCompInstReqCap(Component actualComponent) {
+		List<ComponentInstance> componentInstances = actualComponent.getComponentInstances();
+		if (componentInstances != null) {
+			assertEquals(expectedContInstReqCap.size(), componentInstances.size());
+			for (ComponentInstance compInst : componentInstances) {
+				String uniqueId = compInst.getUniqueId();
+				// System.out.println("Verifying req/cap of component instance
+				// "+ uniqueId);
+				Map<String, List<RequirementDefinition>> actualCompInstReq = compInst.getRequirements();
+				if (actualCompInstReq == null) {
+					actualCompInstReq = new HashMap<>();
+				}
+				Map<String, List<CapabilityDefinition>> actualCompInstCap = compInst.getCapabilities();
+				if (actualCompInstCap == null) {
+					actualCompInstCap = new HashMap<>();
+				}
+				ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> expReqCap = expectedContInstReqCap.get(uniqueId);
+				assertNotNull(expReqCap);
+				// System.out.println("expected instance requirements:
+				// "+expReqCap.right);
+				// System.out.println("expected instance capabilities:
+				// "+expReqCap.left);
+				// System.out.println("actual instance requirements:
+				// "+actualCompInstReq);
+				// System.out.println("actual instance capabilities:
+				// "+actualCompInstCap);
+
+				// REQ comparison
+				compareReqCapMaps(expReqCap.right, actualCompInstReq);
+
+				// CAP comparison
+				compareReqCapMaps(expReqCap.left, actualCompInstCap);
+			}
+
+		} else {
+			assertTrue(expectedContInstReqCap.isEmpty());
+		}
+	}
+
+	private void verifyContainerReqCap(Component actualComponent) {
+		Map<String, List<RequirementDefinition>> actualContainerRequirements = actualComponent.getRequirements();
+		if (actualContainerRequirements == null) {
+			actualContainerRequirements = new HashMap<>();
+		}
+		Map<String, List<CapabilityDefinition>> actualContainerCapabilities = actualComponent.getCapabilities();
+		if (actualContainerCapabilities == null) {
+			actualContainerCapabilities = new HashMap<>();
+		}
+		// System.out.println("Verifying req/cap of container component "+
+		// actualComponent.getUniqueId());
+		// System.out.println("expected container requirements:
+		// "+expectedContainerRequirements);
+		// System.out.println("expected container capabilities:
+		// "+expectedContainerCapabilities);
+		// System.out.println("actual container requirements:
+		// "+actualContainerRequirements);
+		// System.out.println("actual container capabilities:
+		// "+actualContainerCapabilities);
+
+		// REQ comparison
+		compareReqCapMaps(expectedContainerRequirements, actualContainerRequirements);
+
+		// CAP comparison
+		compareReqCapMaps(expectedContainerCapabilities, actualContainerCapabilities);
+	}
+
+	private <T> void compareReqCapMaps(Map<String, List<T>> expectedMap, Map<String, List<T>> actualMap) {
+		assertEquals(expectedMap.size(), actualMap.size());
+		for (String expKey : expectedMap.keySet()) {
+			List<?> expCapList = expectedMap.get(expKey);
+			List<?> actCapList = actualMap.get(expKey);
+			assertEquals(expCapList.size(), actCapList.size());
+			assertEquals(new HashSet<>(expCapList), new HashSet<>(actCapList));
+		}
+	}
+
+	public void addCompInstReqCapToExpected(ComponentInstance componentInstance, ComponentTypeEnum containerComponentType) throws Exception {
+		String uniqueId = componentInstance.getUniqueId();
+		String name = componentInstance.getName();
+		String originComponentId = componentInstance.getComponentUid();
+		RestResponse getResponse = null;
+		ComponentTypeEnum compInstType = getCompInstTypeByContainerType(containerComponentType);
+		Component component = null;
+		if (compInstType == ComponentTypeEnum.RESOURCE) {
+			getResponse = ResourceRestUtils.getResource(sdncDesignerDetails, originComponentId);
+			ResourceRestUtils.checkSuccess(getResponse);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
+		} else if (compInstType == ComponentTypeEnum.SERVICE) {
+			getResponse = ServiceRestUtils.getService(originComponentId, sdncDesignerDetails);
+			ResourceRestUtils.checkSuccess(getResponse);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
+		} else {
+			Assert.fail("Unsupported type - " + containerComponentType);
+		}
+
+		Map<String, List<RequirementDefinition>> resourceRequirements = component.getRequirements();
+		if (resourceRequirements == null) {
+			resourceRequirements = new HashMap<>();
+		}
+		
+		Function<Entry<String, List<RequirementDefinition>>, List<RequirementDefinition>> requirementDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new RequirementDefinition(item)).collect(Collectors.toList()));
+		Map<String, List<RequirementDefinition>> reqCopy = resourceRequirements.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), requirementDefinitionMapper));
+		
+		Map<String, List<CapabilityDefinition>> resourceCapabilities = component.getCapabilities();
+		if (resourceCapabilities == null) {
+			resourceCapabilities = new HashMap<>();
+		}
+		
+		Function<? super Entry<String, List<CapabilityDefinition>>, List<CapabilityDefinition>> capabilityDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new CapabilityDefinition(item)).collect(Collectors.toList()));
+		Map<String, List<CapabilityDefinition>> capCopy = resourceCapabilities.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), capabilityDefinitionMapper));
+		
+		setupContainerExpectedReqCap(uniqueId, name, resourceRequirements, resourceCapabilities);
+		if (component.getComponentType().equals(ComponentTypeEnum.RESOURCE) && ((Resource) component).getResourceType() != ResourceTypeEnum.VF) {
+			setupConstInstExpectedReqCap(uniqueId, name, reqCopy, capCopy);
+		}
+
+		// adding entry for expected componentInstance
+		ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> compInstReqCapPair = new ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>(capCopy, reqCopy);
+		expectedContInstReqCap.put(uniqueId, compInstReqCapPair);
+	}
+
+	private void setupContainerExpectedReqCap(String uniqueId, String name, Map<String, List<RequirementDefinition>> componentRequirements, Map<String, List<CapabilityDefinition>> componentCapabilities) {
+		for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
+			List<RequirementDefinition> reqListToAdd = resReq.getValue();
+			for (RequirementDefinition requirementDefinition : reqListToAdd) {
+				requirementDefinition.setOwnerId(uniqueId);
+				requirementDefinition.setOwnerName(name);
+			}
+			List<RequirementDefinition> expectedReqList = expectedContainerRequirements.get(resReq.getKey());
+			if (expectedReqList == null) {
+				expectedReqList = reqListToAdd;
+			} else {
+				expectedReqList.addAll(reqListToAdd);
+			}
+			expectedContainerRequirements.put(resReq.getKey(), expectedReqList);
+		}
+
+		for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
+			List<CapabilityDefinition> capListToAdd = resCap.getValue();
+			for (CapabilityDefinition capDefinition : capListToAdd) {
+				capDefinition.setOwnerId(uniqueId);
+				capDefinition.setOwnerName(name);
+			}
+			List<CapabilityDefinition> expectedCapList = expectedContainerCapabilities.get(resCap.getKey());
+			if (expectedCapList == null) {
+				expectedCapList = capListToAdd;
+			} else {
+				expectedCapList.addAll(capListToAdd);
+			}
+			expectedContainerCapabilities.put(resCap.getKey(), expectedCapList);
+		}
+	}
+
+	private void setupConstInstExpectedReqCap(String uniqueId, String name, Map<String, List<RequirementDefinition>> componentRequirements, Map<String, List<CapabilityDefinition>> componentCapabilities) {
+		for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
+			List<RequirementDefinition> reqListToAdd = resReq.getValue();
+			for (RequirementDefinition requirementDefinition : reqListToAdd) {
+				requirementDefinition.setOwnerId(uniqueId);
+				requirementDefinition.setOwnerName(name);
+			}
+		}
+
+		for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
+			List<CapabilityDefinition> capListToAdd = resCap.getValue();
+			for (CapabilityDefinition capDefinition : capListToAdd) {
+				capDefinition.setOwnerId(uniqueId);
+				capDefinition.setOwnerName(name);
+			}
+		}
+	}
+
+	private ComponentTypeEnum getCompInstTypeByContainerType(ComponentTypeEnum componentType) {
+		switch (componentType) {
+		case RESOURCE:
+			return ComponentTypeEnum.RESOURCE;
+		case SERVICE:
+			return ComponentTypeEnum.RESOURCE;
+		case PRODUCT:
+			return ComponentTypeEnum.SERVICE;
+		default:
+			break;
+		}
+		return null;
+	}
+
+	public void deleteCompInstReqCapFromExpected(String componentInstanceId) {
+		List<String> entriesRequirementsToRemove = new ArrayList<>();
+		List<String> entriesCapabilitiesToRemove = new ArrayList<>();
+		for (Entry<String, List<RequirementDefinition>> reqEntry : expectedContainerRequirements.entrySet()) {
+			List<RequirementDefinition> reqList = reqEntry.getValue();
+			List<RequirementDefinition> reqListToDelete = new ArrayList<>();
+			for (RequirementDefinition requirementDefinition : reqList) {
+				if (requirementDefinition.getOwnerId().equals(componentInstanceId)) {
+					reqListToDelete.add(requirementDefinition);
+				}
+			}
+			reqList.removeAll(reqListToDelete);
+			if (reqList.isEmpty()) {
+				entriesRequirementsToRemove.add(reqEntry.getKey());
+			}
+		}
+
+		for (String ekey : entriesRequirementsToRemove) {
+			expectedContainerRequirements.remove(ekey);
+		}
+
+		for (Entry<String, List<CapabilityDefinition>> capEntry : expectedContainerCapabilities.entrySet()) {
+			List<CapabilityDefinition> capList = capEntry.getValue();
+			List<CapabilityDefinition> capListToDelete = new ArrayList<>();
+			for (CapabilityDefinition capabilityDefinition : capList) {
+				if (capabilityDefinition.getOwnerId().equals(componentInstanceId)) {
+					capListToDelete.add(capabilityDefinition);
+				}
+			}
+			capList.removeAll(capListToDelete);
+			if (capList.isEmpty()) {
+				entriesCapabilitiesToRemove.add(capEntry.getKey());
+			}
+		}
+		for (String ekey : entriesCapabilitiesToRemove) {
+			expectedContainerCapabilities.remove(ekey);
+		}
+
+		expectedContInstReqCap.remove(componentInstanceId);
+
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse createAtomicInstanceForVF(ResourceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse createAtomicInstanceForService(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse createVFInstance(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse createServiceInstance(ProductReqDetails containerDetails, ServiceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse deleteAtomicInstanceForVF(String compInstUniqueId, ResourceReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse deleteAtomicInstanceForService(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse deleteVFInstance(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
+
+	}
+
+	// Automatically updates the expected req/cap of the container
+	protected RestResponse deleteServiceInstance(String compInstUniqueId, ProductReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, true);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse createAtomicInstanceForVFDuringSetup(ResourceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse createAtomicInstanceForServiceDuringSetup(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse createVFInstanceDuringSetup(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse createServiceInstanceDuringSetup(ProductReqDetails containerDetails, ServiceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse deleteAtomicInstanceForVFDuringSetup(String compInstUniqueId, ResourceReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse deleteAtomicInstanceForServiceDuringSetup(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse deleteVFInstanceDuringSetup(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
+
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	protected RestResponse deleteServiceInstanceDuringSetup(String compInstUniqueId, ProductReqDetails containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, false);
+	}
+
+	protected Component getComponentAndValidateRIs(ComponentReqDetails componentDetails, int numberOfRIs, int numberOfRelations) throws IOException, Exception {
+
+		RestResponse getResponse = null;
+		Component component = null;
+		if (componentDetails instanceof ResourceReqDetails) {
+			getResponse = ResourceRestUtils.getResource(sdncAdminDetails, componentDetails.getUniqueId());
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
+		} else if (componentDetails instanceof ServiceReqDetails) {
+			getResponse = ServiceRestUtils.getService((ServiceReqDetails) componentDetails, sdncAdminDetails);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
+		} else if (componentDetails instanceof ProductReqDetails) {
+			getResponse = ProductRestUtils.getProduct(componentDetails.getUniqueId(), sdncAdminDetails.getUserId());
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Product.class);
+		} else {
+			Assert.fail("Unsupported type of componentDetails - " + componentDetails.getClass().getSimpleName());
+		}
+		ResourceRestUtils.checkSuccess(getResponse);
+		int numberOfActualRIs = component.getComponentInstances() != null ? component.getComponentInstances().size() : 0;
+		int numberOfActualRelations = component.getComponentInstancesRelations() != null ? component.getComponentInstancesRelations().size() : 0;
+		assertEquals("Check number of RIs meet the expected number", numberOfRIs, numberOfActualRIs);
+		assertEquals("Check number of RI relations meet the expected number", numberOfRelations, numberOfActualRelations);
+		verifyReqCap(component);
+
+		return component;
+	}
+
+	protected void getComponentAndValidateRIsAfterChangeLifecycleState(String oldComponentUniqueIdToReplace, ComponentReqDetails componentDetails, int numOfRIs, int numOfRelations) throws IOException, Exception {
+		updateExpectedReqCapAfterChangeLifecycleState(oldComponentUniqueIdToReplace, componentDetails.getUniqueId());
+		getComponentAndValidateRIs(componentDetails, numOfRIs, numOfRelations);
+	}
+
+	private RestResponse createComponentInstance(ComponentReqDetails containerDetails, ComponentReqDetails compInstOriginDetails, User modifier, ComponentTypeEnum containerComponentTypeEnum, boolean isHighestLevel) throws IOException, Exception {
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getComponentResourceInstance(compInstOriginDetails);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, modifier, containerDetails.getUniqueId(), containerComponentTypeEnum);
+		if (createResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_CREATED) && isHighestLevel) {
+			// Add RI Capabilities and Requirements to expected MAP -->
+			// expectedVfCapabilities and expectedVfRequirements
+			ComponentInstance componentInstance = ResponseParser.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+			addCompInstReqCapToExpected(componentInstance, containerComponentTypeEnum);
+		}
+		return createResourceInstanceResponse;
+	}
+
+	private RestResponse deleteComponentInstance(String compInstUniqueId, ComponentReqDetails containerDetails, User modifier, ComponentTypeEnum componentTypeEnum, boolean isHighestLevel) throws Exception {
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(modifier, containerDetails.getUniqueId(), compInstUniqueId, componentTypeEnum);
+		if (deleteResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_DELETE) && isHighestLevel) {
+			deleteCompInstReqCapFromExpected(compInstUniqueId);
+		}
+		return deleteResourceInstanceResponse;
+	}
+
+	// Create Atomic resource ( VFC/CP/VL)
+	protected void createAtomicResource(ResourceReqDetails resourceDetails) throws Exception {
+		RestResponse createResourceResponse = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceResponse);
+
+	}
+
+	protected void createVF(ResourceReqDetails resourceDetails) throws Exception {
+		createVF(resourceDetails, sdncDesignerDetails);
+
+	}
+
+	protected void createVF(ResourceReqDetails resourceDetails, User sdncModifier) throws Exception {
+		RestResponse createVfResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifier);
+		ResourceRestUtils.checkCreateResponse(createVfResponse);
+	}
+
+	protected void createService(ServiceReqDetails serviceDetails) throws Exception {
+		createService(serviceDetails, sdncDesignerDetails);
+	}
+
+	protected void createService(ServiceReqDetails serviceDetails, User sdncModifier) throws Exception {
+		RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifier);
+		ResourceRestUtils.checkCreateResponse(createServiceResponse);
+	}
+
+	protected void createProduct(ProductReqDetails productDetails) throws Exception {
+		createProduct(productDetails, sdncPmDetails1);
+	}
+
+	protected void createProduct(ProductReqDetails productDetails, User sdncModifier) throws Exception {
+		RestResponse createProductResponse = ProductRestUtils.createProduct(productDetails, sdncModifier);
+		ResourceRestUtils.checkCreateResponse(createProductResponse);
+	}
+
+	protected RestResponse associateComponentInstancesForService(RequirementCapabilityRelDef requirementDef, ComponentReqDetails containerDetails, User user) throws IOException {
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, user, containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		deleteAssociatedFromExpected(requirementDef);
+
+		return associateInstances;
+	}
+
+	private void deleteAssociatedFromExpected(RequirementCapabilityRelDef requirementDef) {
+		// removing from requirements
+		RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0);
+		String type = relationship.getRelationship().getType();
+		String fromId = requirementDef.getFromNode();
+		List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
+		List<CapabilityDefinition> capList = expectedContainerCapabilities.get(type);
+		RequirementDefinition toDelete = null;
+		if (reqList != null) {
+			for (RequirementDefinition reqDef : reqList) {
+				if (reqDef.getOwnerId().equals(fromId)) {
+					toDelete = reqDef;
+				}
+			}
+			if (toDelete != null) {
+				reqList.remove(toDelete);
+				if (reqList.isEmpty()) {
+					expectedContainerRequirements.remove(type);
+				}
+				String ownerId = toDelete.getOwnerId();
+				Map<String, List<RequirementDefinition>> map = removedRequirements.get(ownerId);
+				if (map == null) {
+					map = new HashMap<>();
+					removedRequirements.put(ownerId, map);
+				}
+				List<RequirementDefinition> list = map.get(type);
+				if (list == null) {
+					list = new ArrayList<>();
+					map.put(type, list);
+				}
+				list.add(toDelete);
+			}
+		}
+
+		for (CapabilityDefinition capabilityDefinition : capList) {
+			if (capabilityDefinition.getType().equals(type)) {
+				int minOccurrences = Integer.parseInt(capabilityDefinition.getMinOccurrences()) - 1;
+				if (minOccurrences < 0)
+					minOccurrences = 0;
+				String minOccurrencesString = Integer.toString(minOccurrences);
+				capabilityDefinition.setMinOccurrences(minOccurrencesString);
+				if (!capabilityDefinition.getMaxOccurrences().equals("UNBOUNDED")) {
+					int maxOccurrences = Integer.parseInt(capabilityDefinition.getMaxOccurrences()) - 1;
+					if (maxOccurrences < 0)
+						maxOccurrences = 0;
+					String maxOccurrencesString = Integer.toString(maxOccurrences);
+					capabilityDefinition.setMaxOccurrences(maxOccurrencesString);
+				}
+			}
+		}
+		expectedContainerCapabilities.put(type, capList);
+	}
+
+	protected void dissociateComponentInstancesForService(RequirementCapabilityRelDef requirementDef, ComponentReqDetails containerDetails, User user) throws IOException {
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, user, containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(dissociateInstances);
+		addDissociatedToExpected(requirementDef);
+	}
+
+	protected void fulfillCpRequirement(ComponentReqDetails component, String cpCompInstId, String cpReqFulfillerCompInstId, String cpReqFulfillerOwnerId, User user, ComponentTypeEnum containerCompType) throws IOException {
+		// Fulfilling cp's "binding" requirement - US626240
+		String requirementName = "binding";
+		String capType = "tosca.capabilities.network.Bindable";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(user, component);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef reqCapRelation = ElementFactory.getReqCapRelation(cpCompInstId, cpReqFulfillerCompInstId, cpCompInstId, cpReqFulfillerOwnerId, capType, requirementName, capList, reqList);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(reqCapRelation, user, component.getUniqueId(), containerCompType);
+		ResourceRestUtils.checkSuccess(associateInstances);
+	}
+
+	protected void consumeVlCapability(ComponentReqDetails component, String vlCapConsumerCompInstId, String vlCompInstId, String vlCapConsumerOwnerId, User user, ComponentTypeEnum containerCompType) throws IOException {
+		// Consuming vl's "link" capability - US626240
+		String requirementName = "link";
+		String capType = "tosca.capabilities.network.Linkable";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(user, component);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef reqCapRelation = ElementFactory.getReqCapRelation(vlCapConsumerCompInstId, vlCompInstId, vlCapConsumerOwnerId, vlCompInstId, capType, requirementName, capList, reqList);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(reqCapRelation, user, component.getUniqueId(), containerCompType);
+		ResourceRestUtils.checkSuccess(associateInstances);
+	}
+
+	private void addDissociatedToExpected(RequirementCapabilityRelDef requirementDef) {
+		// adding to requirements
+		RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0);
+		String type = relationship.getRelationship().getType();
+		String fromId = requirementDef.getFromNode();
+		Map<String, List<RequirementDefinition>> map = removedRequirements.get(fromId);
+		if (map != null) {
+			List<RequirementDefinition> list = map.get(type);
+			if (list != null && !list.isEmpty()) {
+				List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
+				if (reqList == null) {
+					reqList = new ArrayList<>();
+					expectedContainerRequirements.put(type, reqList);
+				}
+				reqList.add(list.remove(0));
+			}
+		}
+
+		List<CapabilityDefinition> capList = expectedContainerCapabilities.get(type);
+
+		for (CapabilityDefinition capabilityDefinition : capList) {
+			if (capabilityDefinition.getType().equals(type)) {
+				int minOccurrences = Integer.parseInt(capabilityDefinition.getMinOccurrences()) + 1;
+				String minOccurrencesString = Integer.toString(minOccurrences);
+				capabilityDefinition.setMinOccurrences(minOccurrencesString);
+				if (!capabilityDefinition.getMaxOccurrences().equals("UNBOUNDED")) {
+					int maxOccurrences = Integer.parseInt(capabilityDefinition.getMaxOccurrences()) + 1;
+					String maxOccurrencesString = Integer.toString(maxOccurrences);
+					capabilityDefinition.setMaxOccurrences(maxOccurrencesString);
+				}
+			}
+		}
+		expectedContainerCapabilities.put(type, capList);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java
new file mode 100644
index 0000000..2b970fd
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.api;
+
+import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
+
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
+import com.aventstack.extentreports.reporter.ExtentXReporter;
+import com.aventstack.extentreports.reporter.configuration.Protocol;
+import com.aventstack.extentreports.reporter.configuration.Theme;
+
+public class ExtentManager {
+
+    private static ExtentReports extent;
+    
+    public synchronized static ExtentReports getReporter(String filePath) {
+        if (extent == null) {
+        	// initialize the HtmlReporter
+    		ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(filePath);
+    		
+    		// initialize ExtentReports and attach the HtmlReporter
+    		extent = new ExtentReports();
+
+    		// attach all reporters
+    		extent.attachReporter(htmlReporter);
+
+            
+        }
+        
+        return extent;
+    }
+    
+    public synchronized static ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) {
+    	htmlReporter.config().setTheme(Theme.STANDARD);
+    	
+    	htmlReporter.config().setEncoding("UTF-8");
+    	
+    	htmlReporter.config().setProtocol(Protocol.HTTPS);
+    	
+    	htmlReporter.config().setDocumentTitle("ASDC Automation Report");
+    	
+    	htmlReporter.config().setChartVisibilityOnOpen(true);
+    	
+    	htmlReporter.config().setReportName(AutomationUtils.getOSVersion());
+    	
+    	return htmlReporter;
+    }
+    
+    public synchronized static ExtentReports getReporter() {
+        return extent;
+    }
+}
+
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java
new file mode 100644
index 0000000..9c4acd4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.api;
+
+import java.util.HashMap;
+
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+
+
+public class ExtentTestManager {
+
+		private static HashMap<Long, ExtentTest> extentTestMap = new HashMap<Long, ExtentTest>();
+		private static ExtentReports extent = ExtentManager.getReporter();
+
+	    public static synchronized ExtentTest getTest() {
+	        return extentTestMap.get(Thread.currentThread().getId());
+	    }
+
+	    public static synchronized void endTest() {
+//	        extent.endTest(extentTestMap.get(Thread.currentThread().getId()));
+//	        extentTestMap.get(Thread.currentThread().getId()); // This is test
+	    	// TODO: maybe uncomment becuase we will need it only at the end
+	    	extent.flush();
+	    }
+
+	    public static synchronized ExtentTest startTest(String testName) {
+	        return startTest(testName, "");
+	    }
+
+	    public static synchronized ExtentTest startTest(String testName, String desc) {
+	        ExtentTest test = extent.createTest(testName, desc);
+	        extentTestMap.put(Thread.currentThread().getId(), test);
+
+	        return test;
+	    }
+}
+
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java
new file mode 100644
index 0000000..3977f16
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java
@@ -0,0 +1,368 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.api;
+
+public interface Urls {
+
+	final String UPLOAD_ZIP_URL = "http://%s:%s/sdc1/rest/v1/catalog/resources";
+	final String GET_IMAGE_DATA_FROM_ES = "http://%s:%s/resources/imagedata/_search?q=resourceName:%s&pretty=true&size=1000";
+	final String GET_SCRIPT_DATA_FROM_ES = "http://%s:%s/resources/artifactdata/_search?q=resourceName:%s&pretty=true&size=1000";
+	final String GET_ID_LIST_BY_INDEX_FROM_ES = "http://%s:%s/%s/%s/_search?fields=_id&size=1000";
+
+	final String ES_URL = "http://%s:%s";
+	final String GET_SERVICE_CSAR_API1 = "http://%s:%s/sdc2/rest/services/%s/%s";
+	final String GET_SERVICE_CSAR_API2 = "http://%s:%s/sdc2/rest/services/%s/%s/csar";
+
+	final String GET_SERVICE_CSAR_FE_PROXY_API1 = "http://%s:%s/sdc1/portal/rest/services/%s/%s";
+	final String GET_CSAR_USING_SIMULATOR = "http://%s:%s/onboardingci/onbrest/onboarding-api/v1.0/vendor-software-products/packages/%s";
+	final String COPY_CSAR_USING_SIMULATOR = "http://%s:%s/onboardingci/onbrest/onboarding-api/v1.0/vendor-software-products/packages/%s/%s";
+
+	final String GET_HEALTH_CHECK_VIA_PROXY = "http://%s:%s/sdc1/rest/healthCheck";
+
+	// Get back-end config http://172.20.43.132:8080/sdc2/rest/configmgr/get
+	final String GET_CONFIG_MANAGER = "http://%s:%s/sdc2/rest/configmgr/get";
+
+	// Get latest version of all non-abstract resources
+	final String GET_RESOURCE_lATEST_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/resources/latestversion/notabstract";
+
+	final String GET_SERVICE_lATEST_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/services/latestversion/notabstract";
+
+	// Get resource artifact list:
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/resources/alien.nodes.Apache/2.0.0-SNAPSHOT/artifacts
+	final String GET_RESOURCE_ARTIFACTS_LIST = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts";
+
+	// get resource artifact metadata (creation, MD5, etc):
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/resources/alien.nodes.Apache/2.0.0-SNAPSHOT/artifacts/install_apache.sh/metadata
+	final String GET_RESOURCE_ARTIFACT_METADATA = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts/%s/metadata";
+
+	// resource artifact payload:
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/resources/alien.nodes.Apache/2.0.0-SNAPSHOT/artifacts/install_apache.sh
+	final String GET_RESOURCE_ARTIFACT_PAYLOAD = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts/%s";
+
+	final String GET_RESOURCE_ARTIFACT_PAYLOAD_FE_PROXY = "http://%s:%s/sdc1/portal/rest/v1/catalog/resources/%s/%s/artifacts/%s";
+
+	// Get service list: http://172.20.43.124:8080/sdc2/rest/v1/catalog/services
+	final String GET_SERVICE_LIST = "http://%s:%s/sdc2/rest/v1/catalog/services";
+
+	// Get service versions:
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/MyService
+	final String GET_SERVICE_VERSIONS = "http://%s:%s/sdc2/rest/v1/catalog/services/%s";
+
+	// Get service artifact list:
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/alien.nodes.Apache/0.0.1/artifacts
+	final String GET_SERVICE_ARTIFACTS_LIST = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/%s/artifacts";
+
+	// get service artifact metadata (creation, MD5, etc):
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/alien.nodes.Apache/0.0.1/artifacts/install_apache.sh/metadata
+	final String GET_SERVICE_METADATA = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/%s/artifacts/%s/metadata";
+
+	// service artifact payload:
+	// http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/alien.nodes.Apache/0.0.1/artifacts/install_apache.sh
+	final String GET_SERVICE_ARTIFACT_PAYLOAD = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts/%s";
+
+	final String GET_SEARCH_DATA_FROM_ES = "http://%s:%s/%s";
+
+	// ****************************************************USER
+	// URLs********************************************************
+	final String GET_USER = "http://%s:%s/sdc2/rest/v1/user/%s";
+
+	final String GET_USER_ROLE = "http://%s:%s/sdc2/rest/v1/user/%s/role";
+
+	final String CREATE_USER = "http://%s:%s/sdc2/rest/v1/user";
+
+	final String UPDATE_USER = "http://%s:%s/sdc2/rest/v1/user/%s";
+
+	final String UPDATE_USER_ROLE = "http://%s:%s/sdc2/rest/v1/user/%s/role";
+
+	final String DELETE_USER = "http://%s:%s/sdc2/rest/v1/user/%s";
+
+	final String GET_ALL_ADMIN_USERS = "http://%s:%s/sdc2/rest/v1/user/admins";
+
+	final String AUTHORIZE_USER = "http://%s:%s/sdc2/rest/v1/user/authorize";
+
+	final String GET_ALL_TAGS = "http://%s:%s/sdc2/rest/v1/tags";
+
+	final String AUTH_USER = "http://%s:%s/sdc2/rest/v1/user/authorize";
+
+	final String GET_ALL_NOT_ABSTRACT_RESOURCES = "http://%s:%s/sdc2/rest/v1/catalog/resources/certified/notabstract";
+
+	final String GET_ALL_ABSTRACT_RESOURCES = "http://%s:%s/sdc2/rest/v1/catalog/resources/certified/abstract";
+
+	final String QUERY_NEO4J = "http://%s:%s/db/data/transaction";
+	final String CHANGE_IN_NEO4J = "http://%s:%s/db/data/transaction/commit";
+
+	final String GET_ALL_ADMINS = "http://%s:%s/sdc2/rest/v1/user/admins";
+
+	final String GET_USERS_BY_ROLES = "http://%s:%s/sdc2/rest/v1/user/users?roles=%s";
+
+	final String GET_ALL_USERS = "http://%s:%s/sdc2/rest/v1/user/users?roles/";
+
+	// *****************************************ECOMP User
+	// URL's*****************************************************
+	final String ECOMP_PUSH_USER = "http://%s:%s/api/user";
+
+	final String ECOMP_EDIT_USER = "http://%s:%s/api/user/%s";
+
+	final String ECOMP_GET_USER = "http://%s:%s/api/user/%s";
+
+	final String ECOMP_GET_ALL_USERS = "http://%s:%s/api/users";
+
+	final String ECOMP_GET_ALL_AVAILABLE_ROLES = "http://%s:%s/api/roles";
+
+	final String ECOMP_PUSH_USER_ROLES = "http://%s:%s/api/user/%s/roles";
+
+	final String ECOMP_GET_USER_ROLES = "http://%s:%s/api/user/%s/roles";
+
+	// *****************************************Elements*************************************************************
+	final String GET_TAGS_LIST = "http://%s:%s/sdc2/rest/v1/tags";
+
+	final String GET_PROPERTY_SCOPES_LIST = "http://%s:%s/sdc2/rest/v1/propertyScopes";
+
+	final String GET_CONFIGURATION = "http://%s:%s/sdc2/rest/v1/configuration/ui";
+
+	final String GET_ALL_ARTIFACTS = "http://%s:%s/sdc2/rest/v1/artifactTypes";
+
+	final String GET_FOLLWED_LIST = "http://%s:%s/sdc2/rest/v1/followed";
+
+	final String GET_CATALOG_DATA = "http://%s:%s/sdc2/rest/v1/screen";
+
+	// *****************************************Resources
+	// **********************************************************************
+	final String GET_LIST_CERTIFIED_RESOURCE_TEMPLATES = "http://%s:%s/sdc2/rest/v1/resoourceTemplates";
+
+	final String CREATE_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources";
+	final String UPDATE_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s";
+
+	final String IMPORT_RESOURCE_NORMATIVE = "http://%s:%s/sdc2/rest/v1/catalog/upload/multipart";
+
+	final String IMPORT_USER_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/upload/user-resource";
+
+	final String IMPORT_CAPABILITY_TYPE = "http://%s:%s/sdc2/rest/v1/catalog/uploadType/capability";
+	final String IMPORT_CATEGORIES = "http://%s:%s/sdc2/rest/v1/catalog/uploadType/categories";
+	final String IMPORT_GROUP_TYPE = "http://%s:%s/sdc2/rest/v1/catalog/uploadType/grouptypes";
+
+	// last %s is resourceId, resourceId = resourceName.resourceVersion
+	final String GET_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s";
+	final String GET_RESOURCE_BY_NAME_AND_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/resources/resourceName/%s/resourceVersion/%s";
+	final String GET_RESOURCE_BY_CSAR_UUID = "http://%s:%s/sdc2/rest/v1/catalog/resources/csar/%s";
+	final String GET_COMPONENT_REQUIRMENTS_CAPABILITIES = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/requirmentsCapabilities";
+
+	final String DELETE_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s";
+	final String DELETE_RESOURCE_BY_NAME_AND_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s";
+	final String DELETE_SERVICE_BY_NAME_AND_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/%s";
+
+	final String DELETE_MARKED_RESOURCES = "http://%s:%s/sdc2/rest/v1/inactiveComponents/resource";
+	final String DELETE_MARKED_SERVICES = "http://%s:%s/sdc2/rest/v1/inactiveComponents/service";
+
+	final String GET_FOLLOWED_RESOURCES = "http://%s:%s/sdc2/rest/v1/followed/resources/%s";
+	final String CHANGE_RESOURCE_LIFECYCLE_STATE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/lifecycleState/%s";
+	final String CHANGE_SERVICE_LIFECYCLE_STATE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/lifecycleState/%s";
+	final String CHANGE_PRODUCT_LIFECYCLE_STATE = "http://%s:%s/sdc2/rest/v1/catalog/products/%s/lifecycleState/%s";
+	final String CHANGE_COMPONENT_LIFECYCLE_STATE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/lifecycleState/%s";
+
+	final String CREATE_PROPERTY = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties";
+
+	final String UPDATE_RESOURCE_METADATA = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/metadata";
+
+	// ***********************************External API's
+	// (AssetData)****************************************
+	
+	final String DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_ASSET = "http://%s:%s/sdc/v1/catalog/%s/%s/artifacts/%s";
+	final String DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET = "http://%s:%s/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
+
+	final String POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_ASSET = "http://%s:%s/sdc/v1/catalog/%s/%s/artifacts/%s";
+	final String POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET = "http://%s:%s/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
+	
+	final String POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_ASSET = "http://%s:%s/sdc/v1/catalog/%s/%s/artifacts";
+	final String POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET  = "http://%s:%s/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts";
+
+	final String GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_ASSET = "http://%s:%s/sdc/v1/catalog/resources/%s/artifacts/%s";
+	final String GET_DOWNLOAD_SERVICE_ARTIFACT_OF_ASSET = "http://%s:%s/sdc/v1/catalog/services/%s/artifacts/%s";
+
+	final String GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_COMPONENT_INSTANCE = "http://%s:%s/sdc/v1/catalog/resources/%s/resourceInstances/%s/artifacts/%s";
+	final String GET_DOWNLOAD_SERVICE_ARTIFACT_OF_COMPONENT_INSTANCE = "http://%s:%s/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s";
+
+	final String GET_ASSET_LIST = "http://%s:%s/sdc/v1/catalog/%s";
+	final String GET_FILTERED_ASSET_LIST = "http://%s:%s/sdc/v1/catalog/%s?%s";
+	final String GET_TOSCA_MODEL = "http://%s:%s/sdc/v1/catalog/%s/%s/toscaModel";
+	// https://{serverRoot}/sdc/v1/catalog/{assetType}/{uuid}/metadata, where
+	// assetType in {resources, services}
+	final String GET_ASSET_METADATA = "http://%s:%s/sdc/v1/catalog/%s/%s/metadata";
+	final String POST_AUTHORIZATION = "http://%s:%s/sdc2/rest/v1/consumers";
+	final String GET_DOWNLOAD_SERVICE_RI_ARTIFACT = "http://%s:%s/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s";
+	final String GET_DOWNLOAD_SERVICE_ARTIFACT = "http://%s:%s/sdc/v1/catalog/services/%s/artifacts/%s";
+	
+	final String POST_EXTERNAL_API_CREATE_RESOURCE = "http://%s:%s/sdc/v1/catalog/resources";
+	
+	// Change LifeCycle of Resource
+	// https://{serverRoot}:{port}/sdc/v1/catalog/{resources|services}/{uuid}/lifecycleState/{lifecycle state}
+	final String POST_EXTERNAL_API_CHANGE_LIFE_CYCLE_OF_ASSET = "http://%s:%s/sdc/v1/catalog/%s/%s/lifecycleState/%s";
+	
+
+	// *****************************************************************************************************
+
+	final String ADD_ARTIFACT_TO_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/artifacts";
+	final String UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/artifacts/%s";
+	final String ADD_ARTIFACT_TO_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts";
+	final String UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts/%s";
+
+	final String UPLOAD_DELETE_ARTIFACT_OF_COMPONENT = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/artifacts";
+	final String UPDATE_ARTIFACT_OF_COMPONENT = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/artifacts/%s";
+	final String UPLOAD_HEAT_ENV_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/artifacts/%s";
+	// *****************************************************************************************************
+	final String UPLOAD_ARTIFACT_BY_INTERFACE_TO_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/";
+	final String UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/%s";
+
+	final String UPLOAD_ARTIFACT_BY_INTERFACE_TO_COMPONENT = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/";
+	final String UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_COMPONENT = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/%s";
+
+	// *****************************************************************************************************
+	// "/sdc2/v1/services/<serviceName>/<0.1>/artifacts/aaa.hh"
+	final String DISTRIB_DOWNLOAD_SERVICE_ARTIFACT = "/sdc2/rest/v1/catalog/services/%s/%s/artifacts/%s";
+	// "/sdc2/v1/services/<serviceName>/<0.1>/resources/{resourceName}/{resourceVersion}/artifacts/<opeartion_name>_aaa.hh"
+	final String DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT = "/sdc2/rest/v1/catalog/services/%s/%s/resources/%s/%s/artifacts/%s";
+	final String DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL = "/sdc/v1/catalog/services/%s/%s/artifacts/%s";
+	final String DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL = "/sdc/v1/catalog/services/%s/%s/resources/%s/%s/artifacts/%s";
+	final String DOWNLOAD_SERVICE_ARTIFACT_FULL_URL = "http://%s:%s%s";
+	final String DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL = "http://%s:%s%s";
+	// **********************************************************************************
+	final String UI_DOWNLOAD_RESOURCE_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/artifacts/%s";
+	final String UI_DOWNLOAD_SERVICE_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts/%s";
+
+	// **********************************************************************************************************
+	final String UPDATE_PROPERTY = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties/%s";
+
+	final String DELETE_PROPERTY = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties/%s";
+
+	final String GET_PROPERTY = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties/%s";
+
+	// *****************************************************************************************************
+
+	final String VALIDATE_RESOURCE_NAME = "http://%s:%s/sdc2/rest/v1/catalog/resources/validate-name/%s";
+
+	final String CREATE_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services";
+	final String DELETE_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s";
+	final String GET_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s";
+	final String GET_SERVICE_BY_NAME_AND_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/services/serviceName/%s/serviceVersion/%s";
+
+	final String GET_SERVICES_REQUIRMENTS_CAPABILITIES = "http://%s:%s/sdc2/rest/v1/catalog/requirmentsCapabilities/services/%s";
+
+	final String CREATE_COMPONENT_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance";
+	final String DELETE_COMPONENT_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s";
+	final String UPDATE_COMPONENT_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s";
+	final String GET_COMPONENT_INSTANCES = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/componentInstances";
+	// Tal New API
+	final String UPDATE_MULTIPLE_COMPONENT_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/multipleComponentInstance";
+
+	final String CHANGE__RESOURCE_INSTANCE_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/changeVersion";
+
+	final String CREATE_AND_ASSOCIATE_RESOURCE_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/createAndAssociate";
+	final String ASSOCIATE__RESOURCE_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/associate";
+	final String DISSOCIATE__RESOURCE_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/dissociate";
+
+	final String DISTRIBUTION_INIT = "http://%s:%s/init";
+	final String DISTRIBUTION_INIT_RESET = "http://%s:%s/initReset";
+	final String APPROVE_DISTRIBUTION = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution-state/approve";
+	final String REJECT_DISTRIBUTION = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution-state/reject";
+	final String DISTRIBUTION_DOWNLOAD_ARTIFACT = "http://%s:%s/download";
+	final String ACTIVATE_DISTRIBUTION = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution/%s/activate";
+	final String DISTRIBUTION_SERVICE_LIST = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution";
+
+	final String DEPLOY_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution/%s/markDeployed";
+	final String UPDATE_SERVICE_METADATA = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/metadata";
+
+	// Andrey changed name from ADD_PROPERTY_TO_RESOURCE_INSTANCE to
+	// UPDATE_PROPERTY_TO_RESOURCE_INSTANCE
+	final String UPDATE_PROPERTY_TO_RESOURCE_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/property";
+	final String DELETE_PROPERTY_FROM_RESOURCE_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/property/%s";
+	final String UPDATE_RESOURCE_INSTANCE_HEAT_ENV_PARAMS = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts/%s/heatParams";
+
+	// Actions on artifact in resource instance
+	final String ADD_RESOURCE_INSTANCE_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts";
+	final String UPDATE_RESOURCE_INSTANCE_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts/%s";
+	final String DELETE_RESOURCE_INSTANCE_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts/%s";
+
+	// Attributes On Resource instance
+	public static final String UPDATE_ATTRIBUTE_ON_RESOURCE_INSTANCE = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/attribute";
+
+	// ("/services/{serviceId}/resourceInstances/{resourceInstanceId}/artifacts/{artifactId}")
+	final String DOWNLOAD_COMPONENT_INSTANCE_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s";
+
+	// -------------------------------service api
+	// artifact-----------------------------------------------------
+	final String UPDATE_DELETE_SERVICE_API_ARTIFACT = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts/api/%s";
+
+	final String CREATE_ADDITIONAL_INFORMATION_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo";
+	final String UPDATE_ADDITIONAL_INFORMATION_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo/%s";
+	final String DELETE_ADDITIONAL_INFORMATION_RESOURCE = UPDATE_ADDITIONAL_INFORMATION_RESOURCE;
+	final String GET_ADDITIONAL_INFORMATION_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo/%s";
+	final String GET_ALL_ADDITIONAL_INFORMATION_RESOURCE = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo";
+
+	final String CREATE_ADDITIONAL_INFORMATION_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo";
+	final String UPDATE_ADDITIONAL_INFORMATION_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo/%s";
+	final String DELETE_ADDITIONAL_INFORMATION_SERVICE = UPDATE_ADDITIONAL_INFORMATION_SERVICE;
+	final String GET_ADDITIONAL_INFORMATION_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo/%s";
+	final String GET_ALL_ADDITIONAL_INFORMATION_SERVICE = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo";
+
+	final String GET_COMPONENT_AUDIT_RECORDS = "http://%s:%s/sdc2/rest/v1/catalog/audit-records/%s/%s";
+
+	// CONSUMER
+	final String CREATE_CONSUMER = "http://%s:%s/sdc2/rest/v1/consumers";
+	final String GET_CONSUMER = "http://%s:%s/sdc2/rest/v1/consumers/%s";
+	final String DELETE_CONSUMER = "http://%s:%s/sdc2/rest/v1/consumers/%s";
+
+	// Categories
+	final String CREATE_CATEGORY = "http://%s:%s/sdc2/rest/v1/category/%s";
+	final String GET_ALL_CATEGORIES = "http://%s:%s/sdc2/rest/v1/categories/%s";
+	final String GET_ALL_CATEGORIES_FE = "http://%s:%s/sdc1/feProxy/rest/v1/categories/%s";
+	final String DELETE_CATEGORY = "http://%s:%s/sdc2/rest/v1/category/%s/%s";
+	final String CREATE_SUB_CATEGORY = "http://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory";
+	final String DELETE_SUB_CATEGORY = "http://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory/%s";
+	final String CREATE_GROUPING = "http://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory/%s/grouping";
+	final String DELETE_GROUPING = "http://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory/%s/grouping/%s";
+
+	// product
+	final String CREATE_PRODUCT = "http://%s:%s/sdc2/rest/v1/catalog/products";
+	final String DELETE_PRODUCT = "http://%s:%s/sdc2/rest/v1/catalog/products/%s";
+	// last %s is resourceId, productId
+	final String GET_PRODUCT = "http://%s:%s/sdc2/rest/v1/catalog/products/%s";
+	final String UPDATE_PRODUCT = "http://%s:%s/sdc2/rest/v1/catalog/products/%s/metadata";
+	final String GET_PRODUCT_BY_NAME_AND_VERSION = "http://%s:%s/sdc2/rest/v1/catalog/products/productName/%s/productVersion/%s";
+
+	// groups
+	final String GET_GROUP_BY_ID = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/groups/%s";
+
+	// modules
+	final String GET_MODULE_BY_ID = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/groups/%s";
+	
+	// inputs
+	final String ADD_INPUTS = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/create/inputs"; //{componentType}/{componentId}/create/inputs
+	final String DELETE_INPUT_BY_ID = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/delete/%s/input"; //{componentType}/{componentId}/delete/{inputId}/input
+	final String GET_COMPONENT_INPUTS = "http://%s:%s/sdc2/rest/v1/catalog/services/%s/inputs"; //services/{componentId}/inputs
+	final String GET_COMPONENT_INSTANCE_INPUTS = "http://%s:%s/sdc2/rest/v1/catalog/%s/%s/componentInstances/%s/%s/inputs"; //{componentType}/{componentId}/componentInstances/{instanceId}/{originComonentUid}/inputs
+	final String GET_INPUTS_FOR_COMPONENT_INPUT = "http://%s:%s/sdc2/rest/v1/catalog/resources/%s/groups/%s"; //{componentType}/{componentId}/inputs/{inputId}/inputs
+
+	// check version
+	final String ONBOARD_VERSION = "http://%s:%s/onboarding-api/docs/build-info.json";
+	final String OS_VERSION = "http://%s:%s/sdc2/rest/version";
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java
new file mode 100644
index 0000000..d2e8d14
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java
@@ -0,0 +1,696 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.config;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.List;
+
+import org.yaml.snakeyaml.Yaml;
+
+public class Config {
+
+	private static String WINDOWS_CONFIG_FILE = "src/main/resources/ci/conf/attsdc.yaml";
+	private boolean systemUnderDebug;
+	private boolean rerun;
+	private String reportDBhost;
+	private int reportDBport;
+	
+	private String browser;
+	private String catalogBeHost;
+	private String esHost;
+	private String esPort;
+	private String neoHost;
+	private String neoPort;
+	private String disributionClientHost;
+	private String disributionClientPort;
+	private boolean isDistributionClientRunning;
+
+
+	private String errorConfigurationFile;
+	private String resourceConfigDir;
+	private String componentsConfigDir;
+	private String importResourceConfigDir;
+	private String importResourceTestsConfigDir;
+	private String importTypesConfigDir;
+
+	private String testSuites;
+
+	private String catalogFeHost;
+	private String catalogFePort;
+	private String catalogBePort;
+	private String catalogBeTlsPort;
+
+	private String neoDBusername;
+	private String neoDBpassword;
+
+	private String titanPropertiesFile;
+	private List<String> packages;
+	private List<String> bugs;
+	private List<String> resourcesNotToDelete;
+	private List<String> resourceCategoriesNotToDelete;
+	private List<String> serviceCategoriesNotToDelete;
+	private boolean stopOnClassFailure = false;
+
+	private String outputFolder;
+	private String reportName;
+	private String url;
+	private String remoteTestingMachineIP;
+	private String remoteTestingMachinePort;
+	private boolean remoteTesting;
+
+	private String cassandraHost;
+	private String cassandraAuditKeySpace;
+	private String cassandraArtifactKeySpace;
+	private boolean cassandraAuthenticate;
+	private String cassandraUsername;
+	private String cassandraPassword;
+	private boolean cassandraSsl;
+	private String cassandraTruststorePath;
+	private String cassandraTruststorePassword;
+	private String windowsDownloadDirectory;
+	private boolean captureTraffic;
+	private boolean useBrowserMobProxy;
+	
+	private static Config configIt = null;
+
+	private static Yaml yaml = new Yaml();
+
+	
+	private Config() {
+		super();
+	}
+
+	public static class TestPackages {
+
+		List<String> packages;
+		List<String> bugs;
+
+		public List<String> getPackages() {
+			return packages;
+		}
+
+		public void setPackages(List<String> packages) {
+			this.packages = packages;
+		}
+
+		public List<String> getBugs() {
+			return bugs;
+		}
+
+		public void setBugs(List<String> bugs) {
+			this.bugs = bugs;
+		}
+
+		@Override
+		public String toString() {
+			return "TestPackages [packages=" + packages + ", bugs=" + bugs + "]";
+		}
+
+	}
+
+	public synchronized static Config instance() {
+		if (configIt == null) {
+			try {
+				configIt = init();
+			} catch (IOException e) {
+				e.printStackTrace();
+				return null;
+			}
+		}
+		return configIt;
+	}
+
+	private static Config init() throws IOException {
+
+		Config config = null;
+
+		String configFile = System.getProperty("config.resource");
+		if (configFile == null) {
+			if (System.getProperty("os.name").contains("Windows")) {
+				configFile = WINDOWS_CONFIG_FILE;
+			} else {
+				throw new RuntimeException("Please Add Jvm Argument config.resource");
+			}
+		}
+
+		File file = new File(configFile);
+		if (false == file.exists()) {
+			throw new RuntimeException("The config file " + configFile + " cannot be found.");
+		}
+
+		InputStream in = null;
+		try {
+
+			in = Files.newInputStream(Paths.get(configFile));
+
+			config = yaml.loadAs(in, Config.class);
+
+			setPackagesAndBugs(configFile, config);
+
+		} finally {
+			if (in != null) {
+				try {
+					in.close();
+				} catch (IOException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		}
+
+		// JsonReader jsonReader = new JsonReader(new FileReader(configFile));
+		// Config configAttOdlIt = new Gson().fromJson(jsonReader,
+		// Config.class);
+
+		return config;
+	}
+
+	private static void setPackagesAndBugs(String path, Config config) throws IOException {
+
+		int separator = Math.max(path.lastIndexOf("\\"), path.lastIndexOf("/"));
+		String dirPath = path.substring(0, separator + 1);
+		String packagesFile = dirPath + File.separator + "attsdc-packages.yaml";
+		File file = new File(packagesFile);
+		if (false == file.exists()) {
+			throw new RuntimeException("The config file " + packagesFile + " cannot be found.");
+		}
+
+		TestPackages testPackages = null;
+		InputStream in = null;
+		try {
+
+			in = Files.newInputStream(Paths.get(packagesFile));
+
+			testPackages = yaml.loadAs(in, TestPackages.class);
+
+			List<String> bugs = testPackages.getBugs();
+			List<String> packages = testPackages.getPackages();
+
+			config.setBugs(bugs);
+			config.setPackages(packages);
+
+		} finally {
+			if (in != null) {
+				try {
+					in.close();
+				} catch (IOException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		}
+
+	}
+
+	// public Config(String catalogBeHost, String esHost, String esPort, String
+	// resourceConfigDir, String componentsConfigDir, String catalogFeHost,
+	// String catalogFePort, String catalogBePort) {
+	// super();
+	// this.catalogBeHost = catalogBeHost;
+	// this.esHost = esHost;
+	// this.esPort = esPort;
+	// this.resourceConfigDir = resourceConfigDir;
+	// this.componentsConfigDir = componentsConfigDir;
+	// this.catalogFeHost = catalogFeHost;
+	// this.catalogFePort = catalogFePort;
+	// this.catalogBePort = catalogBePort;
+	// }
+
+	String configurationFile;
+	
+	public boolean getSystemUnderDebug() {
+		return systemUnderDebug;
+	}
+
+	public void setSystemUnderDebug(boolean systemUnderDebug) {
+		this.systemUnderDebug = systemUnderDebug;
+	}
+
+	public boolean getRerun() {
+		return rerun;
+	}
+
+	public void setRerun(boolean rerun) {
+		this.rerun = rerun;
+	}
+	
+	public String getReportDBhost() {
+		return reportDBhost;
+	}
+
+	public void setReportDBhost(String reportDBhost) {
+		this.reportDBhost = reportDBhost;
+	}
+
+	public int getReportDBport() {
+		return reportDBport;
+	}
+
+	public void setReportDBport(int reportDBport) {
+		this.reportDBport = reportDBport;
+	}
+//	public boolean isUsingBrowserMobProxy() {
+//		return useBrowserMobProxy;
+//	}
+//
+//	public void setUsingBrowserMobProxy(boolean usingBrowserMobProxy) {
+//		this.useBrowserMobProxy = usingBrowserMobProxy;
+//	} 
+
+	
+	
+	
+	public String getBrowser() {
+		return browser;
+	}
+	
+	public boolean getUseBrowserMobProxy() {
+		return useBrowserMobProxy;
+	}
+
+	public void setUseBrowserMobProxy(boolean useBrowserMobProxy) {
+		this.useBrowserMobProxy = useBrowserMobProxy;
+	}
+
+
+
+	public boolean getCaptureTraffic() {
+		return captureTraffic;
+	}
+
+	public void setCaptureTraffic(boolean captureTraffic) {
+		this.captureTraffic = captureTraffic;
+	}
+
+	public void setBrowser(String browser) {
+		this.browser = browser;
+	}
+
+	public String getConfigurationFile() {
+		return configurationFile;
+	}
+
+	public void setConfigurationFile(String configurationFile) {
+		this.configurationFile = configurationFile;
+	}
+
+	public boolean getIsDistributionClientRunning() {
+		return isDistributionClientRunning;
+	}
+
+	public void setIsDistributionClientRunning(boolean isDistributionClientRunning) {
+		this.isDistributionClientRunning = isDistributionClientRunning;
+	}
+	
+	public String getCatalogBePort() {
+		return catalogBePort;
+	}
+
+	public String getDisributionClientHost() {
+		return disributionClientHost;
+	}
+
+	public void setDisributionClientHost(String disributionClientHost) {
+		this.disributionClientHost = disributionClientHost;
+	}
+
+	public String getDisributionClientPort() {
+		return disributionClientPort;
+	}
+
+	public void setDisributionClientPort(String disributionClientPort) {
+		this.disributionClientPort = disributionClientPort;
+	}
+
+	public void setCatalogBePort(String catalogBePort) {
+		this.catalogBePort = catalogBePort;
+	}
+
+	public String getCatalogFeHost() {
+		return catalogFeHost;
+	}
+
+	public void setCatalogFeHost(String catalogFeHost) {
+		this.catalogFeHost = catalogFeHost;
+	}
+
+	public String getCatalogFePort() {
+		return catalogFePort;
+	}
+
+	public void setCatalogFePort(String catalogFePort) {
+		this.catalogFePort = catalogFePort;
+	}
+
+	public String getCatalogBeHost() {
+		return catalogBeHost;
+	}
+
+	public void setCatalogBeHost(String catalogBeHost) {
+		this.catalogBeHost = catalogBeHost;
+	}
+
+	public String getEsHost() {
+		return esHost;
+	}
+
+	public void setEsHost(String esHost) {
+		this.esHost = esHost;
+	}
+
+	public String getEsPort() {
+		return esPort;
+	}
+
+	public void setEsPort(String esPort) {
+		this.esPort = esPort;
+	}
+
+	public String getResourceConfigDir() {
+		return resourceConfigDir;
+	}
+
+	public void setResourceConfigDir(String resourceConfigDir) {
+		this.resourceConfigDir = resourceConfigDir;
+	}
+
+	public String getComponentsConfigDir() {
+		return componentsConfigDir;
+	}
+
+	public void setComponentsConfigDir(String componentsConfigDir) {
+		this.componentsConfigDir = componentsConfigDir;
+	}
+
+	public String getOutputFolder() {
+		return outputFolder;
+	}
+
+	public void setOutputFolder(String outputFolder) {
+		this.outputFolder = outputFolder;
+	}
+
+	public String getReportName() {
+		return reportName;
+	}
+
+	public void setReportName(String reportName) {
+		this.reportName = reportName;
+	}
+
+	public String getNeoPort() {
+		return neoPort;
+	}
+
+	public void setNeoPort(String neoPort) {
+		this.neoPort = neoPort;
+	}
+
+	public String getNeoHost() {
+		return neoHost;
+	}
+
+	public void setNeoHost(String neoHost) {
+		this.neoHost = neoHost;
+	}
+
+	public String getNeoDBpassword() {
+		return neoDBpassword;
+	}
+
+	public String getNeoDBusername() {
+		return neoDBusername;
+	}
+
+	public void setNeoDBusername(String neoDBusername) {
+		this.neoDBusername = neoDBusername;
+	}
+
+	public void setNeoDBpassword(String neoDBpassword) {
+		this.neoDBpassword = neoDBpassword;
+	}
+
+	public String getTitanPropertiesFile() {
+		return titanPropertiesFile;
+	}
+
+	public void setTitanPropertiesFile(String titanPropertiesFile) {
+		this.titanPropertiesFile = titanPropertiesFile;
+	}
+
+	public List<String> getPackages() {
+		return packages;
+	}
+
+	public void setPackages(List<String> packages) {
+		this.packages = packages;
+	}
+
+	public List<String> getBugs() {
+		return bugs;
+	}
+
+	public void setBugs(List<String> bugs) {
+		this.bugs = bugs;
+	}
+
+	public boolean isStopOnClassFailure() {
+		return stopOnClassFailure;
+	}
+
+	public void setStopOnClassFailure(boolean stopOnClassFailure) {
+		this.stopOnClassFailure = stopOnClassFailure;
+	}
+
+	public String getImportResourceConfigDir() {
+		return importResourceConfigDir;
+	}
+
+	public void setImportResourceConfigDir(String importResourceConfigDir) {
+		this.importResourceConfigDir = importResourceConfigDir;
+	}
+
+	public String getImportResourceTestsConfigDir() {
+		return importResourceTestsConfigDir;
+	}
+
+	public void setImportResourceTestsConfigDir(String importResourceTestsConfigDir) {
+		this.importResourceTestsConfigDir = importResourceTestsConfigDir;
+	}
+
+	public String getErrorConfigurationFile() {
+		return errorConfigurationFile;
+	}
+
+	public void setErrorConfigurationFile(String errorConfigurationFile) {
+		this.errorConfigurationFile = errorConfigurationFile;
+	}
+
+	public String getCatalogBeTlsPort() {
+		return catalogBeTlsPort;
+	}
+
+	public void setCatalogBeTlsPort(String catalogBeTlsPort) {
+		this.catalogBeTlsPort = catalogBeTlsPort;
+	}
+
+	public List<String> getResourcesNotToDelete() {
+		return resourcesNotToDelete;
+	}
+
+	public void setResourcesNotToDelete(List<String> resourcesNotToDelete) {
+		this.resourcesNotToDelete = resourcesNotToDelete;
+	}
+
+	public List<String> getResourceCategoriesNotToDelete() {
+		return resourceCategoriesNotToDelete;
+	}
+
+	public void setResourceCategoriesNotToDelete(List<String> resourceCategoriesNotToDelete) {
+		this.resourceCategoriesNotToDelete = resourceCategoriesNotToDelete;
+	}
+
+	public List<String> getServiceCategoriesNotToDelete() {
+		return serviceCategoriesNotToDelete;
+	}
+
+	public void setServiceCategoriesNotToDelete(List<String> serviceCategoriesNotToDelete) {
+		this.serviceCategoriesNotToDelete = serviceCategoriesNotToDelete;
+	}
+
+	public String getImportTypesConfigDir() {
+		return importTypesConfigDir;
+	}
+
+	public void setImportTypesConfigDir(String importTypesConfigDir) {
+		this.importTypesConfigDir = importTypesConfigDir;
+	}
+
+	public String getCassandraHost() {
+		return cassandraHost;
+	}
+
+	public void setCassandraHost(String cassandraHost) {
+		this.cassandraHost = cassandraHost;
+	}
+
+	public String getCassandraAuditKeySpace() {
+		return cassandraAuditKeySpace;
+	}
+
+	public void setCassandraAuditKeySpace(String cassandraAuditKeySpace) {
+		this.cassandraAuditKeySpace = cassandraAuditKeySpace;
+	}
+
+	public String getCassandraArtifactKeySpace() {
+		return cassandraArtifactKeySpace;
+	}
+
+	public void setCassandraArtifactKeySpace(String cassandraArtifactKeySpace) {
+		this.cassandraArtifactKeySpace = cassandraArtifactKeySpace;
+	}
+
+	
+	public String getWindowsDownloadDirectory() {
+		return windowsDownloadDirectory;
+	}
+	
+	public void setWindowsDownloadDirectory(String windowsDownloadDirectory) {
+		this.windowsDownloadDirectory = windowsDownloadDirectory;
+	}
+	
+	@Override
+	public String toString() {
+		return "Config [systemUnderDebug=" + systemUnderDebug + ", rerun=" + rerun + ", reportDBhost=" + reportDBhost
+				+ ", reportDBport=" + reportDBport + ", browser=" + browser + ", catalogBeHost=" + catalogBeHost
+				+ ", esHost=" + esHost + ", esPort=" + esPort + ", neoHost=" + neoHost + ", neoPort=" + neoPort
+				+ ", disributionClientHost=" + disributionClientHost + ", disributionClientPort="
+				+ disributionClientPort + ", isDistributionClientRunning=" + isDistributionClientRunning
+				+ ", errorConfigurationFile=" + errorConfigurationFile + ", resourceConfigDir=" + resourceConfigDir
+				+ ", componentsConfigDir=" + componentsConfigDir + ", importResourceConfigDir="
+				+ importResourceConfigDir + ", importResourceTestsConfigDir=" + importResourceTestsConfigDir
+				+ ", importTypesConfigDir=" + importTypesConfigDir + ", testSuites=" + testSuites + ", catalogFeHost="
+				+ catalogFeHost + ", catalogFePort=" + catalogFePort + ", catalogBePort=" + catalogBePort
+				+ ", catalogBeTlsPort=" + catalogBeTlsPort + ", neoDBusername=" + neoDBusername + ", neoDBpassword="
+				+ neoDBpassword + ", titanPropertiesFile=" + titanPropertiesFile + ", packages=" + packages + ", bugs="
+				+ bugs + ", resourcesNotToDelete=" + resourcesNotToDelete + ", resourceCategoriesNotToDelete="
+				+ resourceCategoriesNotToDelete + ", serviceCategoriesNotToDelete=" + serviceCategoriesNotToDelete
+				+ ", stopOnClassFailure=" + stopOnClassFailure + ", outputFolder=" + outputFolder + ", reportName="
+				+ reportName + ", url=" + url + ", remoteTestingMachineIP=" + remoteTestingMachineIP
+				+ ", remoteTestingMachinePort=" + remoteTestingMachinePort + ", remoteTesting=" + remoteTesting
+				+ ", cassandraHost=" + cassandraHost + ", cassandraAuditKeySpace=" + cassandraAuditKeySpace
+				+ ", cassandraArtifactKeySpace=" + cassandraArtifactKeySpace + ", cassandraAuthenticate="
+				+ cassandraAuthenticate + ", cassandraUsername=" + cassandraUsername + ", cassandraPassword="
+				+ cassandraPassword + ", cassandraSsl=" + cassandraSsl + ", cassandraTruststorePath="
+				+ cassandraTruststorePath + ", cassandraTruststorePassword=" + cassandraTruststorePassword
+				+ ", windowsDownloadDirectory=" + windowsDownloadDirectory + ", captureTraffic=" + captureTraffic
+				+ ", useBrowserMobProxy=" + useBrowserMobProxy + ", configurationFile=" + configurationFile + "]";
+	}
+
+	public boolean isRemoteTesting() {
+		return remoteTesting;
+	}
+
+	public void setRemoteTesting(boolean remoteTesting) {
+		this.remoteTesting = remoteTesting;
+	}
+
+	public String getUrl() {
+		try {
+			return url;
+		} catch (Exception e) {
+			return null;
+		}
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public String getRemoteTestingMachineIP() {
+		return remoteTestingMachineIP;
+	}
+
+	public void setRemoteTestingMachineIP(String remoteTestingMachineIP) {
+		this.remoteTestingMachineIP = remoteTestingMachineIP;
+	}
+
+	public String getRemoteTestingMachinePort() {
+		return remoteTestingMachinePort;
+	}
+
+	public void setRemoteTestingMachinePort(String remoteTestingMachinePort) {
+		this.remoteTestingMachinePort = remoteTestingMachinePort;
+	}
+
+	public boolean getCassandraAuthenticate() {
+		return cassandraAuthenticate;
+	}
+
+	public void setCassandraAuthenticate(boolean cassandraAuthenticate) {
+		this.cassandraAuthenticate = cassandraAuthenticate;
+	}
+
+	public String getCassandraUsername() {
+		return cassandraUsername;
+	}
+
+	public void setCassandraUsername(String cassandraUsername) {
+		this.cassandraUsername = cassandraUsername;
+	}
+
+	public String getCassandraPassword() {
+		return cassandraPassword;
+	}
+
+	public void setCassandraPassword(String cassandraPassword) {
+		this.cassandraPassword = cassandraPassword;
+	}
+
+	public boolean getCassandraSsl() {
+		return cassandraSsl;
+	}
+
+	public void setCassandraSsl(boolean cassandraSsl) {
+		this.cassandraSsl = cassandraSsl;
+	}
+
+	public String getCassandraTruststorePath() {
+		return cassandraTruststorePath;
+	}
+
+	public void setCassandraTruststorePath(String cassandraTruststorePath) {
+		this.cassandraTruststorePath = cassandraTruststorePath;
+	}
+
+	public String getCassandraTruststorePassword() {
+		return cassandraTruststorePassword;
+	}
+
+	public void setCassandraTruststorePassword(String cassandraTruststorePassword) {
+		this.cassandraTruststorePassword = cassandraTruststorePassword;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java
new file mode 100644
index 0000000..fbc493f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.testng.IInvokedMethod;
+import org.testng.IInvokedMethodListener;
+import org.testng.ITestResult;
+import org.testng.SkipException;
+import org.testng.internal.TestResult;
+
+public class InvokedMethodListener implements IInvokedMethodListener {
+
+	static Map<String, Integer> methodFailCount = new HashMap<String, Integer>();
+
+	@Override
+
+	public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
+
+		if (methodFailCount.get(method.getTestMethod().getMethodName()) != null
+				&& methodFailCount.get(method.getTestMethod().getMethodName()) > 1)
+			throw new SkipException("Skipped due to failure count > 1");
+		;
+
+	}
+
+	@Override
+
+	public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
+
+		if (testResult.getStatus() == TestResult.FAILURE) {
+			if (methodFailCount.get(method.getTestMethod().getMethodName()) == null)
+				methodFailCount.put(method.getTestMethod().getMethodName(), 1);
+			else {
+				methodFailCount.put(method.getTestMethod().getMethodName(),
+						methodFailCount.get(method.getTestMethod().getMethodName()) + 1);
+			}
+
+		}
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java
new file mode 100644
index 0000000..41936e2
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class ArtifactAssetStructure {
+
+	String artifactName;
+	String artifactType;
+	String artifactURL;
+	String artifactDescription;
+	int artifactTimeout;// optional
+	String artifactChecksum;
+	String artifactUUID;
+	String artifactVersion;
+	String generatedFromUUID;// optional
+
+	public ArtifactAssetStructure(String artifactName, String artifactType, String artifactURL,
+			String artifactDescription, int artifactTimeout, String artifactChecksum, String artifactUUID,
+			String artifactVersion, String generatedFromUUID) {
+		super();
+		this.artifactName = artifactName;
+		this.artifactType = artifactType;
+		this.artifactURL = artifactURL;
+		this.artifactDescription = artifactDescription;
+		this.artifactTimeout = artifactTimeout;
+		this.artifactChecksum = artifactChecksum;
+		this.artifactUUID = artifactUUID;
+		this.artifactVersion = artifactVersion;
+		this.generatedFromUUID = generatedFromUUID;
+	}
+
+	public ArtifactAssetStructure() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public String getArtifactName() {
+		return artifactName;
+	}
+
+	public void setArtifactName(String artifactName) {
+		this.artifactName = artifactName;
+	}
+
+	public String getArtifactType() {
+		return artifactType;
+	}
+
+	public void setArtifactType(String artifactType) {
+		this.artifactType = artifactType;
+	}
+
+	public String getArtifactURL() {
+		return artifactURL;
+	}
+
+	public void setArtifactURL(String artifactURL) {
+		this.artifactURL = artifactURL;
+	}
+
+	public String getArtifactDescription() {
+		return artifactDescription;
+	}
+
+	public void setArtifactDescription(String artifactDescription) {
+		this.artifactDescription = artifactDescription;
+	}
+
+	public int getArtifactTimeout() {
+		return artifactTimeout;
+	}
+
+	public void setArtifactTimeout(int artifactTimeout) {
+		this.artifactTimeout = artifactTimeout;
+	}
+
+	public String getArtifactChecksum() {
+		return artifactChecksum;
+	}
+
+	public void setArtifactChecksum(String artifactChecksum) {
+		this.artifactChecksum = artifactChecksum;
+	}
+
+	public String getArtifactUUID() {
+		return artifactUUID;
+	}
+
+	public void setArtifactUUID(String artifactUUID) {
+		this.artifactUUID = artifactUUID;
+	}
+
+	public String getArtifactVersion() {
+		return artifactVersion;
+	}
+
+	public void setArtifactVersion(String artifactVersion) {
+		this.artifactVersion = artifactVersion;
+	}
+
+	public String getGeneratedFromUUID() {
+		return generatedFromUUID;
+	}
+
+	public void setGeneratedFromUUID(String generatedFromUUID) {
+		this.generatedFromUUID = generatedFromUUID;
+	}
+
+	@Override
+	public String toString() {
+		return "ArtifactAssetStructure [artifactName=" + artifactName + ", artifactType=" + artifactType
+				+ ", artifactURL=" + artifactURL + ", artifactDescription=" + artifactDescription + ", artifactTimeout="
+				+ artifactTimeout + ", artifactChecksum=" + artifactChecksum + ", artifactUUID=" + artifactUUID
+				+ ", artifactVersion=" + artifactVersion + ", generatedFromUUID=" + generatedFromUUID + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java
new file mode 100644
index 0000000..93f65b9
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java
@@ -0,0 +1,243 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.HeatParameterDefinition;
+
+public class ArtifactReqDetails {
+
+	public ArtifactReqDetails() {
+
+	}
+
+	public ArtifactReqDetails(String artifactName, String artifactType, String artifactDescription, String payloadData,
+			String artifactLable) {
+		super();
+		this.artifactName = artifactName;
+		this.artifactType = artifactType;
+		this.description = artifactDescription;
+		this.payloadData = payloadData;
+		this.artifactLabel = artifactLable;
+	}
+
+	public ArtifactReqDetails(String artifactLable, ArtifactReqDetails a) {
+		super();
+		this.artifactName = a.getArtifactName();
+		this.artifactType = a.getArtifactType();
+		this.description = a.getArtifactType();
+		this.payloadData = a.getPayload();
+		this.artifactLabel = artifactLable;
+	}
+
+	private String uniqueId;
+	private String artifactName;
+	private String artifactType;
+	private String description;
+	private String payloadData;
+	private String artifactLabel;
+	private String apiUrl;
+	private String artifactGroupType;
+	private Integer timeout;
+	private String userIdLastUpdater;
+	private String creatorFullName;
+	private String updaterFullName;
+	private String artifactChecksum;
+	private String artifactDisplayName;
+	private List<HeatParameterDefinition> heatParameters;
+
+	private boolean mandatory;
+	private boolean serviceApi;
+
+	public boolean isServiceApi() {
+		return serviceApi;
+	}
+
+	public void setServiceApi(boolean serviceApi) {
+		this.serviceApi = serviceApi;
+	}
+
+	public String getArtifactLabel() {
+		return artifactLabel;
+	}
+
+	public void setArtifactLabel(String artifactLabel) {
+		this.artifactLabel = artifactLabel;
+	}
+
+	public String getArtifactName() {
+		return artifactName;
+	}
+
+	public void setArtifactName(String artifactName) {
+		this.artifactName = artifactName;
+	}
+
+	public String getArtifactType() {
+		return artifactType;
+	}
+
+	public void setArtifactType(String artifactType) {
+		this.artifactType = artifactType;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getPayload() {
+		return payloadData;
+	}
+
+	public void setPayload(String payload) {
+		this.payloadData = payload;
+	}
+
+	public void setPayloadData(String payloadData) {
+		this.payloadData = payloadData;
+	}
+
+	public String getArtifactGroupType() {
+		return artifactGroupType;
+	}
+
+	public void setArtifactGroupType(String artifactGroupType) {
+		this.artifactGroupType = artifactGroupType;
+	}
+
+	public Integer getTimeout() {
+		return timeout;
+	}
+
+	public void setTimeout(Integer timeout) {
+		this.timeout = timeout;
+	}
+
+	public boolean isMandatory() {
+		return mandatory;
+	}
+
+	public void setMandatory(boolean mandatory) {
+		this.mandatory = mandatory;
+	}
+
+	public String getUrl() {
+		return apiUrl;
+	}
+
+	public void setUrl(String url) {
+		this.apiUrl = url;
+	}
+
+	@Override
+	public String toString() {
+		if (!apiUrl.isEmpty()) {
+			return "ArtifactReqDetails [artifactName=" + artifactName + ", artifactType=" + artifactType
+					+ ", description=" + description + ", payloadData=" + payloadData + ", artifactLabel="
+					+ artifactLabel + ", mandatory=" + mandatory + ", url=" + apiUrl + "]";
+		}
+
+		return "ArtifactReqDetails [artifactName=" + artifactName + ", artifactType=" + artifactType + ", description="
+				+ description + ", payloadData=" + payloadData + ", artifactLabel=" + artifactLabel
+				+ ", artifactUniqueId=" + uniqueId + ", mandatory=" + mandatory + ", serviceApi=" + serviceApi + "]";
+
+	}
+
+	// public String getPayloadData() {
+	// return payloadData;
+	// }
+	//
+	// public void setPayloadData(String payloadData) {
+	// this.payloadData = payloadData;
+	// }
+
+	// public String getUserIdCreator() {
+	// return userIdCreator;
+	// }
+	//
+	// public void setUserIdCreator(String userIdCreator) {
+	// this.userIdCreator = userIdCreator;
+	// }
+	//
+	public String getArtifactDisplayName() {
+
+		return artifactDisplayName;
+	}
+
+	public void setArtifactDisplayName(String artifactDisplayName) {
+		this.artifactDisplayName = artifactDisplayName;
+	}
+
+	public String getUserIdLastUpdater() {
+		return userIdLastUpdater;
+	}
+
+	public void setUserIdLastUpdater(String userIdLastUpdater) {
+		this.userIdLastUpdater = userIdLastUpdater;
+	}
+
+	public String getCreatorFullName() {
+		return creatorFullName;
+	}
+
+	public void setCreatorFullName(String creatorFullName) {
+		this.creatorFullName = creatorFullName;
+	}
+
+	public String getUpdaterFullName() {
+		return updaterFullName;
+	}
+
+	public void setUpdaterFullName(String updaterFullName) {
+		this.updaterFullName = updaterFullName;
+	}
+
+	public String getArtifactChecksum() {
+		return artifactChecksum;
+	}
+
+	public void setArtifactChecksum(String artifactChecksum) {
+		this.artifactChecksum = artifactChecksum;
+	}
+
+	public String getUniqueId() {
+		return uniqueId;
+	}
+
+	public void setUniqueId(String artifactUniqueId) {
+		this.uniqueId = artifactUniqueId;
+	}
+
+	public List<HeatParameterDefinition> getHeatParameters() {
+		return heatParameters;
+	}
+
+	public void setHeatParameters(List<HeatParameterDefinition> heatParameters) {
+		this.heatParameters = heatParameters;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java
new file mode 100644
index 0000000..8820b05
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java
@@ -0,0 +1,122 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class AssetStructure {
+
+	private String uuid;
+	private String invariantUUID;
+	private String name;
+	private String version;
+	private String toscaModelURL;
+	private String category;
+	private String lifecycleState;
+	private String lastUpdaterUserId;
+
+	public AssetStructure() {
+		super();
+	}
+
+	public AssetStructure(String uuid, String invariantUUID, String name, String version, String toscaModelURL,
+			String category, String lifecycleState, String lastUpdaterUserId) {
+		super();
+		this.uuid = uuid;
+		this.invariantUUID = invariantUUID;
+		this.name = name;
+		this.version = version;
+		this.toscaModelURL = toscaModelURL;
+		this.category = category;
+		this.lifecycleState = lifecycleState;
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+
+	@Override
+	public String toString() {
+		return "AssetStructure [uuid=" + uuid + ", invariantUUID=" + invariantUUID + ", name=" + name + ", version="
+				+ version + ", toscaModelURL=" + toscaModelURL + ", category=" + category + ", lifecycleState="
+				+ lifecycleState + ", lastUpdaterUserId=" + lastUpdaterUserId + "]";
+	}
+
+	public String getUuid() {
+		return uuid;
+	}
+
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	public String getInvariantUUID() {
+		return invariantUUID;
+	}
+
+	public void setInvariantUUID(String invariantUUID) {
+		this.invariantUUID = invariantUUID;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	public String getToscaModelURL() {
+		return toscaModelURL;
+	}
+
+	public void setToscaModelURL(String toscaModelURL) {
+		this.toscaModelURL = toscaModelURL;
+	}
+
+	public String getCategory() {
+		return category;
+	}
+
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	public String getLifecycleState() {
+		return lifecycleState;
+	}
+
+	public void setLifecycleState(String lifecycleState) {
+		this.lifecycleState = lifecycleState;
+	}
+
+	public String getLastUpdaterUserId() {
+		return lastUpdaterUserId;
+	}
+
+	public void setLastUpdaterUserId(String lastUpdaterUserId) {
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java
new file mode 100644
index 0000000..549700f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java
@@ -0,0 +1,121 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import org.openecomp.sdc.be.model.ComponentInstance;
+
+public class ComponentInstanceReqDetails {
+
+	String componentUid;
+	String description;
+	String posX;
+	String posY;
+	String name;
+	String uniqueId;
+
+	public ComponentInstanceReqDetails() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ComponentInstanceReqDetails(ComponentInstance componentInstance) {
+		super();
+		this.setUniqueId(componentInstance.getUniqueId());
+		this.description = componentInstance.getDescription();
+		this.posX = componentInstance.getPosX();
+		this.posY = componentInstance.getPosY();
+		// this.name = "myResourceInstance";
+		this.name = componentInstance.getName();
+	}
+
+	public ComponentInstanceReqDetails(String resourceUid, String description, String posX, String posY, String name) {
+		super();
+		this.componentUid = resourceUid;
+		this.description = description;
+		this.posX = posX;
+		this.posY = posY;
+		// this.name = "myResourceInstance";
+		this.name = name;
+	}
+
+	public ComponentInstanceReqDetails(String resourceUid, String description, String posX, String posY) {
+		super();
+		this.componentUid = resourceUid;
+		this.description = description;
+		this.posX = posX;
+		this.posY = posY;
+	}
+
+	public String getComponentUid() {
+		return componentUid;
+	}
+
+	public void setComponentUid(String resourceUid) {
+		this.componentUid = resourceUid;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getPosX() {
+		return posX;
+	}
+
+	public void setPosX(String posX) {
+		this.posX = posX;
+	}
+
+	public String getPosY() {
+		return posY;
+	}
+
+	public void setPosY(String posY) {
+		this.posY = posY;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getUniqueId() {
+		return uniqueId;
+	}
+
+	public void setUniqueId(String uniqueId) {
+		this.uniqueId = uniqueId;
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceInstanceReqDetails [resourceUid=" + componentUid + ", description=" + description + ", posX="
+				+ posX + ", posY=" + posY + ", name=" + name + ", uniqueId=" + uniqueId + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java
new file mode 100644
index 0000000..8546732
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java
@@ -0,0 +1,272 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+
+public abstract class ComponentReqDetails {
+
+	protected String name;
+	protected String description;
+	protected List<String> tags = new ArrayList<>();
+	protected String contactId;
+	protected String icon;
+	protected String uniqueId;
+	protected String creatorUserId;
+	protected String creatorFullName;
+	protected String lastUpdaterUserId;
+	protected String lastUpdaterFullName;
+	protected Long creationDate;
+	protected Long lastUpdateDate;
+	protected LifecycleStateEnum lifecycleState;
+	protected String version;
+	protected String UUID;
+	protected List<CategoryDefinition> categories;
+	protected String projectCode;
+	protected String csarUUID;
+	protected String csarVersion;
+	protected String importedToscaChecksum;
+	protected String invariantUUID;
+
+	public String getCsarVersion() {
+		return csarVersion;
+	}
+
+	public void setCsarVersion(String csarVersion) {
+		this.csarVersion = csarVersion;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+		tags.add(name);
+	}
+
+	public List<String> getTags() {
+		return tags;
+	}
+
+	public void setTags(List<String> tags) {
+		this.tags = tags;
+	}
+
+	// public String getCategory() {
+	// return category;
+	// }
+	//
+	public String getContactId() {
+		return contactId;
+	}
+
+	public void setContactId(String contactId) {
+		this.contactId = contactId;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+
+	public String getUniqueId() {
+		return uniqueId;
+	}
+
+	public void setUniqueId(String uniqueId) {
+		this.uniqueId = uniqueId;
+	}
+
+	public void setCreatorUserId(String creatorUserId) {
+		this.creatorUserId = creatorUserId;
+	}
+
+	public void setCreatorFullName(String creatorFullName) {
+		this.creatorFullName = creatorFullName;
+	}
+
+	public void setLastUpdaterUserId(String lastUpdaterUserId) {
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+
+	public void setCreationDate(Long creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	public void setLastUpdateDate(Long lastUpdateDate) {
+		this.lastUpdateDate = lastUpdateDate;
+	}
+
+	public void setLifecycleState(LifecycleStateEnum lifecycleState) {
+		this.lifecycleState = lifecycleState;
+	}
+
+	public void setUUID(String uUID) {
+		this.UUID = uUID;
+	}
+
+	public String getCreatorUserId() {
+		return creatorUserId;
+	}
+
+	public String getCreatorFullName() {
+		return creatorFullName;
+	}
+
+	public String getLastUpdaterUserId() {
+		return lastUpdaterUserId;
+	}
+
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+
+	public Long getCreationDate() {
+		return creationDate;
+	}
+
+	public Long getLastUpdateDate() {
+		return lastUpdateDate;
+	}
+
+	public LifecycleStateEnum getLifecycleState() {
+		return lifecycleState;
+	}
+
+	public String getUUID() {
+		return UUID;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public List<CategoryDefinition> getCategories() {
+		return categories;
+	}
+
+	public void setCategories(List<CategoryDefinition> categories) {
+		this.categories = categories;
+	}
+
+	public void removeAllCategories() {
+		this.categories = new ArrayList<>();
+	}
+
+	public void addCategoryChain(String category, String subCategory) {
+		if (category != null || subCategory != null) {
+			if (categories == null) {
+				categories = new ArrayList<>();
+			}
+			CategoryDefinition selectedCategory = null;
+			for (CategoryDefinition categoryDef : categories) {
+				if (categoryDef.getName().equals(category)) {
+					selectedCategory = categoryDef;
+				}
+			}
+			if (selectedCategory == null) {
+				selectedCategory = new CategoryDefinition();
+				selectedCategory.setName(category);
+				categories.add(selectedCategory);
+			}
+			if (subCategory != null) {
+				List<SubCategoryDefinition> subcategories = selectedCategory.getSubcategories();
+				if (subcategories == null) {
+					subcategories = new ArrayList<>();
+					selectedCategory.setSubcategories(subcategories);
+				}
+				SubCategoryDefinition selectedSubcategory = null;
+				for (SubCategoryDefinition subcategory : subcategories) {
+					if (subcategory.getName().equals(subCategory)) {
+						selectedSubcategory = subcategory;
+					}
+				}
+				if (selectedSubcategory == null) {
+					selectedSubcategory = new SubCategoryDefinition();
+					selectedSubcategory.setName(subCategory);
+					subcategories.add(selectedSubcategory);
+				}
+			}
+		}
+	}
+
+	public void addCategory(String category) {
+		addCategoryChain(category, null);
+	}
+
+	public String getProjectCode() {
+		return projectCode;
+	}
+
+	public void setProjectCode(String projectCode) {
+		this.projectCode = projectCode;
+	}
+
+	public String getCsarUUID() {
+		return csarUUID;
+	}
+
+	public void setCsarUUID(String csarUUID) {
+		this.csarUUID = csarUUID;
+	}
+
+	public String getImportedToscaChecksum() {
+		return importedToscaChecksum;
+	}
+
+	public void setImportedToscaChecksum(String importedToscaChecksum) {
+		this.importedToscaChecksum = importedToscaChecksum;
+	}
+
+	public String getInvariantUUID() {
+		return invariantUUID;
+	}
+
+	public void setInvariantUUID(String invariantUUID) {
+		this.invariantUUID = invariantUUID;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java
new file mode 100644
index 0000000..f337976
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class CsarArtifacts {
+
+	private String artifactType;
+	private String artifactName;
+
+	public CsarArtifacts() {
+		super();
+	}
+
+	public CsarArtifacts(String artifactName, String artifactType) {
+		super();
+		this.artifactName = artifactName;
+		this.artifactType = artifactType;
+	}
+
+	@Override
+	public String toString() {
+		return "AssetStructure [artifactName=" + artifactName + ", artifactType=" + artifactType + "]";
+	}
+
+	public String getArtifactType() {
+		return artifactType;
+	}
+
+	public void setArtifactType(String artifactType) {
+		this.artifactType = artifactType;
+	}
+
+	public String getArtifactName() {
+		return artifactName;
+	}
+
+	public void setArtifactName(String artifactName) {
+		this.artifactName = artifactName;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java
new file mode 100644
index 0000000..03bedd6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java
@@ -0,0 +1,86 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class GroupHeatMetaDefinition {
+
+	private int group = 0;
+//	private List<String> artifactList = new ArrayList<String>();
+	private List<HeatMetaFirstLevelDefinition> artifactList = new ArrayList<HeatMetaFirstLevelDefinition>();
+	@Override
+	public String toString() {
+		return "GroupHeatMetaDefinition [group=" + group + ", artifactList=" + artifactList + ", artifactMap=" + artifactMap + ", propertyHeatMetaDefinition=" + propertyHeatMetaDefinition + "]";
+	}
+
+	public List<HeatMetaFirstLevelDefinition> getArtifactList() {
+		return artifactList;
+	}
+
+	public void setArtifactList(List<HeatMetaFirstLevelDefinition> artifactList) {
+		this.artifactList = artifactList;
+	}
+
+	private Map<String, String> artifactMap = new HashMap<>();
+	PropertyHeatMetaDefinition propertyHeatMetaDefinition;
+	
+	public Map<String, String> getArtifactMap() {
+		return artifactMap;
+	}
+
+	public void setArtifactMap(Map<String, String> artifactMap) {
+		this.artifactMap = artifactMap;
+	}
+
+
+	public PropertyHeatMetaDefinition getPropertyHeatMetaDefinition() {
+		return propertyHeatMetaDefinition;
+	}
+
+	public void setPropertyHeatMetaDefinition(PropertyHeatMetaDefinition propertyHeatMetaDefinition) {
+		this.propertyHeatMetaDefinition = propertyHeatMetaDefinition;
+	}
+
+	public GroupHeatMetaDefinition() {
+		super();
+	}
+
+	public int getGroup() {
+		return group;
+	}
+
+	public void setGroup(int group) {
+		this.group = group;
+	}
+
+//	public List<String> getArtifactList() {
+//		return artifactList;
+//	}
+//
+//	public void setArtifactList(List<String> artifactList) {
+//		this.artifactList = artifactList;
+//	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java
new file mode 100644
index 0000000..4e76022
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class HeatMetaFirstLevelDefinition {
+	
+	public HeatMetaFirstLevelDefinition(String fileName, String type, String checkSum) {
+		super();
+		this.fileName = fileName;
+		this.type = type;
+		this.checkSum = checkSum;
+		
+	}
+	
+	private String fileName;
+	private String type;
+	private String checkSum;
+	
+	public HeatMetaFirstLevelDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public String getFileName() {
+		return fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+
+	public String getCheckSum() {
+		return checkSum;
+	}
+
+	public void setCheckSum(String checkSum) {
+		this.checkSum = checkSum;
+	}
+
+	@Override
+	public String toString() {
+		return "HeatMetaFirstLevelDefinition [fileName=" + fileName + ", type=" + type + ", checkSum=" + checkSum + "]";
+	}
+	
+	
+	
+	
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java
new file mode 100644
index 0000000..638ece8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java
@@ -0,0 +1,335 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.yaml.snakeyaml.Yaml;
+
+public class ImportReqDetails extends ResourceReqDetails {
+
+	private String payloadName;
+	private String payloadData;
+
+	private Map<String, Object> requirements;
+	private Map<String, Object> capabilities;
+
+	private List<String> derivedList;
+	private String derivedFromField;
+
+	public ImportReqDetails(String resourceName, String description, List<String> tags, List<String> derivedFrom,
+			String vendorName, String vendorRelease, String contactId, String icon) {
+		super(resourceName, description, tags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
+	}
+
+	public String getPayloadName() {
+		return payloadName;
+	}
+
+	public void setPayloadName(String payloadName) {
+		this.payloadName = payloadName;
+	}
+
+	public String getPayloadData() {
+		return payloadData;
+	}
+
+	public void setPayloadData(String payloadData) {
+		this.payloadData = payloadData;
+	}
+
+	@Override
+	public String toString() {
+		return "ImportReqDetails [payloadName=" + payloadName + ", payloadData=" + payloadData + "]";
+	}
+
+	public void setReqirementsAndCapabilities(String path, String fileName, User user, String derivedFromSource)
+			throws Exception {
+		setRequirements(path, fileName, user, derivedFromSource);
+		setCapabilities(path, fileName, user, derivedFromSource);
+	}
+
+	public List<String> getDerivedList() {
+		return derivedList;
+	}
+
+	public void setDerivedList(List<String> derivedList) {
+		this.derivedList = derivedList;
+	}
+
+	public String getDerivedFromField() {
+		return derivedFromField;
+	}
+
+	public void setDerivedFromField(String derivedFromField) {
+		this.derivedFromField = derivedFromField;
+	}
+
+	public Map<String, Object> getRequirements() {
+		return requirements;
+	}
+
+	public void setRequirements(String path, String fileName, User user, String derivedFromSource) throws Exception {
+		Map<String, Object> requirementsFromFile = getRequirementsMapFromFile(path + File.separator + fileName,
+				toscaResourceName, "requirements");
+		Map<String, Object> requirements = organizeRequirementsMap(requirementsFromFile);
+		getDerivedReqCap(user, requirements, "requirements", derivedFromSource);
+		this.requirements = requirements;
+	}
+
+	private void getDerivedReqCap(User user, Map<String, Object> reqCapMap, String field, String derivedFromResource)
+			throws IOException, JSONException {
+
+		if (derivedFromResource == null) {
+			derivedFromResource = "Root";
+		}
+
+		RestResponse rest = getResourceSource(user, derivedFromResource);
+		Map<String, Object> parsedFieldFromResponseAsMap = ResponseParser.getJsonValueAsMap(rest, field);
+		Iterator<String> iterator = parsedFieldFromResponseAsMap.keySet().iterator();
+		Map<String, Object> convertListToMap = null;
+		while (iterator.hasNext()) {
+			String type = iterator.next();
+			List<Object> lst = (List<Object>) parsedFieldFromResponseAsMap.get(type);
+			convertListToMap = convertListToMap(lst);
+
+			if (field.equals("capabilities")) {
+				convertListToMap.replace("capabilitySources", derivedList);
+				lst = new ArrayList<Object>(Arrays.asList(convertListToMap));
+			}
+
+			Object existingValue = reqCapMap.get(type);
+			if (existingValue != null) {
+				Map<String, Object> convertedExistingValue = convertListToMap((List<Object>) existingValue);
+				if (convertedExistingValue.get("name").toString().toLowerCase()
+						.equals(convertListToMap.get("name").toString().toLowerCase())) {
+					lst = new ArrayList<Object>(Arrays.asList(convertedExistingValue));
+				} else {
+					lst.add(convertedExistingValue);
+				}
+			}
+
+			reqCapMap.put(type, lst);
+		}
+	}
+
+	private RestResponse getResourceSource(User user, String source) throws IOException, JSONException {
+		org.codehaus.jettison.json.JSONObject getResourceJSONObject = null;
+		RestResponse rest = ResourceRestUtils.getResourceByNameAndVersion(user.getUserId(), source, "1.0");
+		if (rest.getErrorCode().intValue() == 200) {
+			JSONArray jArray = new JSONArray(rest.getResponse());
+			for (int i = 0; i < jArray.length(); i++) {
+				getResourceJSONObject = jArray.getJSONObject(i);
+				String resourceType = getResourceJSONObject.get("resourceType").toString();
+				if (!resourceType.equals("VF")) {
+					rest.setResponse(getResourceJSONObject.toString());
+				}
+			}
+		}
+		return rest;
+	}
+
+	public Map<String, Object> getCapabilities() {
+		return capabilities;
+	}
+
+	public void setCapabilities(String path, String fileName, User user, String derivedFromSource) throws Exception {
+		Map<String, Object> capabilitiesFromFile = getCapabilitiesMapFromFile(path + File.separator + fileName,
+				toscaResourceName, "capabilities");
+		Map<String, Object> capabilities = organizeCapabilitiesMap(capabilitiesFromFile);
+		getDerivedReqCap(user, capabilities, "capabilities", derivedFromSource);
+		this.capabilities = capabilities;
+	}
+
+	private Map<String, Object> organizeCapabilitiesMap(Map<String, Object> capabilitiesFromFile) {
+		Iterator<String> iterator = capabilitiesFromFile.keySet().iterator();
+		Map<String, Object> capMap = new HashMap<String, Object>();
+		while (iterator.hasNext()) {
+			List<Object> valueList = new ArrayList<Object>();
+			String next = iterator.next();
+			Map<String, Object> valuesMap = (Map<String, Object>) capabilitiesFromFile.get(next);
+			String key = valuesMap.remove("type").toString();
+			valuesMap.put("name", next);
+			valuesMap.put("capabilitySources", derivedList);
+			valuesMap.put("type", key);
+
+			if (!valuesMap.containsKey("occurrences")) {
+				valuesMap.put("minOccurrences", "1");
+				valuesMap.put("maxOccurrences", "UNBOUNDED");
+			}
+
+			Object tempValue = capMap.get(key);
+			if (tempValue == null) {
+				valueList.add(valuesMap);
+			} else {
+				Map<String, Object> convertValue = convertListToMap((List<Object>) tempValue);
+				valueList = new ArrayList<Object>(Arrays.asList(convertValue, valuesMap));
+			}
+			capMap.put(key, valueList);
+		}
+		return capMap;
+	}
+
+	private Map<String, Object> getCapabilitiesMapFromFile(String fileName, String toscaResourceName,
+			String fieldToTest) throws Exception {
+		Map<String, Object> resourceToscaMap = getToscaResourceFromFile(fileName, toscaResourceName);
+		Object capMap = resourceToscaMap.get(fieldToTest);
+		if (capMap == null) {
+			return new HashMap<String, Object>();
+		}
+		return (Map<String, Object>) capMap;
+	}
+
+	private Map<String, Object> organizeRequirementsMap(Map<String, Object> requirementsFromFile) {
+		Map<String, Object> reqMap = new HashMap<String, Object>();
+		List<Object> valueList = new ArrayList<Object>();
+		Iterator<String> iterator = requirementsFromFile.keySet().iterator();
+		while (iterator.hasNext()) {
+			String key = iterator.next();
+			Map<String, Object> valuesMap = (Map<String, Object>) requirementsFromFile.get(key);
+			valuesMap.put("name", key);
+			String capability = valuesMap.get("capability").toString();
+
+			List<Object> occurencesList = (List<Object>) valuesMap.remove("occurrences");
+			if (occurencesList != null) {
+				valuesMap.put("minOccurrences", occurencesList.get(0).toString());
+				valuesMap.put("maxOccurrences", occurencesList.get(1).toString());
+			}
+
+			valueList.add(valuesMap);
+			reqMap.put(capability, valueList);
+		}
+
+		return reqMap;
+	}
+
+	private Map<String, Object> getRequirementsMapFromFile(String fileName, String toscaResourceName,
+			String fieldToTest) throws Exception {
+		Map<String, Object> resourceToscaMap = getToscaResourceFromFile(fileName, toscaResourceName);
+		List<Object> reqListFromFile = (List<Object>) resourceToscaMap.get(fieldToTest);
+		if (reqListFromFile == null) {
+			return new HashMap<String, Object>();
+		}
+		Map<String, Object> testedMapFromFile = convertListToMap(reqListFromFile);
+		return testedMapFromFile;
+	}
+
+	private Map<String, Object> getToscaResourceFromFile(String fullFileName, String toscaResourceName)
+			throws Exception {
+		Map<String, Object> nodesTypesMap = getNodesTypesMapFromFile(fullFileName);
+		Map<String, Object> resourceToscaMap = (Map<String, Object>) nodesTypesMap.get(toscaResourceName);
+
+		derivedFromField = resourceToscaMap.get("derived_from").toString();
+
+		return resourceToscaMap;
+	}
+
+	private Map<String, Object> getNodesTypesMapFromFile(String fullFileName) throws FileNotFoundException {
+		Yaml yaml = new Yaml();
+		File file = new File(fullFileName);
+		InputStream inputStream = new FileInputStream(file);
+		Map<?, ?> mapFromFile = (Map<?, ?>) yaml.load(inputStream);
+		Map<String, Object> nodesTypesMap = (Map<String, Object>) mapFromFile.get("node_types");
+		return nodesTypesMap;
+	}
+
+	private Map<String, Object> convertListToMap(List<Object> testedListFromFile) {
+		Map<String, Object> testedMapFromFile = new HashMap<String, Object>();
+		for (int i = 0; i < testedListFromFile.size(); i++) {
+			Object req = testedListFromFile.get(i);
+			ObjectMapper m = new ObjectMapper();
+			Map<? extends String, ? extends String> mappedObject = m.convertValue(req, Map.class);
+			testedMapFromFile.putAll(mappedObject);
+		}
+		return testedMapFromFile;
+	}
+
+	public void compareRequirementsOrCapabilities(Map<String, Object> exepectedReq, Map<String, Object> actualReq) {
+		Iterator<String> iterator = exepectedReq.keySet().iterator();
+		while (iterator.hasNext()) {
+			String key = iterator.next();
+			List<Object> expectedValues = (List<Object>) exepectedReq.get(key);
+			List<Object> actualValues = (List<Object>) actualReq.get(key);
+			assertNotNull(actualValues);
+
+			List<Map<String, Object>> expectedMapsList = convertListToMapList(expectedValues);
+			List<Map<String, Object>> actualMapsList = convertListToMapList(actualValues);
+			assertEquals(expectedMapsList.size(), actualMapsList.size());
+
+			for (int i = 0; i < expectedMapsList.size(); i++) {
+				Map<String, Object> expectedMap = expectedMapsList.get(i);
+				Map<String, Object> actualdMap = actualMapsList.get(i);
+				if (expectedMap.get("name").equals(actualdMap.get("name"))) {
+					Iterator<String> iterator2 = expectedMap.keySet().iterator();
+					while (iterator2.hasNext()) {
+						String innerKey = iterator2.next();
+						assertTrue(
+								"check " + innerKey + " in " + key + ":\nexpected: "
+										+ expectedMap.get(innerKey).toString() + "\nactual: "
+										+ actualdMap.get(innerKey).toString(),
+								expectedMap.get(innerKey).equals(actualdMap.get(innerKey)));
+
+					}
+
+				}
+			}
+		}
+	}
+
+	private List<Map<String, Object>> convertListToMapList(List<Object> testedListFromFile) {
+		List<Map<String, Object>> listOfMaps = new ArrayList<Map<String, Object>>();
+		for (int i = 0; i < testedListFromFile.size(); i++) {
+			Object req = testedListFromFile.get(i);
+			ObjectMapper m = new ObjectMapper();
+			Map<? extends String, ? extends String> mappedObject = m.convertValue(req, Map.class);
+			mappedObject.remove("uniqueId");
+			Map<String, Object> testedMapFromFile = new HashMap<String, Object>();
+			testedMapFromFile.putAll(mappedObject);
+			listOfMaps.add(testedMapFromFile);
+		}
+		return listOfMaps;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java
new file mode 100644
index 0000000..f2484e2
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+
+public class ProductReqDetails extends ComponentReqDetails {
+
+	private String fullName;
+	private List<String> contacts;
+	private String isActive;
+
+	public ProductReqDetails(String name, List<CategoryDefinition> category) {
+		this.categories = category;
+		this.name = name;
+	}
+
+	public ProductReqDetails(String name) {
+		this.name = name;
+	}
+
+	public void addCategory(CategoryDefinition category) {
+		if (categories == null) {
+			categories = new ArrayList<>();
+		}
+		categories.add(category);
+	}
+
+	public void addContact(String contactUserId) {
+		if (contacts == null) {
+			contacts = new ArrayList<>();
+		}
+		contacts.add(contactUserId);
+	}
+
+	public List<String> getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(List<String> contacts) {
+		this.contacts = contacts;
+	}
+
+	public List<CategoryDefinition> getCategories() {
+		return categories;
+	}
+
+	public void setCategories(List<CategoryDefinition> categories) {
+		this.categories = categories;
+	}
+
+	public String getFullName() {
+		return fullName;
+	}
+
+	public void setFullName(String fullName) {
+		this.fullName = fullName;
+	}
+
+	public String getActive() {
+		return isActive;
+	}
+
+	public void setActive(String isActive) {
+		this.isActive = isActive;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java
new file mode 100644
index 0000000..5c9083d
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class PropertyHeatMetaDefinition {
+
+	String name;
+	boolean value;
+
+	public PropertyHeatMetaDefinition() {
+		super();
+	}
+
+	
+
+	public String getName() {
+		return name;
+	}
+
+
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+
+
+	public boolean getValue() {
+		return value;
+	}
+
+
+
+	public void setValue(boolean value) {
+		this.value = value;
+	}
+
+
+
+	@Override
+	public String toString() {
+		return "PropertyHeatMetaDefinition [name=" + name + ", value=" + value + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java
new file mode 100644
index 0000000..208e4aa
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java
@@ -0,0 +1,145 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
+
+public class PropertyReqDetails {
+	String name;
+	String type;
+	Boolean required = false;
+	String defaultValue;
+	String description;
+	String propertyRangeMin;
+	String propertyRangeMax;
+	Boolean isPassword = false;
+	SchemaDefinition schema;
+
+	public PropertyReqDetails() {
+		super();
+	}
+
+	public PropertyReqDetails(String propertyName, String propertyType, Boolean propertyRequired,
+			String propertyDefaultValue, String propertyDescription, String propertyRangeMin, String propertyRangeMax,
+			Boolean propertyPassword) {
+		super();
+		this.name = propertyName;
+		this.type = propertyType;
+		this.required = propertyRequired;
+		this.defaultValue = propertyDefaultValue;
+		this.description = propertyDescription;
+		this.propertyRangeMin = propertyRangeMin;
+		this.propertyRangeMax = propertyRangeMax;
+		this.isPassword = propertyPassword;
+	}
+
+	public PropertyReqDetails(String propertyName, String propertyType, String propertyDefaultValue,
+			String propertyDescription, SchemaDefinition schema) {
+		super();
+		this.name = propertyName;
+		this.type = propertyType;
+		this.defaultValue = propertyDefaultValue;
+		this.description = propertyDescription;
+		this.schema = schema;
+	}
+
+	public SchemaDefinition getSchema() {
+		return schema;
+	}
+
+	public void setSchema(SchemaDefinition schema) {
+		this.schema = schema;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String propertyName) {
+		this.name = propertyName;
+	}
+
+	public String getPropertyType() {
+		return type;
+	}
+
+	public void setPropertyType(String propertyType) {
+		this.type = propertyType;
+	}
+
+	public Boolean getPropertyRequired() {
+		return required;
+	}
+
+	public void setPropertyRequired(Boolean propertyRequired) {
+		this.required = propertyRequired;
+	}
+
+	public String getPropertyDefaultValue() {
+		return defaultValue;
+	}
+
+	public void setPropertyDefaultValue(String propertyDefaultValue) {
+		this.defaultValue = propertyDefaultValue;
+	}
+
+	public String getPropertyDescription() {
+		return description;
+	}
+
+	public void setPropertyDescription(String propertyDescription) {
+		this.description = propertyDescription;
+	}
+
+	public String getPropertyRangeMin() {
+		return propertyRangeMin;
+	}
+
+	public void setPropertyRangeMin(String propertyRangeMin) {
+		this.propertyRangeMin = propertyRangeMin;
+	}
+
+	public String getPropertyRangeMax() {
+		return propertyRangeMax;
+	}
+
+	public void setPropertyRangeMax(String propertyRangeMax) {
+		this.propertyRangeMax = propertyRangeMax;
+	}
+
+	public Boolean getPropertyPassword() {
+		return isPassword;
+	}
+
+	public void setPropertyPassword(Boolean propertyPassword) {
+		this.isPassword = propertyPassword;
+	}
+
+	public String propertyToJsonString() {
+		String jsonString;
+		jsonString = "{\"" + this.getName() + "\":{" + "\"type\":\"" + this.getPropertyType() + "\"," + "\"required\":"
+				+ this.getPropertyRequired() + "," + "\"defaultValue\":\"" + this.getPropertyDefaultValue() + "\","
+				+ "\"description\":\"" + this.getPropertyDescription() + "\"," + "\"constraints\":[{\"inRange\":[\""
+				+ this.getPropertyRangeMin() + "\",\"" + this.getPropertyRangeMax() + "\"]}]," + "\"isPassword\":"
+				+ this.getPropertyPassword() + "}}";
+		return jsonString;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java
new file mode 100644
index 0000000..62f5e0c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class ResourceAssetStructure extends AssetStructure {
+
+	private String subCategory;
+	private String resourceType;
+	protected String lastUpdaterFullName;
+	protected String toscaResourceName;
+
+	public ResourceAssetStructure() {
+		super();
+	}
+
+	public ResourceAssetStructure(String uuid, String invariantUUID, String name, String version, String toscaModelURL,
+			String category, String lifecycleState, String lastUpdaterUserId) {
+		super(uuid, invariantUUID, name, version, toscaModelURL, category, lifecycleState, lastUpdaterUserId);
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceAssetStructure [subCategory=" + subCategory + ", resourceType=" + resourceType + "]";
+	}
+	
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+
+	public String getToscaResourceName() {
+		return toscaResourceName;
+	}
+
+	public void setToscaResourceName(String toscaResourceName) {
+		this.toscaResourceName = toscaResourceName;
+	}
+
+	public String getSubCategory() {
+		return subCategory;
+	}
+
+	public void setSubCategory(String subCategory) {
+		this.subCategory = subCategory;
+	}
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java
new file mode 100644
index 0000000..b521b4b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+public class ResourceDetailedAssetStructure extends ResourceAssetStructure {
+
+	private List<ResourceInstanceAssetStructure> resources;
+	private List<ArtifactAssetStructure> artifacts;
+
+	public ResourceDetailedAssetStructure() {
+		super();
+	}
+
+	public ResourceDetailedAssetStructure(String lastUpdaterFullName, String toscaResourceName,
+			List<ResourceInstanceAssetStructure> resources, List<ArtifactAssetStructure> artifacts) {
+		super();
+		this.lastUpdaterFullName = lastUpdaterFullName;
+		this.toscaResourceName = toscaResourceName;
+		this.resources = resources;
+		this.artifacts = artifacts;
+	}
+
+	public List<ResourceInstanceAssetStructure> getResources() {
+		return resources;
+	}
+
+	public void setResources(List<ResourceInstanceAssetStructure> resources) {
+		this.resources = resources;
+	}
+
+	public List<ArtifactAssetStructure> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(List<ArtifactAssetStructure> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceDetailedAssetStructure [lastUpdaterFullName=" + lastUpdaterFullName + ", toscaResourceName="
+				+ toscaResourceName + ", resources=" + resources + ", artifacts=" + artifacts + ", toString()="
+				+ super.toString() + ", getSubCategory()=" + getSubCategory() + ", getResourceType()="
+				+ getResourceType() + ", getUuid()=" + getUuid() + ", getInvariantUUID()=" + getInvariantUUID()
+				+ ", getName()=" + getName() + ", getVersion()=" + getVersion() + ", getToscaModelURL()="
+				+ getToscaModelURL() + ", getCategory()=" + getCategory() + ", getLifecycleState()="
+				+ getLifecycleState() + ", getLastUpdaterUserId()=" + getLastUpdaterUserId() + ", getClass()="
+				+ getClass() + ", hashCode()=" + hashCode() + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java
new file mode 100644
index 0000000..a5132e8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+
+public class ResourceExternalReqDetails extends ComponentReqDetails {
+	String vendorName;
+	String vendorRelease;
+	String category;
+	String subcategory;
+	
+	private String resourceType = ResourceTypeEnum.VFC.toString(); // Default
+																	// value
+	public ResourceExternalReqDetails() {
+		super();
+	}
+	
+	
+	public ResourceExternalReqDetails(String resourceName, String description, List<String> tags,
+			String vendorName, String vendorRelease, String contactId, String icon,
+			String resourceType, String resourceCategory, String resourceSubcategory) {
+		super();
+		this.resourceType = resourceType;
+		this.name = resourceName;
+		this.description = description;
+		this.tags = tags;
+		this.vendorName = vendorName;
+		this.vendorRelease = vendorRelease;
+		this.contactId = contactId;
+		this.icon = icon;
+		this.category = resourceCategory;
+		this.subcategory = resourceSubcategory;
+	}
+
+	public String getVendorName() {
+		return vendorName;
+	}
+
+	public void setVendorName(String vendorName) {
+		this.vendorName = vendorName;
+	}
+
+	public String getVendorRelease() {
+		return vendorRelease;
+	}
+
+	public void setVendorRelease(String vendorRelease) {
+		this.vendorRelease = vendorRelease;
+	}
+	
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+	
+	public String getCategory() {
+		return category;
+	}
+
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	public String getSubcategory() {
+		return subcategory;
+	}
+
+	public void setSubcategory(String subcategory) {
+		this.subcategory = subcategory;
+	}
+	
+
+	@Override
+	public String toString() {
+		return "ResourceReqDetails [name=" + name + ", vendorName=" + vendorName
+				+ ", vendorRelease=" + vendorRelease + ", version=" + version
+				+ ", resourceType=" + resourceType + ", category=" + category + ", subcategory=" + subcategory +"]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java
new file mode 100644
index 0000000..6a69120
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java
@@ -0,0 +1,116 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+public class ResourceInstanceAssetStructure {
+
+	String resourceInstanceName;
+	String resourceName;
+	String resourceInvariantUUID;
+	String resourceVersion;
+	String resoucreType;
+	String resourceUUID;
+	List<ArtifactAssetStructure> artifacts;
+
+	public ResourceInstanceAssetStructure() {
+		super();
+	}
+
+	public ResourceInstanceAssetStructure(String resourceInstanceName, String resourceName,
+			String resourceInvariantUUID, String resourceVersion, String resoucreType, String resourceUUID,
+			List<ArtifactAssetStructure> artifacts) {
+		super();
+		this.resourceInstanceName = resourceInstanceName;
+		this.resourceName = resourceName;
+		this.resourceInvariantUUID = resourceInvariantUUID;
+		this.resourceVersion = resourceVersion;
+		this.resoucreType = resoucreType;
+		this.resourceUUID = resourceUUID;
+		this.artifacts = artifacts;
+	}
+
+	public String getResourceInstanceName() {
+		return resourceInstanceName;
+	}
+
+	public void setResourceInstanceName(String resourceInstanceName) {
+		this.resourceInstanceName = resourceInstanceName;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+
+	public void setResourceName(String resourceName) {
+		this.resourceName = resourceName;
+	}
+
+	public String getResourceInvariantUUID() {
+		return resourceInvariantUUID;
+	}
+
+	public void setResourceInvariantUUID(String resourceInvariantUUID) {
+		this.resourceInvariantUUID = resourceInvariantUUID;
+	}
+
+	public String getResourceVersion() {
+		return resourceVersion;
+	}
+
+	public void setResourceVersion(String resourceVersion) {
+		this.resourceVersion = resourceVersion;
+	}
+
+	public String getResoucreType() {
+		return resoucreType;
+	}
+
+	public void setResoucreType(String resoucreType) {
+		this.resoucreType = resoucreType;
+	}
+
+	public String getResourceUUID() {
+		return resourceUUID;
+	}
+
+	public void setResourceUUID(String resourceUUID) {
+		this.resourceUUID = resourceUUID;
+	}
+
+	public List<ArtifactAssetStructure> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(List<ArtifactAssetStructure> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceInstanceAssetStructure [resourceInstanceName=" + resourceInstanceName + ", resourceName="
+				+ resourceName + ", resourceInvariantUUID=" + resourceInvariantUUID + ", resourceVersion="
+				+ resourceVersion + ", resoucreType=" + resoucreType + ", resourceUUID=" + resourceUUID + ", artifacts="
+				+ artifacts + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java
new file mode 100644
index 0000000..8456e5b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java
@@ -0,0 +1,220 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+
+public class ResourceReqDetails extends ComponentReqDetails {
+	List<String> derivedFrom;
+	String vendorName;
+	String vendorRelease;
+
+	// Unsettable/unupdatable fields
+
+	Boolean isAbstract;
+	Boolean isHighestVersion;
+	String cost;
+	String licenseType;
+	String toscaResourceName;
+
+	private String resourceType = ResourceTypeEnum.VFC.toString(); // Default
+																	// value
+
+	public ResourceReqDetails() {
+		super();
+	}
+
+	public ResourceReqDetails(Resource resource) {
+		super();
+		this.resourceType = resource.getResourceType().toString();
+		this.name = resource.getName();
+		this.description = resource.getDescription();
+		this.tags = resource.getTags();
+		// this.category = resource.getCategories();
+		this.derivedFrom = resource.getDerivedFrom();
+		this.vendorName = resource.getVendorName();
+		this.vendorRelease = resource.getVendorRelease();
+		this.contactId = resource.getContactId();
+		this.icon = resource.getIcon();
+		this.toscaResourceName = resource.getToscaResourceName();
+		this.uniqueId = resource.getUniqueId();
+		this.creatorUserId = resource.getCreatorUserId();
+		this.creatorFullName = resource.getCreatorFullName();
+		this.lastUpdaterUserId = resource.getLastUpdaterUserId();
+		this.lastUpdaterFullName = resource.getLastUpdaterFullName();
+		this.lifecycleState = resource.getLifecycleState();
+		this.version = resource.getVersion();
+		this.UUID = resource.getUUID();
+		this.categories = resource.getCategories();
+		this.importedToscaChecksum = resource.getImportedToscaChecksum();
+
+	}
+
+	public ResourceReqDetails(String resourceName, String description, List<String> tags, String category,
+			List<String> derivedFrom, String vendorName, String vendorRelease, String contactId, String icon) {
+		this(resourceName, description, tags, category, derivedFrom, vendorName, vendorRelease, contactId, icon,
+				ResourceTypeEnum.VFC.toString());
+	}
+
+	// new
+	public ResourceReqDetails(String resourceName, String description, List<String> tags, String category,
+			List<String> derivedFrom, String vendorName, String vendorRelease, String contactId, String icon,
+			String resourceType) {
+		super();
+		this.resourceType = resourceType;
+		this.name = resourceName;
+		this.description = description;
+		this.tags = tags;
+		// this.category = category;
+		this.derivedFrom = derivedFrom;
+		this.vendorName = vendorName;
+		this.vendorRelease = vendorRelease;
+		this.contactId = contactId;
+		this.icon = icon;
+		if (category != null) {
+			String[] arr = category.split("/");
+			if (arr.length == 2) {
+				addCategoryChain(arr[0], arr[1]);
+			}
+		}
+		this.toscaResourceName = resourceName;
+	}
+
+	public ResourceReqDetails(ResourceReqDetails originalResource, String version) {
+		super();
+		this.name = originalResource.getName();
+		this.description = originalResource.getDescription();
+		this.tags = originalResource.getTags();
+		// this.category = originalResource.getCategory();
+		this.derivedFrom = originalResource.getDerivedFrom();
+		this.vendorName = originalResource.getVendorName();
+		this.vendorRelease = originalResource.getVendorRelease();
+		this.contactId = originalResource.getContactId();
+		this.icon = originalResource.getIcon();
+		this.version = version;
+		this.uniqueId = originalResource.getUniqueId();
+		this.categories = originalResource.getCategories();
+		this.toscaResourceName = originalResource.getToscaResourceName();
+		this.resourceType = originalResource.getResourceType();
+	}
+
+	public ResourceReqDetails(String resourceName, List<String> derivedFrom, String vendorName, String vendorRelease,
+			String resourceVersion, Boolean isAbstract, Boolean isHighestVersion, String cost, String licenseType,
+			String resourceType) {
+		super();
+		this.name = resourceName;
+		this.derivedFrom = derivedFrom;
+		this.vendorName = vendorName;
+		this.vendorRelease = vendorRelease;
+		this.version = resourceVersion;
+		this.isAbstract = isAbstract;
+		this.isHighestVersion = isHighestVersion;
+		this.cost = cost;
+		this.licenseType = licenseType;
+		this.resourceType = resourceType;
+		this.toscaResourceName = resourceName;
+	}
+
+	public String getToscaResourceName() {
+		return toscaResourceName;
+	}
+
+	public void setToscaResourceName(String toscaResourceName) {
+		this.toscaResourceName = toscaResourceName;
+	}
+
+	public List<String> getDerivedFrom() {
+		return derivedFrom;
+	}
+
+	public void setDerivedFrom(List<String> derivedFrom) {
+		this.derivedFrom = derivedFrom;
+	}
+
+	public String getVendorName() {
+		return vendorName;
+	}
+
+	public void setVendorName(String vendorName) {
+		this.vendorName = vendorName;
+	}
+
+	public String getVendorRelease() {
+		return vendorRelease;
+	}
+
+	public void setVendorRelease(String vendorRelease) {
+		this.vendorRelease = vendorRelease;
+	}
+
+	public String getCost() {
+		return cost;
+	}
+
+	public void setCost(String cost) {
+		this.cost = cost;
+	}
+
+	public String getLicenseType() {
+		return licenseType;
+	}
+
+	public void setLicenseType(String licenseType) {
+		this.licenseType = licenseType;
+	}
+
+	// Unupdatable fields - to check that they are not updated
+	public void setIsAbstract(Boolean isAbstract) {
+		this.isAbstract = isAbstract;
+	}
+
+	public void setIsHighestVersion(Boolean isHighestVersion) {
+		this.isHighestVersion = isHighestVersion;
+	}
+
+	public Boolean getIsAbstract() {
+		return isAbstract;
+	}
+
+	public Boolean getIsHighestVersion() {
+		return isHighestVersion;
+	}
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceReqDetails [name=" + name + ", derivedFrom=" + derivedFrom + ", vendorName=" + vendorName
+				+ ", vendorRelease=" + vendorRelease + ", version=" + version + ", isAbstract=" + isAbstract
+				+ ", isHighestVersion=" + isHighestVersion + ", cost=" + cost + ", licenseType=" + licenseType
+				+ ", resourceType=" + resourceType + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java
new file mode 100644
index 0000000..8779c49
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java
@@ -0,0 +1,369 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+
+public class ResourceRespJavaObject {
+	String uniqueId;
+	String name;
+	String version;
+	String creatorUserId;
+	String creatorFullName;
+	String lastUpdaterUserId;
+	String lastUpdaterFullName;
+	String description;
+	String icon;
+	List<String> tags;
+	String isHighestVersion;
+	String creationDate;
+	String lastUpdateDate;
+	// String category;
+	String lifecycleState;
+	List<String> derivedFrom;
+	String vendorName;
+	String vendorRelease;
+	String contactId;
+	String abstractt;
+	String highestVersion;
+	List<String> artifacts;
+	List<String> interfaces;
+	String uuid;
+	String cost;
+	String licenseType;
+	String resourceType;
+	List<CategoryDefinition> categories;
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+
+	public ResourceRespJavaObject(String uniqueId, String resourceName, String resourceVersion, String creatorUserId,
+			String creatorFullName, String lastUpdaterUserId, String lastUpdaterFullName, String description,
+			String icon, List<String> tags, String isHighestVersion, String creationDate, String lastUpdateDate,
+			String category, String lifecycleState, List<String> derivedFrom, String vendorName, String vendorRelease,
+			String contactId, String abstractt, String highestVersion, List<String> artifacts, List<String> interfaces,
+			String uuid, String cost, String licenseType, String resourceType) {
+		super();
+		this.uniqueId = uniqueId;
+		this.name = resourceName;
+		this.version = resourceVersion;
+		this.creatorUserId = creatorUserId;
+		this.creatorFullName = creatorFullName;
+		this.lastUpdaterUserId = lastUpdaterUserId;
+		this.lastUpdaterFullName = lastUpdaterFullName;
+		this.description = description;
+		this.icon = icon;
+		this.tags = tags;
+		this.isHighestVersion = isHighestVersion;
+		this.creationDate = creationDate;
+		this.lastUpdateDate = lastUpdateDate;
+		// this.category = category;
+		this.lifecycleState = lifecycleState;
+		this.derivedFrom = derivedFrom;
+		this.vendorName = vendorName;
+		this.vendorRelease = vendorRelease;
+		this.contactId = contactId;
+		this.abstractt = abstractt;
+		this.highestVersion = highestVersion;
+		this.artifacts = artifacts;
+		this.interfaces = interfaces;
+		this.uuid = uuid;
+		this.cost = cost;
+		this.licenseType = licenseType;
+		this.resourceType = resourceType;
+	}
+
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	public String getCost() {
+		return cost;
+	}
+
+	public void setCost(String cost) {
+		this.cost = cost;
+	}
+
+	public String getLicenseType() {
+		return licenseType;
+	}
+
+	public void setLicenseType(String licenseType) {
+		this.licenseType = licenseType;
+	}
+
+	public String getUuid() {
+		return uuid;
+	}
+
+	public String setUuid() {
+		return uuid;
+	}
+
+	public List<String> getInterfaces() {
+		return interfaces;
+	}
+
+	public void setInterfaces(List<String> interfaces) {
+		this.interfaces = interfaces;
+	}
+
+	public List<String> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(List<String> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	public ResourceRespJavaObject() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	// public ResourceRespJavaObject(String uniqueId, String resourceName,
+	// String resourceVersion, String creatorUserId,
+	// String creatorFullName, String lastUpdaterUserId,
+	// String lastUpdaterFullName, String description, String icon,
+	// List<String> tags, String isHighestVersion, String creationDate,
+	// String lastUpdateDate, String category, String lifecycleState,
+	// List<String> derivedFrom, String vendorName, String vendorRelease,
+	// String contactId, String abstractt, String highestVersion) {
+	// super();
+	// this.uniqueId = uniqueId;
+	// this.resourceName = resourceName;
+	// this.resourceVersion = resourceVersion;
+	// this.creatorUserId = creatorUserId;
+	// this.creatorFullName = creatorFullName;
+	// this.lastUpdaterUserId = lastUpdaterUserId;
+	// this.lastUpdaterFullName = lastUpdaterFullName;
+	// this.description = description;
+	// this.icon = icon;
+	// this.tags = tags;
+	// this.isHighestVersion = isHighestVersion;
+	// this.creationDate = creationDate;
+	// this.lastUpdateDate = lastUpdateDate;
+	// this.category = category;
+	// this.lifecycleState = lifecycleState;
+	// this.derivedFrom = derivedFrom;
+	// this.vendorName = vendorName;
+	// this.vendorRelease = vendorRelease;
+	// this.contactId = contactId;
+	// this.abstractt = abstractt;
+	// this.highestVersion = highestVersion;
+	// }
+	public String getUniqueId() {
+		return uniqueId;
+	}
+
+	public void setUniqueId(String uniqueId) {
+		this.uniqueId = uniqueId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String resourceName) {
+		this.name = resourceName;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String resourceVersion) {
+		this.version = resourceVersion;
+	}
+
+	public String getCreatorUserId() {
+		return creatorUserId;
+	}
+
+	public void setCreatorUserId(String creatorUserId) {
+		this.creatorUserId = creatorUserId;
+	}
+
+	public String getCreatorFullName() {
+		return creatorFullName;
+	}
+
+	public void setCreatorFullName(String creatorFullName) {
+		this.creatorFullName = creatorFullName;
+	}
+
+	public String getLastUpdaterUserId() {
+		return lastUpdaterUserId;
+	}
+
+	public void setLastUpdaterUserId(String lastUpdaterUserId) {
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+
+	public List<String> getTags() {
+		return tags;
+	}
+
+	public void setTags(List<String> tags) {
+		this.tags = tags;
+	}
+
+	public String getIsHighestVersion() {
+		return isHighestVersion;
+	}
+
+	public void setIsHighestVersion(String isHighestVersion) {
+		this.isHighestVersion = isHighestVersion;
+	}
+
+	public String getCreationDate() {
+		return creationDate;
+	}
+
+	public void setCreationDate(String creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	public String getLastUpdateDate() {
+		return lastUpdateDate;
+	}
+
+	public void setLastUpdateDate(String lastUpdateDate) {
+		this.lastUpdateDate = lastUpdateDate;
+	}
+
+	// public String getCategory() {
+	// return category;
+	// }
+	// public void setCategory(String category) {
+	// this.category = category;
+	// }
+	public String getLifecycleState() {
+		return lifecycleState;
+	}
+
+	public void setLifecycleState(String lifecycleState) {
+		this.lifecycleState = lifecycleState;
+	}
+
+	public List<String> getDerivedFrom() {
+		return derivedFrom;
+	}
+
+	public void setDerivedFrom(List<String> derivedFrom) {
+		this.derivedFrom = derivedFrom;
+	}
+
+	public String getVendorName() {
+		return vendorName;
+	}
+
+	public void setVendorName(String vendorName) {
+		this.vendorName = vendorName;
+	}
+
+	public String getVendorRelease() {
+		return vendorRelease;
+	}
+
+	public void setVendorRelease(String vendorRelease) {
+		this.vendorRelease = vendorRelease;
+	}
+
+	public String getContactId() {
+		return contactId;
+	}
+
+	public void setContactId(String contactId) {
+		this.contactId = contactId;
+	}
+
+	public String getAbstractt() {
+		return abstractt;
+	}
+
+	public void setAbstractt(String abstractt) {
+		this.abstractt = abstractt;
+	}
+
+	public String getHighestVersion() {
+		return highestVersion;
+	}
+
+	public void setHighestVersion(String highestVersion) {
+		this.highestVersion = highestVersion;
+	}
+
+	public List<CategoryDefinition> getCategories() {
+		return categories;
+	}
+
+	public void setCategories(List<CategoryDefinition> categories) {
+		this.categories = categories;
+	}
+
+	@Override
+	public String toString() {
+		return "ResourceRespJavaObject [uniqueId=" + uniqueId + ", resourceName=" + name + ", resourceVersion="
+				+ version + ", creatorUserId=" + creatorUserId + ", creatorFullName=" + creatorFullName
+				+ ", lastUpdaterUserId=" + lastUpdaterUserId + ", lastUpdaterFullName=" + lastUpdaterFullName
+				+ ", description=" + description + ", icon=" + icon + ", tags=" + tags + ", isHighestVersion="
+				+ isHighestVersion + ", creationDate=" + creationDate + ", lastUpdateDate=" + lastUpdateDate
+				+ ", lifecycleState=" + lifecycleState + ", derivedFrom=" + derivedFrom + ", vendorName=" + vendorName
+				+ ", vendorRelease=" + vendorRelease + ", contactId=" + contactId + ", abstractt=" + abstractt
+				+ ", highestVersion=" + highestVersion + ", artifacts=" + artifacts + ", interfaces=" + interfaces
+				+ ", uuid=" + uuid + ", cost=" + cost + ", licenseType=" + licenseType + ", resourceType="
+				+ resourceType + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java
new file mode 100644
index 0000000..015d228
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class ServiceAssetStructure extends AssetStructure {
+
+	private String distributionStatus;
+
+	public ServiceAssetStructure() {
+		super();
+	}
+
+	public ServiceAssetStructure(String uuid, String invariantUUID, String name, String version, String toscaModelURL,
+			String category, String lifecycleState, String lastUpdaterUserId) {
+		super(uuid, invariantUUID, name, version, toscaModelURL, category, lifecycleState, lastUpdaterUserId);
+	}
+
+	@Override
+	public String toString() {
+		return "ServiceAssetStructure [distributionStatus=" + distributionStatus + "]";
+	}
+
+	public String getDistributionStatus() {
+		return distributionStatus;
+	}
+
+	public void setDistributionStatus(String distributionStatus) {
+		this.distributionStatus = distributionStatus;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java
new file mode 100644
index 0000000..cc283a3
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+public class ServiceDetailedAssetStructure extends ServiceAssetStructure {
+
+	String lastUpdaterFullName;
+	List<ResourceInstanceAssetStructure> resources;
+	List<ArtifactAssetStructure> artifacts;
+
+	public ServiceDetailedAssetStructure() {
+		super();
+	}
+
+	public ServiceDetailedAssetStructure(String uuid, String invariantUUID, String name, String version,
+			String toscaModelURL, String category, String lifecycleState, String lastUpdaterUserId) {
+		super(uuid, invariantUUID, name, version, toscaModelURL, category, lifecycleState, lastUpdaterUserId);
+	}
+
+	public ServiceDetailedAssetStructure(String lastUpdaterFullName, List<ResourceInstanceAssetStructure> resources,
+			List<ArtifactAssetStructure> artifacts) {
+		super();
+		this.lastUpdaterFullName = lastUpdaterFullName;
+		this.resources = resources;
+		this.artifacts = artifacts;
+	}
+
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+
+	public List<ResourceInstanceAssetStructure> getResources() {
+		return resources;
+	}
+
+	public void setResources(List<ResourceInstanceAssetStructure> resources) {
+		this.resources = resources;
+	}
+
+	public List<ArtifactAssetStructure> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(List<ArtifactAssetStructure> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	@Override
+	public String toString() {
+		return "ServiceDetailedAssetStructure [lastUpdaterFullName=" + lastUpdaterFullName + ", resources=" + resources
+				+ ", artifacts=" + artifacts + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java
new file mode 100644
index 0000000..dde1f27
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+public class ServiceDistributionStatus {
+	
+	private String distributionID;
+	private String timestamp;
+	private String userId;
+	private String deployementStatus;
+	
+	public ServiceDistributionStatus() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ServiceDistributionStatus(String distributionID, String timestamp, String userId, String deployementStatus) {
+		super();
+		this.distributionID = distributionID;
+		this.timestamp = timestamp;
+		this.userId = userId;
+		this.deployementStatus = deployementStatus;
+	}
+
+	@Override
+	public String toString() {
+		return "ServiceDistributionStatus [distributionID=" + distributionID + ", timestamp=" + timestamp + ", userId=" + userId + ", deployementStatus=" + deployementStatus + "]";
+	}
+
+	public String getDistributionID() {
+		return distributionID;
+	}
+
+	public void setDistributionID(String distributionID) {
+		this.distributionID = distributionID;
+	}
+
+	public String getTimestamp() {
+		return timestamp;
+	}
+
+	public void setTimestamp(String timestamp) {
+		this.timestamp = timestamp;
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getDeployementStatus() {
+		return deployementStatus;
+	}
+
+	public void setDeployementStatus(String deployementStatus) {
+		this.deployementStatus = deployementStatus;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java
new file mode 100644
index 0000000..e33183c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.ArrayList;
+
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+
+public class ServiceReqDetails extends ComponentReqDetails {
+
+	public ServiceReqDetails(String serviceName, String category, ArrayList<String> tags, String description,
+			String contactId, String icon) {
+		this.name = serviceName;
+		// this.category = category;
+		this.tags = tags;
+		this.description = description;
+		this.contactId = contactId;
+		this.icon = icon;
+		projectCode = "12345";
+		CategoryDefinition categoryDefinition = new CategoryDefinition();
+		categoryDefinition.setName(category);
+		categories = new ArrayList<>();
+		categories.add(categoryDefinition);
+
+	}
+
+	public ServiceReqDetails(Service service) {
+		this.contactId = service.getContactId();
+		this.categories = service.getCategories();
+		this.creatorUserId = service.getCreatorUserId();
+		this.creatorFullName = service.getCreatorFullName();
+		this.description = service.getDescription();
+		this.icon = service.getIcon();
+		this.name = service.getName();
+		this.projectCode = service.getProjectCode();
+		this.tags = service.getTags();
+		this.uniqueId = service.getUniqueId();
+		this.UUID = service.getUUID();
+		this.version = service.getVersion();
+
+	}
+
+	public ServiceReqDetails() {
+		contactId = "aa1234";
+		projectCode = "12345";
+	}
+
+	public ServiceReqDetails(ServiceReqDetails a, String newServiceName) {
+		a.setName(newServiceName);
+	}
+
+	@Override
+	public String toString() {
+		return "ServiceDetails [name=" + name + ", category=" + getCategory() + ", tags=" + tags + ", description="
+				+ description + ", contactId=" + contactId + ", icon=" + icon + "]";
+	}
+
+	public ServiceReqDetails(ServiceReqDetails aService) {
+		this(aService.getName(), aService.getCategory(), (ArrayList<String>) aService.getTags(),
+				aService.getDescription(), aService.getContactId(), aService.getIcon());
+		uniqueId = aService.getUniqueId();
+		version = aService.getVersion();
+	}
+
+	public String getCategory() {
+		if (categories != null && categories.size() >= 1) {
+			return categories.get(0).getName();
+		}
+		return null;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java
new file mode 100644
index 0000000..723f6a4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java
@@ -0,0 +1,268 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ServiceRespJavaObject {
+
+	String category;
+	String creatorUserId;
+	String creatorFullName;
+	String lastUpdaterUserId;
+	String lastUpdaterFullName;
+	String serviceName;
+	String version;
+	String creationDate;
+	String icon;
+	String name;
+	String description;
+	ArrayList<String> tags;
+	String uniqueId;
+	String lastUpdateDate;
+	String contactId;
+	String vendorName;
+	String vendorRelease;
+	String lifecycleState;
+	String highestVersion;
+	ArrayList<String> artifacts;
+	ArrayList<String> ResourceInstances;
+	ArrayList<String> ResourceInstancesRelations;
+
+	public ServiceRespJavaObject() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ServiceRespJavaObject(String category, String creatorUserId, String creatorFullName,
+			String lastUpdaterUserId, String lastUpdaterFullName, String serviceName, String version,
+			String creationDate, String icon, String name, String description, ArrayList<String> tags, String uniqueId,
+			String lastUpdateDate, String contactId, String vendorName, String vendorRelease, String lifecycleState,
+			String highestVersion, ArrayList<String> artifacts, ArrayList<String> resourceInstances,
+			ArrayList<String> resourceInstancesRelations) {
+		super();
+		this.category = category;
+		this.creatorUserId = creatorUserId;
+		this.creatorFullName = creatorFullName;
+		this.lastUpdaterUserId = lastUpdaterUserId;
+		this.lastUpdaterFullName = lastUpdaterFullName;
+		this.serviceName = serviceName;
+		this.version = version;
+		this.creationDate = creationDate;
+		this.icon = icon;
+		this.name = name;
+		this.description = description;
+		this.tags = tags;
+		this.uniqueId = uniqueId;
+		this.lastUpdateDate = lastUpdateDate;
+		this.contactId = contactId;
+		this.vendorName = vendorName;
+		this.vendorRelease = vendorRelease;
+		this.lifecycleState = lifecycleState;
+		this.highestVersion = highestVersion;
+		this.artifacts = artifacts;
+		ResourceInstances = resourceInstances;
+		ResourceInstancesRelations = resourceInstancesRelations;
+	}
+
+	public String getCategory() {
+		return category;
+	}
+
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	public String getCreatorUserId() {
+		return creatorUserId;
+	}
+
+	public void setCreatorUserId(String creatorUserId) {
+		this.creatorUserId = creatorUserId;
+	}
+
+	public String getCreatorFullName() {
+		return creatorFullName;
+	}
+
+	public void setCreatorFullName(String creatorFullName) {
+		this.creatorFullName = creatorFullName;
+	}
+
+	public String getLastUpdaterUserId() {
+		return lastUpdaterUserId;
+	}
+
+	public void setLastUpdaterUserId(String lastUpdaterUserId) {
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	public String getCreationDate() {
+		return creationDate;
+	}
+
+	public void setCreationDate(String creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public ArrayList<String> getTags() {
+		return tags;
+	}
+
+	public void setTags(ArrayList<String> tags) {
+		this.tags = tags;
+	}
+
+	public String getUniqueId() {
+		return uniqueId;
+	}
+
+	public void setUniqueId(String uniqueId) {
+		this.uniqueId = uniqueId;
+	}
+
+	public String getLastUpdateDate() {
+		return lastUpdateDate;
+	}
+
+	public void setLastUpdateDate(String lastUpdateDate) {
+		this.lastUpdateDate = lastUpdateDate;
+	}
+
+	public String getContactId() {
+		return contactId;
+	}
+
+	public void setContactId(String contactId) {
+		this.contactId = contactId;
+	}
+
+	public String getVendorName() {
+		return vendorName;
+	}
+
+	public void setVendorName(String vendorName) {
+		this.vendorName = vendorName;
+	}
+
+	public String getVendorRelease() {
+		return vendorRelease;
+	}
+
+	public void setVendorRelease(String vendorRelease) {
+		this.vendorRelease = vendorRelease;
+	}
+
+	public String getLifecycleState() {
+		return lifecycleState;
+	}
+
+	public void setLifecycleState(String lifecycleState) {
+		this.lifecycleState = lifecycleState;
+	}
+
+	public String getHighestVersion() {
+		return highestVersion;
+	}
+
+	public void setHighestVersion(String highest) {
+		this.highestVersion = highest;
+	}
+
+	public ArrayList<String> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(ArrayList<String> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	public ArrayList<String> getResourceInstances() {
+		return ResourceInstances;
+	}
+
+	public void setResourceInstances(ArrayList<String> resourceInstances) {
+		ResourceInstances = resourceInstances;
+	}
+
+	public ArrayList<String> getResourceInstancesRelations() {
+		return ResourceInstancesRelations;
+	}
+
+	public void setResourceInstancesRelations(ArrayList<String> resourceInstancesRelations) {
+		ResourceInstancesRelations = resourceInstancesRelations;
+	}
+
+	@Override
+	public String toString() {
+		return "ServiceRespJavaObject [category=" + category + ", creatorUserId=" + creatorUserId + ", creatorFullName="
+				+ creatorFullName + ", lastUpdaterUserId=" + lastUpdaterUserId + ", lastUpdaterFullName="
+				+ lastUpdaterFullName + ", serviceName=" + serviceName + ", version=" + version + ", creationDate="
+				+ creationDate + ", icon=" + icon + ", name=" + name + ", description=" + description + ", tags=" + tags
+				+ ", uniqueId=" + uniqueId + ", lastUpdateDate=" + lastUpdateDate + ", contactId=" + contactId
+				+ ", vendorName=" + vendorName + ", vendorRelease=" + vendorRelease + ", lifecycleState="
+				+ lifecycleState + ", lifecycleState=" + lifecycleState + ", artifacts=" + artifacts
+				+ ", ResourceInstances=" + ResourceInstances + ", ResourceInstancesRelations="
+				+ ResourceInstancesRelations + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java
new file mode 100644
index 0000000..d0f0292
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes;
+
+import java.util.List;
+
+public class TypeHeatMetaDefinition {
+
+	String typeName;
+
+	List<GroupHeatMetaDefinition> groupHeatMetaDefinition;
+
+	public TypeHeatMetaDefinition() {
+		super();
+	}
+
+	public String getTypeName() {
+		return typeName;
+	}
+
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+
+	public List<GroupHeatMetaDefinition> getGroupHeatMetaDefinition() {
+		return groupHeatMetaDefinition;
+	}
+
+	public void setGroupHeatMetaDefinition(List<GroupHeatMetaDefinition> groupHeatMetaDefinition) {
+		this.groupHeatMetaDefinition = groupHeatMetaDefinition;
+	}
+
+	@Override
+	public String toString() {
+		return "TypeHeatMetaDefinition [typeName=" + typeName + ", groupHeatMetaDefinition=" + groupHeatMetaDefinition
+				+ "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java
new file mode 100644
index 0000000..4e4c87f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Enum That Represents possible Artifacts Types.
+ *
+ */
+public enum ArtifactTypeEnum {
+	CHEF("CHEF"), PUPPET("PUPPET"), YANG("YANG"), SHELL_SCRIPT("SHELL_SCRIPT"), ICON("ICON"), UNKNOWN("UNKNOWN"), HEAT("HEAT"), DG_XML("DG_XML"), MURANO_PKG("MURANO_PKG"), 
+	HEAT_ENV("HEAT_ENV"), YANG_XML("YANG_XML"), HEAT_VOL("HEAT_VOL"), HEAT_NET("HEAT_NET"), OTHER("OTHER"), WORKFLOW("WORKFLOW"), NETWORK_CALL_FLOW("NETWORK_CALL_FLOW"), 
+	TOSCA_TEMPLATE("TOSCA_TEMPLATE"), TOSCA_CSAR("TOSCA_CSAR"), VNF_CATALOG("VNF_CATALOG"), VF_LICENSE("VF_LICENSE"), VENDOR_LICENSE("VENDOR_LICENSE"), 
+	MODEL_INVENTORY_PROFILE("MODEL_INVENTORY_PROFILE"), MODEL_QUERY_SPEC("MODEL_QUERY_SPEC"), APPC_CONFIG("APPC_CONFIG"), HEAT_NESTED("HEAT_NESTED"), 
+	HEAT_ARTIFACT("HEAT_ARTIFACT"), VF_MODULES_METADATA("VF_MODULES_METADATA"),
+	// DCAE Artifacts
+	DCAE_TOSCA("DCAE_TOSCA"), DCAE_JSON("DCAE_JSON"), DCAE_POLICY("DCAE_POLICY"), DCAE_DOC("DCAE_DOC"), DCAE_EVENT("DCAE_EVENT"), DCAE_INVENTORY_TOSCA("DCAE_INVENTORY_TOSCA"), 
+	DCAE_INVENTORY_JSON("DCAE_INVENTORY_JSON"), DCAE_INVENTORY_POLICY("DCAE_INVENTORY_POLICY"), DCAE_INVENTORY_DOC("DCAE_INVENTORY_DOC"), 
+	DCAE_INVENTORY_BLUEPRINT("DCAE_INVENTORY_BLUEPRINT"), DCAE_INVENTORY_EVENT("DCAE_INVENTORY_EVENT"),
+	// AAI Artifacts
+	AAI_SERVICE_MODEL("AAI_SERVICE_MODEL"), AAI_VF_MODEL("AAI_VF_MODEL"), AAI_VF_MODULE_MODEL("AAI_VF_MODULE_MODEL"), AAI_VF_INSTANCE_MODEL("AAI_VF_INSTANCE_MODEL"),
+	// MIB artifacts
+	SNMP_POLL ("SNMP_POLL"), SNMP_TRAP("SNMP_TRAP"), GUIDE("GUIDE")
+	;
+
+	ArtifactTypeEnum(String type) {
+		this.type = type;
+	}
+
+	private String type;
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public static ArtifactTypeEnum findType(final String type) {
+		for (ArtifactTypeEnum ate : ArtifactTypeEnum.values()) {
+			// According to Pavel/Ella
+			if (ate.getType().equalsIgnoreCase(type)) {
+				return ate;
+			}
+		}
+		return null;
+	}
+
+	public static List<String> getAllTypes() {
+		List<String> types = new ArrayList<String>();
+		for (ArtifactTypeEnum ate : ArtifactTypeEnum.values()) {
+			types.add(ate.getType());
+		}
+		return types;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java
new file mode 100644
index 0000000..82e9a36
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum AssocType {
+
+	BINDABLE("tosca.capabilities.network.Bindable"), HOSTEDON("tosca.relationships.HostedOn"), LINKABLE("tosca.capabilities.network.Linkable"), 
+	CONTAINER("tosca.capabilities.Container"), NODE("tosca.capabilities.Node");
+
+	private String assocType;
+
+	private AssocType(String assocType) {
+		this.assocType = assocType;
+
+	}
+
+	public String getAssocType() {
+		return assocType;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java
new file mode 100644
index 0000000..a713d50
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum AuditEnum {
+
+	ACTION("ACTION"), RESOURCE_NAME("RESOURCE_NAME"), RESOURCE_TYPE("RESOURCE_TYPE"), PREV_VERSION("PREV_VERSION"), CURR_VERSION("CURR_VERSION"), MODIFIER("MODIFIER"), PREV_STATE("PREV_STATE"), 
+	CURR_STATE("CURR_STATE"), STATUS("STATUS-Type"), DESC("DESC"), URL("URL"), USER("USER"), AUTH_STATUS("AUTH_STATUS"), REALM("REALM");
+
+	String value;
+
+	private AuditEnum(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+
+		return value.toLowerCase();
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java
new file mode 100644
index 0000000..308ea5c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum AuditJsonKeysEnum {
+
+	ACTION("ACTION"), RESOURCE_NAME("RESOURCE_NAME"), RESOURCE_TYPE("RESOURCE_TYPE"), PREV_VERSION("PREV_VERSION"), CURR_VERSION("CURR_VERSION"), PREV_STATE("PREV_STATE"), CURR_STATE("CURR_STATE"), 
+	DPREV_STATUS("DPREV_STATUS"), DCURR_STATUS("DCURR_STATUS"), STATUS("STATUS"), DESCRIPTION("DESCRIPTION"), ARTIFACT_DATA("ARTIFACT_DATA"), CONSUMER_ID("CONSUMER_ID"), RESOURCE_URL("RESOURCE_URL"), 
+	COMMENT("COMMENT"), DID("DID"), TOPIC_NAME("TOPIC_NAME"), TOSCA_NODE_TYPE("TOSCA_NODE_TYPE"), CURR_ARTIFACT_UUID("CURR_ARTIFACT_UUID"), PREV_ARTIFACT_UUID("PREV_ARTIFACT_UUID"), DETAILS("DETAILS"), 
+	MODIFIER("MODIFIER"), SERVICE_INSTANCE_ID("SERVICE_INSTANCE_ID"), INVARIANT_UUID("INVARIANT_UUID");
+
+	private String auditJsonKeyName;
+
+	private AuditJsonKeysEnum(String auditJsonKeyName) {
+		this.auditJsonKeyName = auditJsonKeyName;
+	}
+
+	public String getAuditJsonKeyName() {
+		return auditJsonKeyName.toLowerCase();
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java
new file mode 100644
index 0000000..3d242e8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum ComponentType {
+
+	RESOURCE("Resource"), SERVICE("Service"), ARTIFACT("Artifact");
+
+	String value;
+
+	private ComponentType(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+
+		return value;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java
new file mode 100644
index 0000000..7042a95
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum DistributionNotificationStatusEnum {
+
+	
+	DEPLOY_OK("DEPLOY_OK"), 
+	DOWNLOAD_OK("DOWNLOAD_OK"),
+	NOTIFIED("NOTIFIED"),
+	NOT_NOTIFIED("NOT_NOTIFIED");
+
+	private String value;
+
+	private DistributionNotificationStatusEnum(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public static DistributionNotificationStatusEnum findState(String state) {
+
+		for (DistributionNotificationStatusEnum distributionStatus : DistributionNotificationStatusEnum.values()) {
+			if (distributionStatus.name().equalsIgnoreCase(state)
+					|| distributionStatus.getValue().equalsIgnoreCase(state)) {
+				return distributionStatus;
+			}
+		}
+		return null;
+	}
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java
new file mode 100644
index 0000000..c2a28a1
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public class ErrorInfo {
+
+	private Integer code;
+	private String message;
+	private String messageId;
+
+	public ErrorInfo() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ErrorInfo(Integer code, String message, String messageId) {
+		super();
+		this.code = code;
+		this.message = message;
+		this.messageId = messageId;
+	}
+
+	public ErrorInfo(Integer code, String message) {
+		super();
+		this.code = code;
+		this.message = message;
+	}
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public String getMessageAndReplaceVariables(Object... variables) {
+		String formatReadyString = message.replaceAll("%[\\d]+", "%s");
+		formatReadyString = String.format(formatReadyString, variables);
+		return formatReadyString;
+	}
+
+	public String getAuditDesc(Object... variables) {
+		String messageAndReplaceVariables = getMessageAndReplaceVariables(variables);
+		String res;
+		if (messageId != null) {
+			res = messageId + ": " + messageAndReplaceVariables;
+		} else {
+			res = messageAndReplaceVariables;
+		}
+		return res;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public String getMessageId() {
+		return messageId;
+	}
+
+	public void setMessageId(String messageId) {
+		this.messageId = messageId;
+	}
+
+	@Override
+	public String toString() {
+		return "ErrorInfo [code=" + code + ", message=" + message + ", messageId=" + messageId + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java
new file mode 100644
index 0000000..6bfbd8a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public class EsIndexTypeIdToDelete {
+
+	String index;
+	String type;
+	String id;
+
+	public EsIndexTypeIdToDelete() {
+		super();
+	}
+
+	public EsIndexTypeIdToDelete(String index, String type, String id) {
+		super();
+		this.index = index;
+		this.type = type;
+		this.id = id;
+	}
+
+	public String getIndex() {
+		return index;
+	}
+
+	public void setIndex(String index) {
+		this.index = index;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java
new file mode 100644
index 0000000..59d1dec
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum ExceptionEnumType {
+
+	SERVICE_EXCEPTION("serviceException"), POLICY_EXCPTION("policyException");
+
+	String value;
+
+	private ExceptionEnumType(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+		return value;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java
new file mode 100644
index 0000000..21901e4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java
@@ -0,0 +1,95 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+
+public enum ImportTestTypesEnum {
+
+	MISSING_CONTACT("tosca.nodes.missing_contact", "missing_contact", ActionStatus.COMPONENT_MISSING_CONTACT, Arrays.asList("Resource"), true), 
+	MISSING_RESOURCE_NAME("tosca.nodes.missing_resource_name", "missing_resource_name", ActionStatus.MISSING_COMPONENT_NAME, Arrays.asList("Resource"), true), 
+	MISSING_DESC("tosca.nodes.missing_desc", "missing_desc", ActionStatus.COMPONENT_MISSING_DESCRIPTION, Arrays.asList("Resource"), true), 
+	MISSING_ICON("tosca.nodes.missing_icon", "missing_icon", ActionStatus.COMPONENT_MISSING_ICON, Arrays.asList("Resource"), true), 
+	MISSING_TAGS("tosca.nodes.missing_tags", "missing_tags", ActionStatus.COMPONENT_MISSING_TAGS, null, true), 
+	MISSING_CATEGORY("tosca.nodes.missing_category", "missing_category", ActionStatus.COMPONENT_MISSING_CATEGORY, Arrays.asList("Resource"), true),
+	// MISSING_PAYLOADNAME("tosca.nodes.missing_payloadName",
+	// "missing_payloadName", ActionStatus.INVALID_TOSCA_FILE_EXTENSION, null,
+	// true),
+
+	EMPTY_RESOURCE_NAME("tosca.nodes.empty_resource_name", "missing_resource_name"/* "empty_resource_name" */, ActionStatus.MISSING_COMPONENT_NAME, Arrays.asList("Resource"), false), 
+	EMPTY_CONTACT("tosca.nodes.empty_contact", "missing_contact"/* "empty_contact" */, ActionStatus.COMPONENT_MISSING_CONTACT, Arrays.asList("Resource"), false), 
+	EMPTY_CATEGORY("tosca.nodes.empty_category", "missing_category"/* "empty_category" */, ActionStatus.COMPONENT_MISSING_CATEGORY, Arrays.asList("Resource"), false), 
+	EMPTY_DESC("tosca.nodes.empty_desc", "missing_desc"/* "empty_desc" */, ActionStatus.COMPONENT_MISSING_DESCRIPTION, Arrays.asList("Resource"), false), 
+	EMPTY_ICON("tosca.nodes.empty_icon", "missing_icon"/* "empty_icon" */, ActionStatus.COMPONENT_MISSING_ICON, Arrays.asList("Resource"), false), 
+	EMPTY_PAYLOADNAME("tosca.nodes.empty_payloadName", "missing_payloadName"/* "empty_payloadName" */, ActionStatus.INVALID_TOSCA_FILE_EXTENSION, null, false),
+	EMPTY_TAG("tosca.nodes.empty_tag", "empty_tag", ActionStatus.INVALID_FIELD_FORMAT, Arrays.asList("Resource", "tag"), false), 
+	VALIDATE_PROPORTIES_1("tosca.nodes.validateProporties_typeBoolean_valueInit", "validateProporties_typeBoolean_valueInit", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "boolean", "123456"), false), 
+	VALIDATE_PROPORTIES_2("tosca.nodes.validateProporties_typeBoolean_valueString", "validateProporties_typeBoolean_valueString", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "boolean", "abcd"), false), 
+	VALIDATE_PROPORTIES_3("tosca.nodes.validateProporties_typeFloat_valueBoolean", "validateProporties_typeFloat_valueBoolean", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "float", "true"), false), 
+	VALIDATE_PROPORTIES_4("tosca.nodes.validateProporties_typeFloat_valueString", "validateProporties_typeFloat_valueString", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "float", "abcd"), false), 
+	VALIDATE_PROPORTIES_5("tosca.nodes.validateProporties_typeInit_valueBoolean", "validateProporties_typeInit_valueBoolean", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "integer", "true"), false), 
+	VALIDATE_PROPORTIES_6("tosca.nodes.validateProporties_typeInit_valueFloat", "validateProporties_typeInit_valueFloat", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "integer", "0.123"), false), 
+	VALIDATE_PROPORTIES_7("tosca.nodes.validateProporties_typeInit_valueString", "validateProporties_typeInit_valueString", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "integer", "abcd"), false);
+	// VALIDATE_PROPORTIES_8("tosca.nodes.validateProporties_happyScenarios","validateProporties_happyScenarios", ActionStatus.OK, null, false);
+
+	private String normativeName;
+	private String folderName;
+	private ActionStatus actionStatus;
+	private Boolean validateAudit;
+	private List<String> errorParams;
+	private Boolean validateYaml;
+
+	// private enum ActionStatus;
+
+	private ImportTestTypesEnum(String resourceName, String folderName, ActionStatus actionStatus,
+			List<String> errorParams, Boolean validateAudit) {
+		this.normativeName = resourceName;
+		this.folderName = folderName;
+		this.actionStatus = actionStatus;
+		this.errorParams = errorParams;
+		this.validateAudit = validateAudit;
+
+	}
+
+	public String getNormativeName() {
+		return normativeName;
+	}
+
+	public String getFolderName() {
+		return folderName;
+	}
+
+	public ActionStatus getActionStatus() {
+		return actionStatus;
+	}
+
+	public Boolean getvalidateAudit() {
+		return validateAudit;
+	}
+
+	public List<String> getErrorParams() {
+		return errorParams;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java
new file mode 100644
index 0000000..9edfb9a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+import java.util.List;
+
+public enum LifeCycleStatesEnum {
+
+	CHECKOUT("checkout", "NOT_CERTIFIED_CHECKOUT"), 
+	CHECKIN("checkin", "NOT_CERTIFIED_CHECKIN"), 
+	CERTIFICATIONREQUEST("certificationRequest", "READY_FOR_CERTIFICATION"), 
+	UNDOCHECKOUT("undoCheckout", ""), 
+	CANCELCERTIFICATION("cancelCertification", ""), 
+	STARTCERTIFICATION("startCertification", "CERTIFICATION_IN_PROGRESS"), 
+	FAILCERTIFICATION("failCertification", ""), 
+	CERTIFY("certify", "CERTIFIED");
+
+	private String state;
+	private String componentState;
+
+	private LifeCycleStatesEnum(String state, String componentState) {
+		this.state = state;
+		this.componentState = componentState;
+
+	}
+
+	public String getState() {
+		return state;
+	}
+
+	public String getComponentState() {
+		return componentState;
+	}
+
+	public static LifeCycleStatesEnum findByCompState(String compState) {
+
+		for (LifeCycleStatesEnum lifeCycleStatesEnum : LifeCycleStatesEnum.values()) {
+			if (lifeCycleStatesEnum.getComponentState().equals(compState)) {
+				return lifeCycleStatesEnum;
+			}
+		}
+
+		return null;
+
+	}
+
+	public static LifeCycleStatesEnum findByState(String state) {
+
+		for (LifeCycleStatesEnum lifeCycleStatesEnum : LifeCycleStatesEnum.values()) {
+			if (lifeCycleStatesEnum.name().equals(state)) {
+				return lifeCycleStatesEnum;
+			}
+		}
+
+		return null;
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java
new file mode 100644
index 0000000..5889243
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+
+public enum MandatoryResourceArtifactTypeEnum {
+
+	TEST_SCRIPTS(null, "testscripts"), FEATURES(null, "features"), CAPACITY(null, "capacity"), VENDOR_TEST_RESULT(null, "vendortestresult"), CLOUD_QUESTIONNAIRE(null, "cloudQuestionnaire");
+
+	String artifactName;
+	String logicalName;
+
+	private MandatoryResourceArtifactTypeEnum(String artifactName, String logicalName) {
+		this.artifactName = artifactName;
+		this.logicalName = logicalName;
+	}
+
+	public String getArtifactName() {
+		return artifactName;
+	}
+
+	public String getLogicalName() {
+		return logicalName;
+	}
+
+	public ArtifactGroupTypeEnum getGroupType() {
+		return ArtifactGroupTypeEnum.INFORMATIONAL;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java
new file mode 100644
index 0000000..b73d5a8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum MandatoryServiceArtifactTypeEnum {
+
+	MESSAGE_FLOWS(null, "messageflows".toLowerCase(), "Message Flows"), 
+	INSTANT_FLOWS(null, "instantiationflows".toLowerCase(), "Management Flows"), 
+	SERVICE_ART_PLAN(null, "serviceartifactplan".toLowerCase(), "Service Artifact Plan"), 
+	SUM_OF_ELEMENTS(null, "summaryofimpactstoecompelements".toLowerCase(), "Summary of impacts to ECOMP elements,OSSs, BSSs"), 
+	CONTROL_LOOP_FUN(null, "controlloopfunctions".toLowerCase(), "Control Loop Functions"), 
+	DIMENSIONNING_INFO(null, "dimensioninginfo".toLowerCase(), "Dimensioning Info"), 
+	AFFINITY_RULES(null, "affinityrules".toLowerCase(), "Affinity Rules"), 
+	OPERATIONAL_POLICIES(null, "operationalpolicies".toLowerCase(), "Operational Policies"), 
+	SERVICE_SPECIFIC_POLICIES(null, "servicespecificpolicies".toLowerCase(), "Service-specific Policies"), 
+	ENGINEERING_RULES(null, "engineeringrules".toLowerCase(), "Engineering Rules (ERD)"), 
+	DISTRIB_INSTRUCTIONS(null, "distributioninstructions".toLowerCase(), "Distribution Instructions"), 
+	DEPLOYMENT_VOTING_REC(null, "deploymentvotingrecord".toLowerCase(), "Deployment Voting Record"), 
+	CERTIFICATION_TEST_RESULT(null, "certificationtestresults".toLowerCase(), "TD Certification Test Results");
+	// SERVICE_QUESTIONNAIRE(null, "serviceQuestionnaire".toLowerCase());
+
+	String artifactName;
+	String logicalName;
+	String artifactDisplayName;
+
+	private MandatoryServiceArtifactTypeEnum(String artifactName, String logicalName, String artifactDisplayName) {
+		this.artifactName = artifactName;
+		this.logicalName = logicalName;
+		this.artifactDisplayName = artifactDisplayName;
+	}
+
+	public String getArtifactName() {
+		return artifactName;
+	}
+
+	public String getLogicalName() {
+		return logicalName;
+	}
+
+	public String getArtifactDisplayName() {
+		return artifactDisplayName;
+	}
+
+	public void setArtifactDisplayName(String artifactDisplayName) {
+		this.artifactDisplayName = artifactDisplayName;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java
new file mode 100644
index 0000000..389b962
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum NormativeTypesEnum {
+	ROOT("tosca.nodes.Root", "root"), COMPUTE("tosca.nodes.Compute", "compute"), BLOCK_STORAGE("tosca.nodes.BlockStorage", "blockStorage"), CONTAINER_APPLICATION("tosca.nodes.Container.Application", "containerApplication"), 
+	CONTAINER_RUNTIME("tosca.nodes.Container.Runtime","containerRuntime"), DATABASE("tosca.nodes.Database", "database"), DBMS("tosca.nodes.DBMS", "DBMS"), LOAD_BALANCER("tosca.nodes.LoadBalancer", "loadBalancer"), 
+	OBJECT_STORAGE("tosca.nodes.ObjectStorage", "objectStorage"), NETWORK("tosca.nodes.network.Network", "network"), PORT("tosca.nodes.network.Port", "port"), SOFTWARE_COMPONENT("tosca.nodes.SoftwareComponent", "softwareComponent"), 
+	WEB_APPLICATION("tosca.nodes.webapplication","webApplication"), WEB_SERVER("tosca.nodes.WebServer", "webServer");
+	
+	public String normativeName;
+	private String folderName;
+
+	private NormativeTypesEnum(String resourceName, String folderName) {
+		this.normativeName = resourceName;
+		this.folderName = folderName;
+	}
+
+	public String getNormativeName() {
+		return normativeName;
+	}
+
+	public String getFolderName() {
+		return folderName;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java
new file mode 100644
index 0000000..d85a496
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+
+public enum OriginTypeEnum {
+	PRODUCT("Product", "Product", "product instance", ComponentTypeEnum.PRODUCT), 
+	SERVICE("Service", "Service", "service instance", ComponentTypeEnum.SERVICE), 
+	VF("VF", "VF (Virtual Function)", "resource instance", ComponentTypeEnum.RESOURCE),
+	VFC("VFC", "VFC (Virtual Function Component)", "resource instance", ComponentTypeEnum.RESOURCE),
+	CP("CP", "CP (Connection Point)", "resource instance", ComponentTypeEnum.RESOURCE), 
+	VL("VL", "VL (Virtual Link)", "resource instance", ComponentTypeEnum.RESOURCE),
+	VFCMT("VFCMT", "VFCMT (VFC Monitoring Template)", "resource instance", ComponentTypeEnum.RESOURCE),
+	VFi("VFi", "VFi (Virtual Function Instance)", "resource instance", ComponentTypeEnum.RESOURCE_INSTANCE);
+	
+
+	private String value;
+	private String displayValue;
+	private String instanceType;
+	private ComponentTypeEnum componentType;
+
+	private OriginTypeEnum(String value, String displayValue, String instanceType, ComponentTypeEnum componentType) {
+		this.value = value;
+		this.displayValue = displayValue;
+		this.instanceType = instanceType;
+		this.componentType = componentType;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public String getDisplayValue() {
+		return displayValue;
+	}
+
+	public String getInstanceType() {
+		return instanceType;
+	}
+
+	public ComponentTypeEnum getComponentType() {
+		return componentType;
+	}
+
+	public static OriginTypeEnum findByValue(String value) {
+		OriginTypeEnum ret = null;
+		for (OriginTypeEnum curr : OriginTypeEnum.values()) {
+			if (curr.getValue().equals(value)) {
+				ret = curr;
+				break;
+			}
+		}
+		return ret;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java
new file mode 100644
index 0000000..8a1dc84
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
+
+public enum PropertyTypeEnum {
+	INTEGER("defaultIntegerPropName1", "integer", "125", "default integer type property description", null), 
+	STRING("defaultStringPropName1", "string", "string", "default string type property description", null), 
+	BOOLEAN("defaultBooleanPropName1", "boolean", "true", "default boolean type property description", null),
+	FLOAT("defaultBooleanPropName1", "float", "1.2", "default float type property description", null),
+	STRING_LIST("defaultStringListPropName", "list", "[a,b]", "outer description", getDefaultStringSchema(ToscaPropertyType.STRING.getType())), 
+	INTEGER_LIST("defaultIntegerListPropName", "list", "[1,2]", "outer description", getDefaultStringSchema(ToscaPropertyType.INTEGER.getType())), 
+	BOOLEAN_LIST("defaultBooleanListPropName", "list", "[true,false]", "outer description", getDefaultStringSchema(ToscaPropertyType.BOOLEAN.getType())), 
+	FLOAT_LIST("defaultFloatMapPropName", "list", "[1.0,2.0]", "outer description", getDefaultStringSchema(ToscaPropertyType.FLOAT.getType())), 
+	STRING_MAP("defaultStringMapPropName", "map", "{\"key1\":val1 , \"key2\":val2}", "outer description", getDefaultStringSchema(ToscaPropertyType.STRING.getType())), 
+	INTEGER_MAP("defaultIntegerMapPropName", "map", "{\"key1\":123 , \"key2\":-456}", "outer description", getDefaultStringSchema(ToscaPropertyType.INTEGER.getType())), 
+	BOOLEAN_MAP("defaultBooleanMapPropName", "map", "{\"key1\":true , \"key2\":false}", "outer description", getDefaultStringSchema(ToscaPropertyType.BOOLEAN.getType())), 
+	FLOAT_MAP("defaultFloatMapPropName", "map", "{\"key1\":0.2123 , \"key2\":43.545f}", "outer description", getDefaultStringSchema(ToscaPropertyType.FLOAT.getType()));
+
+	private String name;
+	private String type;
+	private String value;
+	private String description;
+	private SchemaDefinition schemaDefinition;
+
+	private PropertyTypeEnum(String name, String type, String value, String description,
+			SchemaDefinition schemaDefinition) {
+		this.name = name;
+		this.type = type;
+		this.value = value;
+		this.description = description;
+		this.schemaDefinition = schemaDefinition;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public SchemaDefinition getSchemaDefinition() {
+		return schemaDefinition;
+	}
+
+	public void setSchemaDefinition(SchemaDefinition schemaDefinition) {
+		this.schemaDefinition = schemaDefinition;
+	}
+
+	private static SchemaDefinition getDefaultStringSchema(String innerType) {
+		SchemaDefinition schema = new SchemaDefinition();
+		String description = "inner description";
+		PropertyDefinition property = new PropertyDefinition();
+		property.setType(innerType);
+		property.setDescription(description);
+		schema.setProperty(property);
+		return schema;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java
new file mode 100644
index 0000000..47123a6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum ResourceCategoryEnum {
+
+	NETWORK_L2_3_ROUTERS("Network L2-3", "Router"), NETWORK_L2_3_GETEWAY("Network L2-3","Gateway"), NETWORK_L2_3_WAN_CONNECTORS("Network L2-3", "WAN Connectors"), NETWORK_L2_3_LAN_CONNECTORS("Network L2-3", "LAN Connectors"), 
+	NETWORK_L2_3_INFRASTRUCTURE("Network L2-3", "Infrastructure"), NETWORK_L4("Network L4+", "Common Network Resources"), APPLICATION_L4_BORDER("Application L4+", "Border Element"), 
+	APPLICATION_L4_APP_SERVER("Application L4+", "Application Server"), APPLICATION_L4_WEB_SERVERS("Application L4+", "Web Server"), APPLICATION_L4_CALL_CONTROL("Application L4+","Call Control"), 
+	APPLICATION_L4_MEDIA_SERVER("Application L4+", "Media Servers"), APPLICATION_L4_LOAD_BALANCER("Application L4+", "Load Balancer"), APPLICATION_L4_DATABASE("Application L4+","Database"), 
+	APPLICATION_L4_FIREWALL("Application L4+", "Firewall"), GENERIC_INFRASTRUCTURE("Generic", "Infrastructure"), GENERIC_ABSTRACT("Generic", "Abstract"), GENERIC_NETWORK_ELEMENTS("Generic","Network Elements"), 
+	GENERIC_DATABASE("Generic", "Database"), NETWORK_CONNECTIVITY_CON_POINT("Network Connectivity", "Connection Points"), NETWORK_CONNECTIVITY_VIRTUAL_LINK("Network Connectivity","Virtual Links"),
+	TEMPLATE_MONITORING_TEMPLATE("Template", "Monitoring Template"), ALLOTTED_RESOURCE("Allotted Resource", "Allotted Resource");
+	
+	private String category;
+	private String subCategory;
+
+	ResourceCategoryEnum(String category, String subCategory) {
+		this.category = category;
+		this.subCategory = subCategory;
+	}
+
+	public String getCategory() {
+		return category;
+	}
+
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	public String getSubCategory() {
+		return subCategory;
+	}
+
+	public void setSubCategory(String subCategory) {
+		this.subCategory = subCategory;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java
new file mode 100644
index 0000000..a977e38
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum RespJsonKeysEnum {
+
+	IS_ABSTRACT("abstract"), UNIQUE_ID("uniqueId"), RESOURCE_NAME("name"), RESOURCE_VERSION("version"), TAGS("tags"), LIFE_CYCLE_STATE("lifecycleState"), DERIVED_FROM("derivedFrom"), RESOURCE_DESC("description"), 
+	VENDOR_NAME("vendorName"), VENDOR_RELEASE("vendorRelease"), CONTACT_ID("contactId"), ICON("icon"), HIGHEST_VERSION("highestVersion"), CREATOR_ATT_UID("creatorUserId"), CREATOR_FULL_NAME("creatorFullName"), 
+	LAST_UPDATER_ATT_UID("lastUpdaterUserId"), LAST_UPDATER_FULL_NAME("lastUpdaterFullName"), ARTIFACTS("artifacts"), DESCRIPTION("description"), UUID("uuid"), COST("cost"), LICENSE_TYPE("licenseType"), 
+	RESOURCE_TYPE("resourceType"), CATEGORIES("categories");
+	
+	private String respJsonKeyName;
+
+	private RespJsonKeysEnum(String respJsonKeyName) {
+		this.respJsonKeyName = respJsonKeyName;
+	}
+
+	public String getRespJsonKeyName() {
+		return respJsonKeyName;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java
new file mode 100644
index 0000000..f26423a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+
+
+public enum SearchCriteriaEnum {
+
+	RESOURCE_TYPE("resourceType"), CATEGORY("category"), SUBCATEGORY("subCategory");
+
+	private String value;
+
+	private SearchCriteriaEnum(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+		return value;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java
new file mode 100644
index 0000000..4cfcc8a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum ServiceApiArtifactEnum {
+	CONFIGURATION("Configuration".toLowerCase()), INSTANTIATION("Instantiation".toLowerCase()), MONITORING("Monitoring".toLowerCase()), REPORTING("Reporting".toLowerCase()), LOGGING("Logging".toLowerCase()), TESTING("Testing".toLowerCase());
+
+	String logicalName;
+
+	private ServiceApiArtifactEnum(String logicalName) {
+		this.logicalName = logicalName;
+	}
+
+	public String getLogicalName() {
+		return logicalName;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
new file mode 100644
index 0000000..61d4e48
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum ServiceCategoriesEnum {
+
+	VOIP("VoIP Call Control"), MOBILITY("Mobility"), NETWORK_L4("Network L4+"), NETWORK_L3("Network L1-3");
+	String value;
+
+	private ServiceCategoriesEnum(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+
+		return value;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java
new file mode 100644
index 0000000..b8635b3
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum ToscaKeysEnum {
+
+	TOSCA_DEFINITION_VERSION("tosca_definitions_version"), METADATA("metadata"), IMPORTS("imports"), NODE_TYPES("node_types"), TOPOLOGY_TEMPLATE("topology_template");
+
+	private String toscaKey;
+
+	public String getToscaKey() {
+		return toscaKey;
+	}
+
+	private ToscaKeysEnum(String toscaKey) {
+		this.toscaKey = toscaKey;
+	}
+
+	public static ToscaKeysEnum findToscaKey(final String toscaKey) {
+		for (ToscaKeysEnum toscaKeyEnum : ToscaKeysEnum.values()) {
+			if (toscaKeyEnum.getToscaKey().equalsIgnoreCase(toscaKey)) {
+				return toscaKeyEnum;
+			}
+		}
+		return null;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java
new file mode 100644
index 0000000..fb04f6a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum UserRoleEnum {
+
+	ADMIN("jh0003", "Jimmy", "Hendrix"), DESIGNER("cs0008", "Carlos", "Santana"), DESIGNER2("me0009", "Melissa","Etheridge"), TESTER("jm0007", "Joni", "Mitchell"), ADMIN4("km2000", "Kot", "May"), 
+	GOVERNOR("gv0001","David", "Shadmi"), OPS("op0001", "Steve", "Regev"), PRODUCT_STRATEGIST1("ps0001", "Eden","Rozin"), PRODUCT_STRATEGIST2("ps0002", "Ella", "Kvetny"), PRODUCT_STRATEGIST3("ps0003", "Geva", "Alon"), 
+	PRODUCT_MANAGER1("pm0001", "Teddy", "Isashar"), PRODUCT_MANAGER2("pm0002", "Sarah", "Bettens");
+	private String userId;
+	private String firstName;
+	private String lastName;
+	private String userName;
+
+	private UserRoleEnum(String userId, String userName) {
+		this.userId = userId;
+		this.userName = userName;
+	}
+
+	private UserRoleEnum(String userId, String firstName, String lastName) {
+		this.userId = userId;
+		this.firstName = firstName;
+		this.lastName = lastName;
+		this.userName = firstName + " " + lastName;
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java
new file mode 100644
index 0000000..344f353
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java
@@ -0,0 +1,166 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedArtifactAudit {
+
+	private String action;
+	private String resourceName;
+	private String resourceType;
+	private String prevVersion;
+	private String currVersion;
+	private String modifier;
+	private String prevState;
+	private String currState;
+	private String prevArtifactUuid;
+	private String currArtifactUuid;
+	private String artifactData;
+	private String status;
+	private String desc;
+
+	public ExpectedArtifactAudit(String action, String resourceName, String resourceType, String prevVersion,
+			String currVersion, String modifier, String prevState, String currState, String prevArtifactUuid,
+			String currArtifactUuid, String artifactData, String status, String desc) {
+		super();
+		this.action = action;
+		this.resourceName = resourceName;
+		this.resourceType = resourceType;
+		this.prevVersion = prevVersion;
+		this.currVersion = currVersion;
+		this.modifier = modifier;
+		this.prevState = prevState;
+		this.currState = currState;
+		this.prevArtifactUuid = prevArtifactUuid;
+		this.currArtifactUuid = currArtifactUuid;
+		this.artifactData = artifactData;
+		this.status = status;
+		this.desc = desc;
+	}
+
+	public ExpectedArtifactAudit() {
+		super();
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+
+	public void setResourceName(String resourceName) {
+		this.resourceName = resourceName;
+	}
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+
+	public String getPrevVersion() {
+		return prevVersion;
+	}
+
+	public void setPrevVersion(String prevVersion) {
+		this.prevVersion = prevVersion;
+	}
+
+	public String getCurrVersion() {
+		return currVersion;
+	}
+
+	public void setCurrVersion(String currVersion) {
+		this.currVersion = currVersion;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getPrevState() {
+		return prevState;
+	}
+
+	public void setPrevState(String prevState) {
+		this.prevState = prevState;
+	}
+
+	public String getCurrState() {
+		return currState;
+	}
+
+	public void setCurrState(String currState) {
+		this.currState = currState;
+	}
+
+	public String getPrevArtifactUuid() {
+		return prevArtifactUuid;
+	}
+
+	public void setPrevArtifactUuid(String prevArtifactUuid) {
+		this.prevArtifactUuid = prevArtifactUuid;
+	}
+
+	public String getCurrArtifactUuid() {
+		return currArtifactUuid;
+	}
+
+	public void setCurrArtifactUuid(String currArtifactUuid) {
+		this.currArtifactUuid = currArtifactUuid;
+	}
+
+	public String getArtifactData() {
+		return artifactData;
+	}
+
+	public void setArtifactData(String artifactData) {
+		this.artifactData = artifactData;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java
new file mode 100644
index 0000000..0d6a5f3
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedAuthenticationAudit {
+
+	private String url;
+	private String realm;
+	private String user;
+	private String action;
+	private String authStatus;
+
+	public ExpectedAuthenticationAudit(String url, String user, String action, String authStatus) {
+		super();
+		this.url = url;
+		this.user = user;
+		this.action = action;
+		this.authStatus = authStatus;
+		this.realm = "ASDC";
+	}
+
+	public ExpectedAuthenticationAudit() {
+
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public String getRealm() {
+		return realm;
+	}
+
+	public void setRealm(String realm) {
+		this.realm = realm;
+	}
+
+	public String getUser() {
+		return user;
+	}
+
+	public void setUser(String user) {
+		this.user = user;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getAuthStatus() {
+		return authStatus;
+	}
+
+	public void setAuthStatus(String authStatus) {
+		this.authStatus = authStatus;
+	}
+
+	@Override
+	public String toString() {
+		return "ExpectedAuthenticationAudit [url=" + url + ", realm=" + realm + ", user=" + user + ", action=" + action
+				+ ", authStatus=" + authStatus + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java
new file mode 100644
index 0000000..b11f7f5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedCategoryAudit {
+	String action;
+	String modifier;
+	String modifierUid;
+	String modifierName;
+	String categoryName;
+	String subCategoryName;
+	String groupingName;
+	String resourceType;
+	String status;
+	String desc;
+	String details;
+
+	public ExpectedCategoryAudit(String action, String modifier, String categoryName, String subCategoryName,
+			String groupingName, String resourceType, String status, String desc) {
+		super();
+		this.action = action;
+		this.modifier = modifier;
+		this.categoryName = categoryName;
+		this.subCategoryName = subCategoryName;
+		this.groupingName = groupingName;
+		this.resourceType = resourceType;
+		this.status = status;
+		this.desc = desc;
+	}
+
+	public ExpectedCategoryAudit() {
+		action = null;
+		modifier = null;
+		categoryName = null;
+		subCategoryName = null;
+		groupingName = null;
+		resourceType = null;
+		status = null;
+		desc = null;
+		details = null;
+		modifierName = null;
+		modifierUid = null;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getCategoryName() {
+		return categoryName;
+	}
+
+	public void setCategoryName(String categoryName) {
+		this.categoryName = categoryName;
+	}
+
+	public String getSubCategoryName() {
+		return subCategoryName;
+	}
+
+	public void setSubCategoryName(String subCategoryName) {
+		this.subCategoryName = subCategoryName;
+	}
+
+	public String getGroupingName() {
+		return groupingName;
+	}
+
+	public void setGroupingName(String groupingName) {
+		this.groupingName = groupingName;
+	}
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	public String getDetails() {
+		return details;
+	}
+
+	public void setDetails(String details) {
+		this.details = details;
+	}
+
+	public String getModifierUid() {
+		return modifierUid;
+	}
+
+	public void setModifierUid(String modifierUid) {
+		this.modifierUid = modifierUid;
+	}
+
+	public String getModifierName() {
+		return modifierName;
+	}
+
+	public void setModifierName(String modifierName) {
+		this.modifierName = modifierName;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java
new file mode 100644
index 0000000..4b135f6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedDistDownloadAudit {
+
+	String action;
+	String consumerId;
+	String resourceUrl;
+	String status;
+	String desc;
+
+	public ExpectedDistDownloadAudit(String action, String consumerId, String resourceUrl, String status, String desc) {
+		super();
+		this.action = action;
+		this.consumerId = consumerId;
+		this.resourceUrl = resourceUrl;
+		this.status = status;
+		this.desc = desc;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getConsumerId() {
+		return consumerId;
+	}
+
+	public void setConsumerId(String consumerId) {
+		this.consumerId = consumerId;
+	}
+
+	public String getResourceUrl() {
+		return resourceUrl;
+	}
+
+	public void setResourceUrl(String resourceUrl) {
+		this.resourceUrl = resourceUrl;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java
new file mode 100644
index 0000000..1414742
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedEcomConsumerAudit {
+
+	String action;
+	String modifier;
+	String ecomUser;
+	String status;
+	String desc;
+
+	public ExpectedEcomConsumerAudit(String action, String modifier, String ecomUser, String status, String desc) {
+		super();
+		this.action = action;
+		this.modifier = modifier;
+		this.ecomUser = ecomUser;
+		this.status = status;
+		this.desc = desc;
+	}
+
+	public ExpectedEcomConsumerAudit() {
+		action = null;
+		modifier = null;
+		ecomUser = null;
+		status = null;
+		desc = null;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getEcomUser() {
+		return ecomUser;
+	}
+
+	public void setEcomUser(String ecomUser) {
+		this.ecomUser = ecomUser;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java
new file mode 100644
index 0000000..e689a39
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java
@@ -0,0 +1,179 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedExternalAudit {
+
+	String ACTION;
+	String CONSUMER_ID;
+	String RESOURCE_URL;
+	String STATUS;
+	String DESC;
+	String RESOURCE_NAME;
+	String RESOURCE_TYPE;
+	String SERVICE_INSTANCE_ID;// resource/ service UUID
+	String MODIFIER;
+	String PREV_ARTIFACT_UUID;
+	String CURR_ARTIFACT_UUID;
+	String ARTIFACT_DATA;
+
+	public ExpectedExternalAudit() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public String getRESOURCE_NAME() {
+		return RESOURCE_NAME;
+	}
+
+	public void setRESOURCE_NAME(String rESOURCE_NAME) {
+		RESOURCE_NAME = rESOURCE_NAME;
+	}
+
+	public String getRESOURCE_TYPE() {
+		return RESOURCE_TYPE;
+	}
+
+	public void setRESOURCE_TYPE(String rESOURCE_TYPE) {
+		RESOURCE_TYPE = rESOURCE_TYPE;
+	}
+
+	public String getSERVICE_INSTANCE_ID() {
+		return SERVICE_INSTANCE_ID;
+	}
+
+	public void setSERVICE_INSTANCE_ID(String sERVICE_INSTANCE_ID) {
+		SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
+	}
+
+	public ExpectedExternalAudit(String aCTION, String cONSUMER_ID, String rESOURCE_URL, String sTATUS, String dESC,
+			String rESOURCE_NAME, String rESOURCE_TYPE, String sERVICE_INSTANCE_ID) {
+		super();
+		ACTION = aCTION;
+		CONSUMER_ID = cONSUMER_ID;
+		RESOURCE_URL = rESOURCE_URL;
+		STATUS = sTATUS;
+		DESC = dESC;
+		RESOURCE_NAME = rESOURCE_NAME;
+		RESOURCE_TYPE = rESOURCE_TYPE;
+		SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
+	}
+
+	public ExpectedExternalAudit(String aCTION, String cONSUMER_ID, String rESOURCE_URL, String sTATUS, String dESC) {
+		super();
+		ACTION = aCTION;
+		CONSUMER_ID = cONSUMER_ID;
+		RESOURCE_URL = rESOURCE_URL;
+		STATUS = sTATUS;
+		DESC = dESC;
+	}
+
+	public ExpectedExternalAudit(String aCTION, String cONSUMER_ID, String rESOURCE_URL, String sTATUS, String dESC,
+			String rESOURCE_NAME, String rESOURCE_TYPE, String sERVICE_INSTANCE_ID, String mODIFIER,
+			String pREV_ARTIFACT_UUID, String cURR_ARTIFACT_UUID, String aRTIFACT_DATA) {
+		super();
+		ACTION = aCTION;
+		CONSUMER_ID = cONSUMER_ID;
+		RESOURCE_URL = rESOURCE_URL;
+		STATUS = sTATUS;
+		DESC = dESC;
+		RESOURCE_NAME = rESOURCE_NAME;
+		RESOURCE_TYPE = rESOURCE_TYPE;
+		SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
+		MODIFIER = mODIFIER;
+		PREV_ARTIFACT_UUID = pREV_ARTIFACT_UUID;
+		CURR_ARTIFACT_UUID = cURR_ARTIFACT_UUID;
+		ARTIFACT_DATA = aRTIFACT_DATA;
+	}
+
+	public String getACTION() {
+		return ACTION;
+	}
+
+	public void setACTION(String aCTION) {
+		ACTION = aCTION;
+	}
+
+	public String getCONSUMER_ID() {
+		return CONSUMER_ID;
+	}
+
+	public void setCONSUMER_ID(String cONSUMER_ID) {
+		CONSUMER_ID = cONSUMER_ID;
+	}
+
+	public String getRESOURCE_URL() {
+		return RESOURCE_URL;
+	}
+
+	public void setRESOURCE_URL(String rESOURCE_URL) {
+		RESOURCE_URL = rESOURCE_URL;
+	}
+
+	public String getSTATUS() {
+		return STATUS;
+	}
+
+	public void setSTATUS(String sTATUS) {
+		STATUS = sTATUS;
+	}
+
+	public String getDESC() {
+		return DESC;
+	}
+
+	public void setDESC(String dESC) {
+		DESC = dESC;
+	}
+
+	public String getMODIFIER() {
+		return MODIFIER;
+	}
+
+	public void setMODIFIER(String mODIFIER) {
+		MODIFIER = mODIFIER;
+	}
+
+	public String getPREV_ARTIFACT_UUID() {
+		return PREV_ARTIFACT_UUID;
+	}
+
+	public void setPREV_ARTIFACT_UUID(String pREV_ARTIFACT_UUID) {
+		PREV_ARTIFACT_UUID = pREV_ARTIFACT_UUID;
+	}
+
+	public String getCURR_ARTIFACT_UUID() {
+		return CURR_ARTIFACT_UUID;
+	}
+
+	public void setCURR_ARTIFACT_UUID(String cURR_ARTIFACT_UUID) {
+		CURR_ARTIFACT_UUID = cURR_ARTIFACT_UUID;
+	}
+
+	public String getARTIFACT_DATA() {
+		return ARTIFACT_DATA;
+	}
+
+	public void setARTIFACT_DATA(String aRTIFACT_DATA) {
+		ARTIFACT_DATA = aRTIFACT_DATA;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java
new file mode 100644
index 0000000..561b92a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedGetUserListAudit {
+
+	String action;
+	String modifier;
+	String status;
+	String desc;
+	String details;
+
+	public ExpectedGetUserListAudit(String action, String modifier, String status, String desc, String details) {
+		super();
+		this.action = action;
+		this.modifier = modifier;
+		this.status = status;
+		this.desc = desc;
+		this.details = details;
+	}
+
+	public ExpectedGetUserListAudit() {
+		action = null;
+		modifier = null;
+		details = null;
+		status = null;
+		desc = null;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	public String getDetails() {
+		return details;
+	}
+
+	public void setDetails(String details) {
+		this.details = details;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java
new file mode 100644
index 0000000..b481cb7
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java
@@ -0,0 +1,121 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedGroupingAudit {
+	String action;
+	String modifier;
+	String categoryName;
+	String subCategoryName;
+	String groupingName;
+	String resourceType;
+	String status;
+	String desc;
+
+	public ExpectedGroupingAudit(String action, String modifier, String categoryName, String subCategoryName,
+			String groupingName, String resourceType, String status, String desc) {
+		super();
+		this.action = action;
+		this.modifier = modifier;
+		this.categoryName = categoryName;
+		this.subCategoryName = subCategoryName;
+		this.groupingName = groupingName;
+		this.resourceType = resourceType;
+		this.status = status;
+		this.desc = desc;
+	}
+
+	public ExpectedGroupingAudit() {
+		action = null;
+		modifier = null;
+		categoryName = null;
+		subCategoryName = null;
+		groupingName = null;
+		resourceType = null;
+		status = null;
+		desc = null;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getCategoryName() {
+		return categoryName;
+	}
+
+	public void setCategoryName(String categoryName) {
+		this.categoryName = categoryName;
+	}
+
+	public String getSubCategoryName() {
+		return subCategoryName;
+	}
+
+	public void setSubCategoryName(String subCategoryName) {
+		this.subCategoryName = subCategoryName;
+	}
+
+	public String getGroupingName() {
+		return groupingName;
+	}
+
+	public void setGroupingName(String groupingName) {
+		this.groupingName = groupingName;
+	}
+
+	public String getResourceType() {
+		return resourceType;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java
new file mode 100644
index 0000000..40b86fa
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java
@@ -0,0 +1,142 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedProductAudit {
+
+	String ACTION;
+	String MODIFIER;
+	String STATUS;
+	String DESC;
+	String RESOURCE_NAME;
+	String RESOURCE_TYPE;
+	String PREV_VERSION;
+	String CURR_VERSION;
+	String PREV_STATE;
+	String CURR_STATE;
+	String TIMESTAMP;
+	String SERVICE_INSTANCE_ID;
+	String COMMENT;
+
+	public String getCOMMENT() {
+		return COMMENT;
+	}
+
+	public void setCOMMENT(String cOMMENT) {
+		COMMENT = cOMMENT;
+	}
+
+	public String getSERVICE_INSTANCE_ID() {
+		return SERVICE_INSTANCE_ID;
+	}
+
+	public void setSERVICE_INSTANCE_ID(String sERVICE_INSTANCE_ID) {
+		SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
+	}
+
+	public String getACTION() {
+		return ACTION;
+	}
+
+	public void setACTION(String aCTION) {
+		ACTION = aCTION;
+	}
+
+	public String getMODIFIER() {
+		return MODIFIER;
+	}
+
+	public void setMODIFIER(String mODIFIER) {
+		MODIFIER = mODIFIER;
+	}
+
+	public String getSTATUS() {
+		return STATUS;
+	}
+
+	public void setSTATUS(String sTATUS) {
+		STATUS = sTATUS;
+	}
+
+	public String getDESC() {
+		return DESC;
+	}
+
+	public void setDESC(String dESC) {
+		DESC = dESC;
+	}
+
+	public String getRESOURCE_NAME() {
+		return RESOURCE_NAME;
+	}
+
+	public void setRESOURCE_NAME(String rESOURCE_NAME) {
+		RESOURCE_NAME = rESOURCE_NAME;
+	}
+
+	public String getRESOURCE_TYPE() {
+		return RESOURCE_TYPE;
+	}
+
+	public void setRESOURCE_TYPE(String rESOURCE_TYPE) {
+		RESOURCE_TYPE = rESOURCE_TYPE;
+	}
+
+	public String getPREV_VERSION() {
+		return PREV_VERSION;
+	}
+
+	public void setPREV_VERSION(String pREV_VERSION) {
+		PREV_VERSION = pREV_VERSION;
+	}
+
+	public String getCURR_VERSION() {
+		return CURR_VERSION;
+	}
+
+	public void setCURR_VERSION(String cURR_VERSION) {
+		CURR_VERSION = cURR_VERSION;
+	}
+
+	public String getPREV_STATE() {
+		return PREV_STATE;
+	}
+
+	public void setPREV_STATE(String pREV_STATE) {
+		PREV_STATE = pREV_STATE;
+	}
+
+	public String getCURR_STATE() {
+		return CURR_STATE;
+	}
+
+	public void setCURR_STATE(String cURR_STATE) {
+		CURR_STATE = cURR_STATE;
+	}
+
+	public String getTIMESTAMP() {
+		return TIMESTAMP;
+	}
+
+	public void setTIMESTAMP(String tIMESTAMP) {
+		TIMESTAMP = tIMESTAMP;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java
new file mode 100644
index 0000000..7fdc899
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java
@@ -0,0 +1,311 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedResourceAuditJavaObject {
+
+	String ACTION;
+	String MODIFIER_NAME;
+	String MODIFIER_UID;
+	String STATUS;
+	String DESC;
+	String RESOURCE_NAME;
+	String RESOURCE_TYPE;
+	String PREV_VERSION;
+	String CURR_VERSION;
+	String PREV_STATE;
+	String CURR_STATE;
+	String TIMESTAMP;
+	String ARTIFACT_DATA;
+	String DPREV_STATUS;
+	String DCURR_STATUS;
+	String COMMENT;
+	String DID;
+	String TOPIC_NAME;
+	String TOSCA_NODE_TYPE;
+	String CURR_ARTIFACT_UUID;
+	String PREV_ARTIFACT_UUID;
+	String ARTIFACT_TIMEOUT;
+	String MODIFIER;
+	String SERVICE_INSTANCE_ID;
+	String CONSUMER_ID;
+	String RESOURCE_URL;
+	
+	// TODO: Remove comment
+//	String INVARIANT_UUID;
+//	
+//	public String getINVARIANT_UUID() {
+//		return INVARIANT_UUID;
+//	}
+//	
+//	public void setINVARIANT_UUID(String invariant_uuid) {
+//		INVARIANT_UUID = invariant_uuid;
+//	}
+
+	public String getCONSUMER_ID() {
+		return CONSUMER_ID;
+	}
+
+	public void setCONSUMER_ID(String consumer_id) {
+		CONSUMER_ID = consumer_id;
+	}
+
+	public String getRESOURCE_URL() {
+		return RESOURCE_URL;
+	}
+
+	public void setRESOURCE_URL(String resource_url) {
+		RESOURCE_URL = resource_url;
+	}
+
+	public String getSERVICE_INSTANCE_ID() {
+		return SERVICE_INSTANCE_ID;
+	}
+
+	public void setSERVICE_INSTANCE_ID(String sERVICE_INSTANCE_ID) {
+		SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
+	}
+
+	public String getMODIFIER() {
+		return MODIFIER;
+	}
+
+	public void setMODIFIER(String mODIFIER) {
+		MODIFIER = mODIFIER;
+	}
+
+	public String getArtifactTimeout() {
+		return ARTIFACT_TIMEOUT;
+	}
+
+	public void setArtifactTimeout(String artifactTimeout) {
+		this.ARTIFACT_TIMEOUT = artifactTimeout;
+	}
+
+	public String getCurrArtifactUuid() {
+		return CURR_ARTIFACT_UUID;
+	}
+
+	public void setCurrArtifactUuid(String currArtifactUuid) {
+		this.CURR_ARTIFACT_UUID = currArtifactUuid;
+	}
+
+	public String getPrevArtifactUuid() {
+		return PREV_ARTIFACT_UUID;
+	}
+
+	public void setPrevArtifactUuid(String prevArtifactUuid) {
+		this.PREV_ARTIFACT_UUID = prevArtifactUuid;
+	}
+
+	public String getToscaNodeType() {
+		return TOSCA_NODE_TYPE;
+	}
+
+	public void setToscaNodeType(String ToscaNodeType) {
+		this.TOSCA_NODE_TYPE = ToscaNodeType;
+	}
+
+	public String getTopicName() {
+		return TOPIC_NAME;
+	}
+
+	public void setTopicName(String topicName) {
+		this.TOPIC_NAME = topicName;
+	}
+
+	public String getDistributionId() {
+		return DID;
+	}
+
+	public void setDistributionId(String did) {
+		this.DID = did;
+	}
+
+	public ExpectedResourceAuditJavaObject() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ExpectedResourceAuditJavaObject(String action, String modifierName, String modifierUid, String status,
+			String desc, String resourceName, String resourceType, String prevVersion, String currVersion,
+			String prevState, String currState, String timestamp, String toscaNodesType, String timeout,
+			String modifier, String serviceInstanceId) {
+		super();
+		this.ACTION = action;
+		this.MODIFIER_NAME = modifierName;
+		this.MODIFIER_UID = modifierUid;
+		this.STATUS = status;
+		this.DESC = desc;
+		this.RESOURCE_NAME = resourceName;
+		this.RESOURCE_TYPE = resourceType;
+		this.PREV_VERSION = prevVersion;
+		this.CURR_VERSION = currVersion;
+		this.PREV_STATE = prevState;
+		this.CURR_STATE = currState;
+		this.TIMESTAMP = timestamp;
+		this.TOSCA_NODE_TYPE = toscaNodesType;
+		this.ARTIFACT_TIMEOUT = timeout;
+		this.MODIFIER = modifier;
+		this.SERVICE_INSTANCE_ID = serviceInstanceId;
+	}
+
+	public String getAction() {
+		return ACTION;
+	}
+
+	public void setAction(String action) {
+		this.ACTION = action;
+	}
+
+	public String getModifierName() {
+		return MODIFIER_NAME;
+	}
+
+	public void setModifierName(String modifierName) {
+		this.MODIFIER_NAME = modifierName;
+	}
+
+	public String getModifierUid() {
+		return MODIFIER_UID;
+	}
+
+	public void setModifierUid(String modifierUid) {
+		this.MODIFIER_UID = modifierUid;
+	}
+
+	public String getStatus() {
+		return STATUS;
+	}
+
+	public void setStatus(String status) {
+		this.STATUS = status;
+	}
+
+	public String getDesc() {
+		return DESC;
+	}
+
+	public void setDesc(String desc) {
+		this.DESC = desc;
+	}
+
+	public String getResourceName() {
+		return RESOURCE_NAME;
+	}
+
+	public void setResourceName(String resourceName) {
+		this.RESOURCE_NAME = resourceName;
+	}
+
+	public String getResourceType() {
+		return RESOURCE_TYPE;
+	}
+
+	public void setResourceType(String resourceType) {
+		this.RESOURCE_TYPE = resourceType;
+	}
+
+	public String getPrevVersion() {
+		return PREV_VERSION;
+	}
+
+	public void setPrevVersion(String prevVersion) {
+		this.PREV_VERSION = prevVersion;
+	}
+
+	public String getCurrVersion() {
+		return CURR_VERSION;
+	}
+
+	public void setCurrVersion(String currVersion) {
+		this.CURR_VERSION = currVersion;
+	}
+
+	public String getPrevState() {
+		return PREV_STATE;
+	}
+
+	public void setPrevState(String prevState) {
+		this.PREV_STATE = prevState;
+	}
+
+	public String getCurrState() {
+		return CURR_STATE;
+	}
+
+	public void setCurrState(String currState) {
+		this.CURR_STATE = currState;
+	}
+
+	public String getTimestamp() {
+		return TIMESTAMP;
+	}
+
+	public void setTimestamp(String timestamp) {
+		this.TIMESTAMP = timestamp;
+	}
+
+	public String getArtifactData() {
+		return ARTIFACT_DATA;
+	}
+
+	public void setArtifactData(String artifactData) {
+		this.ARTIFACT_DATA = artifactData;
+	}
+
+	public String getDprevStatus() {
+		return DPREV_STATUS;
+	}
+
+	public void setDprevStatus(String dprevStatus) {
+		this.DPREV_STATUS = dprevStatus;
+	}
+
+	public String getDcurrStatus() {
+		return DCURR_STATUS;
+	}
+
+	public void setDcurrStatus(String dcurrStatus) {
+		this.DCURR_STATUS = dcurrStatus;
+	}
+
+	public String getComment() {
+		return COMMENT;
+	}
+
+	public void setComment(String comment) {
+		this.COMMENT = comment;
+	}
+
+	@Override
+	public String toString() {
+		return "ExpectedResourceAuditJavaObject [ACTION=" + ACTION + ", STATUS=" + STATUS + ", DESC=" + DESC
+				+ ", RESOURCE_NAME=" + RESOURCE_NAME + ", RESOURCE_TYPE=" + RESOURCE_TYPE + ", PREV_VERSION="
+				+ PREV_VERSION + ", CURR_VERSION=" + CURR_VERSION + ", PREV_STATE=" + PREV_STATE + ", CURR_STATE="
+				+ CURR_STATE + ", TIMESTAMP=" + TIMESTAMP + ", ARTIFACT_DATA=" + ARTIFACT_DATA + ", DPREV_STATUS="
+				+ DPREV_STATUS + ", DCURR_STATUS=" + DCURR_STATUS + ", COMMENT=" + COMMENT + ", DID=" + DID
+				+ ", TOPIC_NAME=" + TOPIC_NAME + ", TOSCA_NODE_TYPE=" + TOSCA_NODE_TYPE + ", CURR_ARTIFACT_UUID="
+				+ CURR_ARTIFACT_UUID + ", PREV_ARTIFACT_UUID=" + PREV_ARTIFACT_UUID + ", ARTIFACT_TIMEOUT="
+				+ ARTIFACT_TIMEOUT + ", MODIFIER=" + MODIFIER + ", SERVICE_INSTANCE_ID=" + SERVICE_INSTANCE_ID + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java
new file mode 100644
index 0000000..2bc8625
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.expected;
+
+public class ExpectedUserCRUDAudit {
+	String action;
+	String modifier;
+	String status;
+	String desc;
+	String userBefore;
+	String userAfter;
+
+	public ExpectedUserCRUDAudit(String action, String modifier, String status, String desc, String userBefore,
+			String userAfter) {
+		super();
+		this.action = action;
+		this.modifier = modifier;
+		this.status = status;
+		this.desc = desc;
+		this.userBefore = userBefore;
+		this.userAfter = userAfter;
+	}
+
+	public ExpectedUserCRUDAudit() {
+		action = null;
+		modifier = null;
+		userBefore = null;
+		userAfter = null;
+		status = null;
+		desc = null;
+	}
+
+	public String getAction() {
+		return action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	public String getUserBefore() {
+		return userBefore;
+	}
+
+	public void setUserBefore(String userBefore) {
+		this.userBefore = userBefore;
+	}
+
+	public String getUserAfter() {
+		return userAfter;
+	}
+
+	public void setUserAfter(String userAfter) {
+		this.userAfter = userAfter;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java
new file mode 100644
index 0000000..2c23b08
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.http;
+
+public class HeaderData {
+	String contentMd5;
+	String contentType;
+	String HttpCspUserId;
+	String HttpCspFirstName;
+	String HttpCspLastName;
+	String HttpCspWsType;
+	String HttpIvRemoteAddress;
+	String HttpIvUser;
+
+	public HeaderData() {
+		super();
+	}
+
+	public HeaderData(String contentMd5, String contentType, String httpCspUserId, String httpCspFirstName,
+			String httpCspLastName, String httpCspWsType, String httpIvRemoteAddress, String httpIvUser) {
+		super();
+		this.contentMd5 = contentMd5;
+		this.contentType = contentType;
+		HttpCspUserId = httpCspUserId;
+		HttpCspFirstName = httpCspFirstName;
+		HttpCspLastName = httpCspLastName;
+		HttpCspWsType = httpCspWsType;
+		HttpIvRemoteAddress = httpIvRemoteAddress;
+		HttpIvUser = httpIvUser;
+	}
+
+	public String getContentMd5() {
+		return contentMd5;
+	}
+
+	public void setContentMd5(String contentMd5) {
+		this.contentMd5 = contentMd5;
+	}
+
+	public String getContentType() {
+		return contentType;
+	}
+
+	public void setContentType(String contentType) {
+		this.contentType = contentType;
+	}
+
+	public String getHttpCspUserId() {
+		return HttpCspUserId;
+	}
+
+	public void setHttpCspUserId(String httpCspUserId) {
+		HttpCspUserId = httpCspUserId;
+	}
+
+	public String getHttpCspFirstName() {
+		return HttpCspFirstName;
+	}
+
+	public void setHttpCspFirstName(String httpCspFirstName) {
+		HttpCspFirstName = httpCspFirstName;
+	}
+
+	public String getHttpCspLastName() {
+		return HttpCspLastName;
+	}
+
+	public void setHttpCspLastName(String httpCspLastName) {
+		HttpCspLastName = httpCspLastName;
+	}
+
+	public String getHttpCspWsType() {
+		return HttpCspWsType;
+	}
+
+	public void setHttpCspWsType(String httpCspWsType) {
+		HttpCspWsType = httpCspWsType;
+	}
+
+	public String getHttpIvRemoteAddress() {
+		return HttpIvRemoteAddress;
+	}
+
+	public void setHttpIvRemoteAddress(String httpIvRemoteAddress) {
+		HttpIvRemoteAddress = httpIvRemoteAddress;
+	}
+
+	public String getHttpIvUser() {
+		return HttpIvUser;
+	}
+
+	public void setHttpIvUser(String httpIvUser) {
+		HttpIvUser = httpIvUser;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java
new file mode 100644
index 0000000..4a2ad9a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.http;
+
+public enum HeaderValue {
+
+	APPLICATION_JSON("application/json");
+
+	String value;
+
+	private HeaderValue(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+
+		return value;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java
new file mode 100644
index 0000000..cd3beee
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.http;
+
+public enum HttpHeaderEnum {
+
+	Content_MD5("Content-MD5"), 
+	USER_ID("USER_ID"), 
+	HTTP_CSP_FIRSTNAME("HTTP_CSP_FIRSTNAME"), 
+	HTTP_CSP_LASTNAME("HTTP_CSP_LASTNAME"), 
+	HTTP_CSP_WSTYPE("HTTP_CSP_WSTYPE"), 
+	HTTP_IV_REMOTE_ADDRESS("HTTP_IV_REMOTE_ADDRESS"), 
+	HTTP_IV_USER("HTTP_IV_USER"), 
+	HTTP_CSP_EMAIL("HTTP_CSP_EMAIL"), 
+	CONTENT_TYPE("Content-Type"), 
+	ACCEPT("Accept"), 
+	X_ECOMP_REQUEST_ID_HEADER("X-ECOMP-RequestID"), 
+	CACHE_CONTROL("Cache-Control"), 
+	X_ECOMP_INSTANCE_ID("X-ECOMP-InstanceID"), 
+	AUTHORIZATION("Authorization"), 
+	CONTENT_LENGTH("Content-Length"), 
+	CONTENT_DISPOSITION("Content-Disposition"), 
+	HOST("Host"), 
+	X_ECOMP_SERVICE_ID_HEADER("X-ECOMP-ServiceID"), 
+	WWW_AUTHENTICATE("WWW-Authenticate"),
+	ECOMP_PASSWORD("password"), 
+	ECOMP_USERNAME("username");
+	
+	String value;
+
+	private HttpHeaderEnum(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+
+		return value;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java
new file mode 100644
index 0000000..c1f559a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java
@@ -0,0 +1,889 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.http;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Scanner;
+
+import javax.net.ssl.HttpsURLConnection;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
+import org.apache.http.entity.mime.content.StringBody;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+
+public class HttpRequest {
+	static Logger logger = LoggerFactory.getLogger(HttpRequest.class.getName());
+	
+	public RestResponse httpSendGet(String url, Map<String, String> headers) throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		url = url.replaceAll("\\s", "%20");
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+		// optional default is GET
+		con.setRequestMethod("GET");
+		// add request header
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+
+		}
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send GET http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+		String result;
+
+		try {
+
+			result = IOUtils.toString(con.getInputStream());
+			response.append(result);
+
+		} catch (Exception e) {			
+		}
+
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e) {
+		}
+
+		logger.debug("Response body: {}" ,response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		restResponse.setErrorCode(responseCode);
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+
+		return restResponse;
+	}
+
+	public RestResponse httpsSendGet(String url, Map<String, String> headers) throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
+		// optional default is GET
+		con.setRequestMethod("GET");
+		// add request header
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+
+		}
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send GET http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			logger.debug("response body is null");
+		}
+
+		String result;
+
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			// result = null;
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		restResponse.setErrorCode(responseCode);
+		// restResponse.setResponse(result);
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+
+		return restResponse;
+	}
+
+	public RestResponse httpSendByMethod(String url, String method, String body, Map<String, String> headers)
+			throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add request method
+		con.setRequestMethod(method);
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+
+		}
+		if (body != null && !body.isEmpty() && !method.equals("DELETE")) {
+			// Send post request
+			con.setDoOutput(true);
+			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+			wr.writeBytes(body);
+			wr.flush();
+			wr.close();
+		}
+
+		// con.connect();
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send {} http request, url: {}",method,url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			// response = null;
+			logger.debug("response body is null");
+		}
+
+		String result;
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			result = null;
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+		// if (response == null) {
+		// restResponse.setResponse(null);
+		// } else {
+		// restResponse.setResponse(response.toString());
+		// }
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+		return restResponse;
+
+	}
+
+	public RestResponse sendHttpPost(String url, String body, Map<String, String> headers) throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add request method
+		con.setRequestMethod("POST");
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+		}
+
+		// Send post request
+		if (body != null) {
+			con.setDoOutput(true);
+			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+			wr.writeBytes(body);
+			wr.flush();
+			wr.close();
+		}
+
+		// con.connect();
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send POST http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			logger.debug("response body is null");
+		}
+
+		String result;
+
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			result = null;
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+		return restResponse;
+
+	}
+
+	public RestResponse httpSendPost(String url, String body, Map<String, String> headers) throws IOException {
+		return httpSendPost(url, body, headers, "POST");
+	}
+
+	public RestResponse httpSendPut(String url, String body, Map<String, String> headers) throws IOException {
+		return httpSendPost(url, body, headers, "PUT");
+	}
+
+	public RestResponse httpSendPost(String url, String body, Map<String, String> headers, String methodType)
+			throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add request method
+		con.setRequestMethod(methodType);
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+		}
+
+		// Send post request
+		if (body != null) {
+			con.setDoOutput(true);
+			DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+			wr.writeBytes(body);
+			wr.flush();
+			wr.close();
+		}
+
+		// con.connect();
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send POST http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			logger.debug("response body is null");
+		}
+
+		String result;
+
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			result = null;
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+		return restResponse;
+
+	}
+
+	public RestResponse httpSendDeleteWithBody2(String url, String body, Map<String, String> headers)
+			throws ClientProtocolException, IOException {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		RestResponse restResponse = new RestResponse();
+		HttpDeleteWithBody httpDelete = new HttpDeleteWithBody(url);
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				httpDelete.addHeader(key, value);
+			}
+		}
+
+		// add body to request
+		StringEntity input = new StringEntity(body, ContentType.APPLICATION_JSON);
+		httpDelete.setEntity(input);
+
+		// execute request
+		CloseableHttpResponse response = httpclient.execute(httpDelete);
+
+		restResponse.setErrorCode(response.getStatusLine().getStatusCode());
+
+		return restResponse;
+	}
+
+	public RestResponse httpSendDeleteWithBody(String url, String body, Map<String, String> headers)
+			throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add request method
+		con.setRequestMethod("DELETE");
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+		}
+
+		// Send post request
+		con.setDoOutput(true);
+		DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+		wr.writeBytes(body);
+		wr.flush();
+		wr.close();
+
+		// con.connect();
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send DELETE http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			logger.debug("response body is null");
+		}
+
+		String result;
+
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			result = null;
+		}
+		logger.debug("Response body: {}", response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+		return restResponse;
+
+	}
+
+	public RestResponse httpSendPostWithOutBody(String url, Map<String, String> headers) throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add request method
+		con.setRequestMethod("POST");
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+		}
+
+		// con.connect();
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send POST http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			// response = null;
+			logger.debug("response body is null");
+		}
+
+		String result;
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			result = null;
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+		// if (response == null) {
+		// restResponse.setResponse(null);
+		// } else {
+		// restResponse.setResponse(response.toString());
+		// }
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+		return restResponse;
+
+	}
+
+	public RestResponse httpSendPostMultipart(String url, Map<String, String> headers, String jsonLocation,
+			String zipLocation) throws IOException {
+
+		Gson gson = new Gson();
+		String gsonToSend = null;
+		RestResponse restResponse = new RestResponse();
+		BufferedReader br = null;
+		//
+		//
+		//
+		//
+		// try {
+		//
+		// String sCurrentLine;
+		//
+		// br = new BufferedReader(new FileReader(jsonLocation));
+		//
+		// while ((sCurrentLine = br.readLine()) != null) {
+		// System.out.println(sCurrentLine);
+		// }
+		//
+		// } catch (IOException e) {
+		// e.printStackTrace();
+		// } finally {
+		// try {
+		// if (br != null)br.close();
+		// gsonToSend = br.toString();
+		// } catch (IOException ex) {
+		// ex.printStackTrace();
+		// }
+		// }
+
+		gsonToSend = new Scanner(new File(jsonLocation)).useDelimiter("\\Z").next();
+		logger.debug("gsonToSend: {}",gsonToSend);
+
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+		mpBuilder.addPart("resourceZip", new FileBody(new File(zipLocation)));
+		mpBuilder.addPart("resourceMetadata", new StringBody(gsonToSend, ContentType.APPLICATION_JSON));
+
+		HttpPost httpPost = new HttpPost(url);
+		httpPost.addHeader("USER_ID", "adminid");
+		httpPost.setEntity(mpBuilder.build());
+
+		CloseableHttpClient client = HttpClients.createDefault();
+		CloseableHttpResponse response = client.execute(httpPost);
+		try {
+			logger.debug("----------------------------------------");
+			logger.debug("response.getStatusLine(): {}",response.getStatusLine());
+			HttpEntity resEntity = response.getEntity();
+			if (resEntity != null) {
+				logger.debug("Response content length: {}",resEntity.getContentLength());
+			}
+			EntityUtils.consume(resEntity);
+		} finally {
+
+			response.close();
+			client.close();
+		}
+
+		restResponse.setErrorCode(response.getStatusLine().getStatusCode());
+		restResponse.setResponse(response.getEntity().toString());
+
+		return restResponse;
+
+	}
+
+	public RestResponse httpSendPostWithAuth(String url, String body, Map<String, String> headers, String username,
+			String password) throws IOException {
+
+		String userPassword = username + ":" + password;
+		String encoding = Base64.encodeBase64String(userPassword.getBytes());
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		// add request method
+		con.setRequestMethod("POST");
+
+		con.setRequestProperty("Authorization", "Basic " + encoding);
+
+		// add request headers
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+
+		}
+
+		// Send post request
+		con.setDoOutput(true);
+		DataOutputStream wr = new DataOutputStream(con.getOutputStream());
+		wr.writeBytes(body);
+		wr.flush();
+		wr.close();
+
+		// con.connect();
+
+		int responseCode = con.getResponseCode();
+		logger.debug("Send POST http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			response = null;
+
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+		if (response == null) {
+			restResponse.setResponse(null);
+		} else {
+			restResponse.setResponse(response.toString());
+		}
+
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+		return restResponse;
+
+	}
+
+	public RestResponse httpSendDelete(String url, Map<String, String> headers) throws IOException {
+
+		RestResponse restResponse = new RestResponse();
+		URL obj = new URL(url);
+		HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+		if (headers != null) {
+			for (Entry<String, String> header : headers.entrySet()) {
+				String key = header.getKey();
+				String value = header.getValue();
+				con.setRequestProperty(key, value);
+			}
+
+		}
+
+		con.setDoOutput(true);
+		con.setRequestMethod("DELETE");
+		int responseCode = con.getResponseCode();
+		logger.debug("Send DELETE http request, url: {}",url);
+		logger.debug("Response Code: {}",responseCode);
+
+		StringBuffer response = new StringBuffer();
+
+		try {
+			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+			String inputLine;
+			while ((inputLine = in.readLine()) != null) {
+				response.append(inputLine);
+			}
+			in.close();
+		} catch (Exception e) {
+			logger.debug("response body is null");
+		}
+
+		String result;
+
+		try {
+
+			result = IOUtils.toString(con.getErrorStream());
+			response.append(result);
+
+		} catch (Exception e2) {
+			result = null;
+		}
+		logger.debug("Response body: {}",response);
+
+		// print result
+
+		restResponse.setErrorCode(responseCode);
+
+		if (response != null) {
+			restResponse.setResponse(response.toString());
+		}
+
+		restResponse.setErrorCode(con.getResponseCode());
+		Map<String, List<String>> headerFields = con.getHeaderFields();
+		restResponse.setHeaderFields(headerFields);
+		String responseMessage = con.getResponseMessage();
+		restResponse.setResponseMessage(responseMessage);
+
+		con.disconnect();
+
+		return restResponse;
+	}
+
+	public static RestResponse sendHttpPostWithEntity(HttpEntity requestEntity, String url, Map<String, String> headers)
+			throws IOException, ClientProtocolException {
+		CloseableHttpResponse response = null;
+		CloseableHttpClient client = HttpClients.createDefault();
+		try {
+			HttpPost httpPost = new HttpPost(url);
+			RestResponse restResponse = new RestResponse();
+			for (Entry<String, String> entry : headers.entrySet()) {
+				httpPost.addHeader(entry.getKey(), entry.getValue());
+			}
+
+			httpPost.setEntity(requestEntity);
+			response = client.execute(httpPost);
+			HttpEntity responseEntity = response.getEntity();
+			String responseBody = null;
+			if (responseEntity != null) {
+				InputStream instream = responseEntity.getContent();
+				StringWriter writer = new StringWriter();
+				IOUtils.copy(instream, writer);
+				responseBody = writer.toString();
+				try {
+
+				} finally {
+					instream.close();
+				}
+			}
+
+			restResponse.setErrorCode(response.getStatusLine().getStatusCode());
+			restResponse.setResponse(responseBody);
+
+			return restResponse;
+
+		} finally {
+			closeResponse(response);
+			closeHttpClient(client);
+
+		}
+	}
+
+	private static void closeHttpClient(CloseableHttpClient client) {
+		try {
+			if (client != null) {
+				client.close();
+			}
+		} catch (IOException e) {
+			logger.debug("failed to close client or response: ", e);
+		}
+	}
+
+	private static void closeResponse(CloseableHttpResponse response) {
+		try {
+			if (response != null) {
+				response.close();
+			}
+		} catch (IOException e) {
+			logger.debug("failed to close client or response: ", e);
+		}
+	}
+
+	@NotThreadSafe
+	class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
+		public static final String METHOD_NAME = "DELETE";
+
+		public String getMethod() {
+			return METHOD_NAME;
+		}
+
+		public HttpDeleteWithBody(final String uri) {
+			super();
+			setURI(URI.create(uri));
+		}
+
+		public HttpDeleteWithBody(final URI uri) {
+			super();
+			setURI(uri);
+		}
+
+		public HttpDeleteWithBody() {
+			super();
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java
new file mode 100644
index 0000000..6937608
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.http;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MustHeaders {
+
+	private Map<String, String> headers = new HashMap<String, String>();
+
+	public MustHeaders(HeaderData headerData) {
+
+		super();
+		headers.put(HttpHeaderEnum.Content_MD5.getValue(), headerData.getContentMd5());
+		headers.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), headerData.getContentType());
+		headers.put(HttpHeaderEnum.ACCEPT.getValue(), headerData.getContentType());
+		headers.put(HttpHeaderEnum.USER_ID.getValue(), headerData.getHttpCspUserId());
+		headers.put(HttpHeaderEnum.HTTP_CSP_FIRSTNAME.getValue(), headerData.getHttpCspFirstName());
+		headers.put(HttpHeaderEnum.HTTP_CSP_LASTNAME.getValue(), headerData.getHttpCspLastName());
+		headers.put(HttpHeaderEnum.HTTP_CSP_WSTYPE.getValue(), headerData.getHttpCspWsType());
+		headers.put(HttpHeaderEnum.HTTP_IV_REMOTE_ADDRESS.getValue(), headerData.getHttpIvRemoteAddress());
+		headers.put(HttpHeaderEnum.HTTP_IV_USER.getValue(), headerData.getHttpIvUser());
+
+	}
+
+	public MustHeaders() {
+		super();
+	}
+
+	public Map<String, String> getMap() {
+		return headers;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java
new file mode 100644
index 0000000..f11d35a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.datatypes.http;
+
+import java.util.List;
+import java.util.Map;
+
+public class RestResponse {
+
+	Integer errorCode;
+	String response;
+	Map<String, List<String>> headerFields;
+	String responseMessage;
+
+	public RestResponse() {
+		super();
+	}
+
+	public RestResponse(Integer errorCode, String response, Map<String, List<String>> headerFields,
+			String responseMessage) {
+		super();
+		this.errorCode = errorCode;
+		this.response = response;
+		this.headerFields = headerFields;
+		this.responseMessage = responseMessage;
+	}
+
+	public Integer getErrorCode() {
+		return errorCode;
+	}
+
+	public void setErrorCode(Integer errorCode) {
+		this.errorCode = errorCode;
+	}
+
+	public String getResponse() {
+		return response;
+	}
+
+	public void setResponse(String response) {
+		this.response = response;
+	}
+
+	public Map<String, List<String>> getHeaderFields() {
+		return headerFields;
+	}
+
+	public void setHeaderFields(Map<String, List<String>> headerFields) {
+		this.headerFields = headerFields;
+	}
+
+	public String getResponseMessage() {
+		return responseMessage;
+	}
+
+	public void setResponseMessage(String responseMessage) {
+		this.responseMessage = responseMessage;
+	}
+
+	@Override
+	public String toString() {
+		return "RestResponse [errorCode=" + errorCode + ", response=" + response + ", headerFields=" + headerFields
+				+ ", responseMessage=" + responseMessage + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java
new file mode 100644
index 0000000..71e75c9
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.TODO;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+import org.testng.AssertJUnit;
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.DbUtils.TitanState;
+
+import fj.data.Either;
+
+public class ImportCapabilityTypeCITest {
+	public static final DbUtils DbUtils = new DbUtils();
+
+	@AfterClass
+	public static void afterClass() {
+		DbUtils.shutDowntitan();
+	}
+
+	static Config config = Config.instance();
+
+	// private final String IMPORT_CAPABILITY_TYPES_PATH =
+	// "src/test/resources/CI/importResourceTests/import_capabilitiesTypes/";
+
+	@Test
+	public void testAddingCapabilityTypes() throws IOException {
+		TitanState originalState = DbUtils.getCurrentTitanState();
+
+		String importResourceDir = config.getImportResourceConfigDir();
+
+		String capabilityTypes = importResourceDir + File.separator + "capabilityTypesCi.zip";
+		// importCapabilityType("src/test/resources/CI/importResource/capabilityTypesCi.zip");
+		importCapabilityType(capabilityTypes);
+		Either<Vertex, Boolean> eitherVertex = DbUtils.getVertexByUId("tosca.capabilities.Test.Ci");
+		AssertJUnit.assertTrue(eitherVertex.isLeft());
+		DbUtils.restoreToTitanState(originalState);
+		eitherVertex = DbUtils.getVertexByUId("tosca.capabilities.Test.Ci");
+		AssertJUnit.assertTrue(eitherVertex.isRight());
+	}
+
+	@Test
+	public void AddingCapabilityNotFound() throws IOException {
+		TitanState originalState = DbUtils.getCurrentTitanState();
+		String importResourceTestsDir = config.getImportResourceTestsConfigDir();
+		String capabilitiesTests = importResourceTestsDir + File.separator + "capabilityTypesCi.zip";
+		importCapabilityType(capabilitiesTests);
+		Either<Vertex, Boolean> eitherVertex = DbUtils.getVertexByUId("tosca.capabilities.NonExsitingCapability");
+		AssertJUnit.assertTrue(eitherVertex.isRight());
+		DbUtils.restoreToTitanState(originalState);
+	}
+
+	public static Integer importAllCapabilityTypes() throws IOException {
+
+		String importResourceDir = config.getImportResourceConfigDir() + File.separator + "capabilityTypes.zip";
+		// return
+		// importCapabilityType("src/test/resources/CI/importResource/capabilityTypes.zip");
+		return importCapabilityType(importResourceDir);
+	}
+
+	private static Integer importCapabilityType(String filePath) throws IOException {
+		Config config = Utils.getConfig();
+		CloseableHttpResponse response = null;
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("capabilityTypeZip", new FileBody(new File(filePath)));
+
+		String url = String.format(Urls.IMPORT_CAPABILITY_TYPE, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		CloseableHttpClient client = HttpClients.createDefault();
+		try {
+			HttpPost httpPost = new HttpPost(url);
+			httpPost.addHeader("USER_ID", "jh0003");
+			httpPost.setEntity(mpBuilder.build());
+			response = client.execute(httpPost);
+			return response.getStatusLine().getStatusCode();
+		} finally {
+			closeResponse(response);
+			closeHttpClient(client);
+
+		}
+	}
+
+	private static void closeHttpClient(CloseableHttpClient client) {
+		try {
+			if (client != null) {
+				client.close();
+			}
+		} catch (IOException e) {
+			System.out.println("failed to close client or response: " + e.getMessage());
+		}
+	}
+
+	private static void closeResponse(CloseableHttpResponse response) {
+		try {
+			if (response != null) {
+				response.close();
+			}
+		} catch (IOException e) {
+			System.out.println("failed to close client or response: " + e.getMessage());
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java
new file mode 100644
index 0000000..7e36320
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java
@@ -0,0 +1,658 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpResponseException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicResponseHandler;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.util.GeneralUtility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
+public class ArtifactServletTest extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(ArtifactServletTest.class.getName());
+	protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
+	protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+	protected Gson gson = new Gson();
+	protected JSONParser jsonParser = new JSONParser();
+	protected String serviceVersion;
+	protected Resource resourceDetailsVFCcomp;
+	protected Service defaultService1;
+
+	protected User sdncUserDetails;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ArtifactServletTest() {
+		super(name, ArtifactServletTest.class.getName());
+
+	}
+
+	@BeforeMethod
+	public void create() throws Exception {
+
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		Either<Resource, RestResponse> resourceDetailsVFCcompE = AtomicOperationUtils
+				.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.COMPUTE,
+						ResourceCategoryEnum.APPLICATION_L4_APP_SERVER, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVFCcomp = resourceDetailsVFCcompE.left().value();
+		Either<Service, RestResponse> defaultService1e = AtomicOperationUtils
+				.createDefaultService(UserRoleEnum.DESIGNER, true);
+		defaultService1 = defaultService1e.left().value();
+	}
+
+	@Test
+	public void upadteArtifactWithPayLoadToResourcseTest() throws Exception {
+
+		ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultArtifact();
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		int status = response.getErrorCode();
+		AssertJUnit.assertEquals("add informational artifact request returned status: " + response.getErrorCode(), 200,
+				status);
+
+		defaultArtifact.setDescription("kjglkh");
+		defaultArtifact.setArtifactName("install_apache.sh");
+		defaultArtifact.setArtifactType("SHELL");
+		defaultArtifact.setPayload("new payload");
+
+		response = ArtifactRestUtils.updateInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		status = response.getErrorCode();
+		AssertJUnit.assertEquals("failed to update artifact metatdata: " + response.getErrorCode(), 200, status);
+
+		response = ArtifactRestUtils.deleteInformationalArtifactFromResource(resourceDetailsVFCcomp.getUniqueId(),
+				defaultArtifact, sdncUserDetails);
+		status = response.getErrorCode();
+		AssertJUnit.assertEquals("failed to remove artifact: " + response.getErrorCode(), 200, status);
+
+	}
+
+	@Test
+	public void createAndUpdateArtifactToInterface() throws Exception {
+
+		CloseableHttpResponse response;
+		int status;
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+
+		try {
+			// upload artifact to interface
+			String interfaceName = "Standard";
+			String operationName = "configure";
+
+			String userBodyJson = createUploadArtifactBodyJson();
+			String url = String.format(Urls.UPLOAD_ARTIFACT_BY_INTERFACE_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), interfaceName, operationName);
+
+			HttpPost httpPost = createPostAddArtifactRequeast(userBodyJson, url, true);
+			response = httpclient.execute(httpPost);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, status, 200);
+
+			// get artifact uniqueId
+			String artifactId = getLifecycleArtifactUid(response);
+
+			Map<String, Object> jsonBody = new HashMap<String, Object>();
+			jsonBody.put("artifactName", "TLV_prv.ppk");
+			jsonBody.put("artifactDisplayName", "configure");
+			jsonBody.put("artifactType", "SHELL");
+			jsonBody.put("mandatory", "false");
+			String newDescription = "new something";
+			jsonBody.put("description", newDescription);
+			jsonBody.put("artifactLabel", "configure");
+			userBodyJson = gson.toJson(jsonBody);
+
+			url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), interfaceName, operationName,
+					artifactId);
+
+			httpPost = createPostAddArtifactRequeast(userBodyJson, url, false);
+
+			response = httpclient.execute(httpPost);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, 200, status);
+
+			url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+					resourceDetailsVFCcomp.getUniqueId());
+			HttpGet httpGet = createGetRequest(url);
+			response = httpclient.execute(httpGet);
+			AssertJUnit.assertTrue(response.getStatusLine().getStatusCode() == 200);
+			String responseString = new BasicResponseHandler().handleResponse(response);
+
+			JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+			responseMap = (JSONObject) responseMap.get("interfaces");
+			responseMap = (JSONObject) responseMap.get(interfaceName.toLowerCase());
+			responseMap = (JSONObject) responseMap.get("operations");
+			responseMap = (JSONObject) responseMap.get(operationName.toLowerCase());
+			responseMap = (JSONObject) responseMap.get("implementation");
+			String description = (String) responseMap.get("description");
+
+			AssertJUnit.assertEquals("the new description value was not set", newDescription, description);
+
+			// delete artifact
+			url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), interfaceName, operationName,
+					artifactId);
+			HttpDelete httpDelete = createDeleteArtifactRequest(url);
+
+			response = httpclient.execute(httpDelete);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, status, 200);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	protected String createUploadArtifactBodyJson() {
+		Map<String, Object> jsonBody = new HashMap<String, Object>();
+		jsonBody.put("artifactName", UPLOAD_ARTIFACT_NAME);
+		jsonBody.put("artifactDisplayName", "configure");
+		jsonBody.put("artifactType", "SHELL");
+		jsonBody.put("mandatory", "false");
+		jsonBody.put("description", "ff");
+		jsonBody.put("payloadData", UPLOAD_ARTIFACT_PAYLOAD);
+		jsonBody.put("artifactLabel", "configure");
+		return gson.toJson(jsonBody);
+	}
+
+	protected ArtifactDefinition getArtifactDataFromJson(String json) {
+		Gson gson = new Gson();
+		ArtifactDefinition artifact = new ArtifactDefinition();
+		artifact = gson.fromJson(json, ArtifactDefinition.class);
+
+		/*
+		 * atifact.setArtifactName(UPLOAD_ARTIFACT_NAME);
+		 * artifact.setArtifactDisplayName("configure");
+		 * artifact.setArtifactType("SHELL"); artifact.setMandatory(false);
+		 * artifact.setDescription("ff");
+		 * artifact.setPayloadData(UPLOAD_ARTIFACT_PAYLOAD);
+		 * artifact.setArtifactLabel("configure");
+		 */
+		return artifact;
+	}
+
+	protected HttpGet createGetRequest(String url) {
+		HttpGet httpGet = new HttpGet(url);
+		httpGet.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		httpGet.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		httpGet.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		return httpGet;
+	}
+
+	protected String getArtifactUid(HttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		String artifactId = (String) responseMap.get("uniqueId");
+		return artifactId;
+	}
+
+	protected String getArtifactEsId(HttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		String esId = (String) responseMap.get("EsId");
+		return esId;
+	}
+
+	protected ArtifactDefinition addArtifactDataFromResponse(HttpResponse response, ArtifactDefinition artifact)
+			throws HttpResponseException, IOException, ParseException {
+		// String responseString = new
+		// BasicResponseHandler().handleResponse(response);
+		HttpEntity entity = response.getEntity();
+		String responseString = EntityUtils.toString(entity);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		artifact.setEsId((String) responseMap.get("esId"));
+		artifact.setUniqueId((String) responseMap.get("uniqueId"));
+		artifact.setArtifactGroupType(ArtifactGroupTypeEnum.findType((String) responseMap.get("artifactGroupType")));
+		artifact.setTimeout(((Long) responseMap.get("timeout")).intValue());
+		return artifact;
+	}
+
+	protected String getLifecycleArtifactUid(CloseableHttpResponse response)
+			throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		responseMap = (JSONObject) responseMap.get("implementation");
+		String artifactId = (String) responseMap.get("uniqueId");
+		return artifactId;
+	}
+
+	protected HttpDelete createDeleteArtifactRequest(String url) {
+		HttpDelete httpDelete = new HttpDelete(url);
+		httpDelete.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		httpDelete.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		return httpDelete;
+	}
+
+	protected HttpPost createPostAddArtifactRequeast(String jsonBody, String url, boolean addMd5Header)
+			throws UnsupportedEncodingException {
+		HttpPost httppost = new HttpPost(url);
+		httppost.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		if (addMd5Header) {
+			httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody));
+		}
+		StringEntity input = new StringEntity(jsonBody);
+		input.setContentType("application/json");
+		httppost.setEntity(input);
+		log.debug("Executing request {}", httppost.getRequestLine());
+		return httppost;
+	}
+
+	protected String createLoadArtifactBody() {
+		Map<String, Object> json = new HashMap<String, Object>();
+		json.put("artifactName", "install_apache2.sh");
+		json.put("artifactType", "SHELL");
+		json.put("description", "ddd");
+		json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+		json.put("artifactLabel", "name123");
+
+		String jsonStr = gson.toJson(json);
+		return jsonStr;
+	}
+
+	protected void checkDeleteResponse(RestResponse response) {
+		BaseRestUtils.checkStatusCode(response, "delete request failed", false, 204, 404);
+	}
+
+	protected ArtifactUiDownloadData getArtifactUiDownloadData(String artifactUiDownloadDataStr) throws Exception {
+
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			ArtifactUiDownloadData artifactUiDownloadData = mapper.readValue(artifactUiDownloadDataStr,
+					ArtifactUiDownloadData.class);
+			return artifactUiDownloadData;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	// TODO
+	// @Ignore("")
+	@Test
+	public void addArtifactNoPayLoadToResourcseTest() throws Exception {
+		ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultArtifact();
+		defaultArtifact.setPayload(null);
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		int status = response.getErrorCode();
+		AssertJUnit.assertTrue(status == 400);
+
+	}
+
+	@Test
+	public void upadteArtifactNoPayLoadToResourcseTest() throws Exception {
+
+		ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultArtifact();
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		int status = response.getErrorCode();
+		AssertJUnit.assertEquals("add informational artifact request returned status: " + response.getErrorCode(), 200,
+				status);
+
+		defaultArtifact.setDescription("kjglkh");
+		defaultArtifact.setArtifactName("install_apache.sh");
+		defaultArtifact.setArtifactType("SHELL");
+		defaultArtifact.setPayload(null);
+
+		response = ArtifactRestUtils.updateInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		status = response.getErrorCode();
+		AssertJUnit.assertEquals("failed to update artifact metatdata: " + response.getErrorCode(), 200, status);
+
+		response = ArtifactRestUtils.deleteInformationalArtifactFromResource(resourceDetailsVFCcomp.getUniqueId(),
+				defaultArtifact, sdncUserDetails);
+		status = response.getErrorCode();
+		AssertJUnit.assertEquals("failed to remove artifact: " + response.getErrorCode(), 200, status);
+
+	}
+
+	// TODO
+	@Test(enabled = false)
+	public void updateDeploymentArtifactToResourcseTest() throws Exception {
+
+		ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultDeploymentArtifactForType("HEAT");
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		int status = response.getErrorCode();
+		AssertJUnit.assertEquals("add informational artifact request returned status: " + response.getErrorCode(), 200,
+				status);
+
+		response = ArtifactRestUtils.updateInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		status = response.getErrorCode();
+		AssertJUnit.assertEquals("failed to update artifact metatdata: " + response.getErrorCode(), 200, status);
+
+		response = ArtifactRestUtils.deleteInformationalArtifactFromResource(resourceDetailsVFCcomp.getUniqueId(),
+				defaultArtifact, sdncUserDetails);
+		status = response.getErrorCode();
+		AssertJUnit.assertEquals("failed to remove artifact: " + response.getErrorCode(), 200, status);
+
+	}
+
+	// --------------------
+	@Test
+	public void addArtifactToResourcse_AlreadyExistsTest() throws Exception {
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			String jsonBody = createLoadArtifactBody();
+
+			String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId());
+			HttpPost httppost = createPostAddArtifactRequeast(jsonBody, url, true);
+			CloseableHttpResponse response = httpclient.execute(httppost);
+			int status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertTrue("failed to add artifact", status == 200);
+
+			String artifactId = getArtifactUid(response);
+
+			httppost = createPostAddArtifactRequeast(jsonBody, url, true);
+			response = httpclient.execute(httppost);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("the returned status code is in correct", status, 400);
+
+			url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), artifactId);
+			HttpDelete httpDelete = createDeleteArtifactRequest(url);
+			response = httpclient.execute(httpDelete);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertTrue("failed to remove artifact", status == 200);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void addArtifactToResourcse_MissingContentTest() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			Map<String, Object> json = new HashMap<String, Object>();
+			json.put("description", "desc");
+			json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+			json.put("Content-MD5", "YTg2Mjg4MWJhNmI5NzBiNzdDFkMWI=");
+
+			String jsonBody = gson.toJson(json);
+
+			String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId());
+			HttpPost httppost = createPostAddArtifactRequeast(jsonBody, url, true);
+			CloseableHttpResponse response = httpclient.execute(httppost);
+			int status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("the returned status code is in correct", status, 400);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void addArtifactToResourcse_MissingMd5Test() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			HashMap<String, Object> json = new HashMap<String, Object>();
+			json.put("artifactName", "install_apache.sh");
+			json.put("artifactType", "SHELL");
+			json.put("description", "kjglkh");
+			json.put("payloadData", "UEsDBYTEIWUYIFHWFMABCNAoAAAAIAAeLb0bDQz");
+			json.put("artifactLabel", "name123");
+			String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId());
+			String jsonBody = gson.toJson(json);
+			HttpPost httppost = createPostAddArtifactRequeast(jsonBody, url, false);
+			CloseableHttpResponse response = httpclient.execute(httppost);
+			int status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertTrue("failed to update artifact metatdata", status == 400);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void deleteArtifact_NotExistsTest() throws Exception {
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), "someFakeId");
+			HttpDelete httpDelete = createDeleteArtifactRequest(url);
+			CloseableHttpResponse response = httpclient.execute(httpDelete);
+			int status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("the returned status code is in correct", status, 404);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void createAndRemoveArtifactToInterface() throws Exception {
+		CloseableHttpResponse response;
+		int status;
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+
+		try {
+			// upload artifact to interface
+			String interfaceName = "Standard";
+			String operationName = "configure";
+
+			String userBodyJson = createUploadArtifactBodyJson();
+			String url = String.format(Urls.UPLOAD_ARTIFACT_BY_INTERFACE_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), interfaceName, operationName);
+
+			HttpPost httpPost = createPostAddArtifactRequeast(userBodyJson, url, true);
+			response = httpclient.execute(httpPost);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, status, 200);
+
+			// get artifact uniqueId
+			String artifactId = getLifecycleArtifactUid(response);
+
+			// delete artifact
+			url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_RESOURCE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetailsVFCcomp.getUniqueId(), interfaceName, operationName,
+					artifactId);
+			HttpDelete httpDelete = createDeleteArtifactRequest(url);
+
+			response = httpclient.execute(httpDelete);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, status, 200);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void addArtifactToServiceTest() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+
+		try {
+			String jsonStr = createLoadArtifactBody();
+
+			String url = String.format(Urls.ADD_ARTIFACT_TO_SERVICE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), defaultService1.getUniqueId());
+			HttpPost httpPost = createPostAddArtifactRequeast(jsonStr, url, true);
+			CloseableHttpResponse result = httpclient.execute(httpPost);
+			int status = result.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, 200, status);
+
+			String artifactId = getArtifactUid(result);
+
+			url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), defaultService1.getUniqueId(), artifactId);
+			HttpDelete httpDelete = createDeleteArtifactRequest(url);
+
+			result = httpclient.execute(httpDelete);
+			status = result.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 200, returned :" + status, 200, status);
+		} finally {
+			RestResponse response = ServiceRestUtils.deleteService(defaultService1.getName(), serviceVersion,
+					sdncUserDetails);
+			checkDeleteResponse(response);
+			httpclient.close();
+		}
+	}
+
+	@Test
+	public void addArtifactNotSupportedTypeToServiceTest() throws Exception {
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			Map<String, Object> json = new HashMap<String, Object>();
+			json.put("artifactName", "install_apache.sh");
+			json.put("artifactType", "SHELL11");
+			json.put("description", "fff");
+			json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+			json.put("artifactLabel", "name123");
+
+			String jsonStr = gson.toJson(json);
+
+			String url = String.format(Urls.ADD_ARTIFACT_TO_SERVICE, config.getCatalogBeHost(),
+					config.getCatalogBePort(), defaultService1.getUniqueId());
+
+			HttpPost httpPost = createPostAddArtifactRequeast(jsonStr, url, true);
+			CloseableHttpResponse result = httpclient.execute(httpPost);
+			int status = result.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("response code is not 400, returned :" + status, 400, status);
+
+			ErrorInfo errorInfo = ErrorValidationUtils
+					.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
+
+			String responseString = EntityUtils.toString(result.getEntity());
+
+			JSONObject map = (JSONObject) jsonParser.parse(responseString);
+			JSONObject requestError = (JSONObject) map.get("requestError");
+			JSONObject serviceException = (JSONObject) requestError.get("serviceException");
+
+			String msgId = (String) serviceException.get("messageId");
+			AssertJUnit.assertEquals("message id did not match expacted", errorInfo.getMessageId(), msgId);
+
+			String text = (String) serviceException.get("text");
+			AssertJUnit.assertEquals("text did not match expacted", errorInfo.getMessage(), text);
+
+			JSONArray variables = (JSONArray) serviceException.get("variables");
+			String type = (String) variables.get(0);
+			AssertJUnit.assertEquals("variable did not match expacted", "SHELL11", type);
+		} finally {
+			RestResponse response = ServiceRestUtils.deleteService(defaultService1.getName(), serviceVersion,
+					sdncUserDetails);
+			checkDeleteResponse(response);
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void addArtifactToResourceTest() throws Exception {
+
+		ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultArtifact();
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails,
+				resourceDetailsVFCcomp.getUniqueId());
+		int status = response.getErrorCode();
+		AssertJUnit.assertEquals("add informational artifact request returned status: " + response.getErrorCode(), 200,
+				status);
+
+		RestResponse resourceResp = ResourceRestUtils.getResource(resourceDetailsVFCcomp.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
+		AssertJUnit.assertNotNull(resource);
+
+		Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
+		boolean isExist = false;
+		for (Map.Entry<String, ArtifactDefinition> entry : artifacts.entrySet()) {
+			if (entry.getKey().equals(defaultArtifact.getArtifactLabel())) {
+				isExist = true;
+
+			}
+		}
+		AssertJUnit.assertTrue(isExist);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/CrudArt.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/CrudArt.java
new file mode 100644
index 0000000..ff99a6b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/CrudArt.java
@@ -0,0 +1,1799 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ArtifactValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class CrudArt extends ComponentBaseTest {
+
+	private static Logger logger = LoggerFactory.getLogger(CrudArt.class.getName());
+	private static final User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+	private static final String HEAT_NET_LABEL = "heatnet";
+	private static final String HEAT_LABEL = "heat";
+
+	protected String testResourcesPath;
+	protected String testResourcesInstancesPath;
+
+	protected static final String dcaeInventoryToscaFile = "toscaSampleArtifact.yml";
+	protected static final String dcaeInventoryJsonFile = "jsonSampleArtifact.json";
+	protected static final String dcaeInventoryPolicyFile = "emfSampleArtifact.emf";
+	protected static final String dcaeInventoryDocFile = "docSampleArtifact.doc";
+	protected static final String dcaeInventoryBlueprintFile = "bluePrintSampleArtifact.xml";
+	protected static final String dcaeInventoryEventFile = "eventSampleArtifact.xml";
+
+	protected static final String heatSuccessFile = "asc_heat 0 2.yaml";
+	protected static final String heatNetSuccessFile = "asc_heat_net 0 2.yaml";
+	protected static final String yangFile = "addYangXmlArtifactToResource.xml";
+	protected static final String jsonFile = "jsonArtifact.json";
+	protected static final String invalidJsonFile = "invalidJson.json";
+	protected static final String invalidYangFile = "invalidYangXml.xml";
+	protected static final String otherFile = "other.txt";
+	protected static final String muranoFile = "asc_heat 0 2.zip";
+	protected static final String heatSuccessMiniFile = "heat_mini.yaml";
+	protected static final String heatInvalidFormat = "heatInvalidFormat.yaml";
+	protected static final String yamlInvalidFormat = "invalidYamlFormat.yaml";
+	protected static final String heatEnvfile = "heatEnvfile.env";
+
+	protected ServiceReqDetails serviceDetails;
+	protected ResourceReqDetails vfResourceDetails;
+	protected ResourceReqDetails cpResourceDetails;
+	protected ResourceReqDetails vfcResourceDetails;
+	protected ResourceReqDetails vlResourceDetails;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public CrudArt() {
+		super(name, CrudArt.class.getName());
+	}
+
+	@DataProvider
+	private static final Object[][] getDepArtByType() throws IOException, Exception {
+		return new Object[][] { { ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType()) }, { ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_VOL.getType()) },
+				{ ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType()) }, { ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()) },
+				{ ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType()) }, { ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType()) },
+				{ ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType()) }, { ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType()) },
+				{ ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType()) } };
+	}
+
+	@DataProvider
+	private static final Object[][] getServiceDepArtByType() throws IOException, Exception {
+		return new Object[][] { { ArtifactTypeEnum.OTHER.getType() }, { ArtifactTypeEnum.YANG_XML.getType() }, };
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+		// Set files working directory
+		String sourceDir = config.getResourceConfigDir();
+		String workDir = "HeatDeploymentArtifacts";
+		testResourcesPath = sourceDir + File.separator + workDir;
+		String workDirResourceInstanceArtifacts = "ResourceInstanceArtifacts";
+		testResourcesInstancesPath = sourceDir + File.separator + workDirResourceInstanceArtifacts;
+
+		// Build the components
+		Service serviceObj = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		serviceDetails = new ServiceReqDetails(serviceObj);
+
+		Resource vfcResourceObj = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		vfcResourceDetails = new ResourceReqDetails(vfcResourceObj);
+
+		Resource vfResourceObj = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		vfResourceDetails = new ResourceReqDetails(vfResourceObj);
+
+		Resource cpResourceObj = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true).left().value();
+		cpResourceDetails = new ResourceReqDetails(cpResourceObj);
+
+		Resource vlResourceObj = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true).left().value();
+		vlResourceDetails = new ResourceReqDetails(vlResourceObj);
+	}
+
+	// ---------------------------------Resource
+	// success--------------------------------
+	@Test
+	public void addHeatArtifactToResourceAndCertify() throws Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response:  {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// certified resource
+		RestResponse changeResourceState = LifecycleRestUtils.certifyResource(vfResourceDetails);
+		int status = changeResourceState.getErrorCode();
+		assertEquals("certify resource request returned status:" + status, BaseRestUtils.STATUS_CODE_SUCCESS, status);
+
+		Resource resourceJavaObject = ResponseParser.convertResourceResponseToJavaObject(changeResourceState.getResponse());
+		Map<String, ArtifactDefinition> artifactsMap = resourceJavaObject.getDeploymentArtifacts();
+		boolean flag = false;
+		if (artifactsMap != null) {
+			for (Entry<String, ArtifactDefinition> art : artifactsMap.entrySet()) {
+				if (art.getValue().getArtifactName().equals(heatArtifactDetails.getArtifactName())) {
+					assertTrue("expected artifact type is " + ArtifactGroupTypeEnum.DEPLOYMENT.getType() + " but was " + art.getValue().getArtifactGroupType(), art.getValue().getArtifactGroupType().equals(ArtifactGroupTypeEnum.DEPLOYMENT));
+					flag = true;
+					break;
+				}
+			}
+			assertTrue("expected artifact not found", flag == true);
+		}
+
+	}
+
+	// ---------------------------------Resource
+	// success--------------------------------
+	@Test
+	public void addDcaeInventoryToscaArtifactToResourceInstanceAndCertify() throws Exception {
+		String artifactFileName = dcaeInventoryToscaFile;
+		String artifactName = dcaeInventoryToscaFile;
+		String artifactLabel = "dcae inv tosca label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_TOSCA;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addDcaeInventoryJsonArtifactToResourceInstanceAndCertify() throws Exception {
+		String artifactFileName = dcaeInventoryJsonFile;
+		String artifactName = dcaeInventoryJsonFile;
+		String artifactLabel = "dcae inv json label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_JSON;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addDcaeInventoryPolicyArtifactToResourceInstanceAndCertify() throws Exception {
+		String artifactFileName = dcaeInventoryPolicyFile;
+		String artifactName = dcaeInventoryPolicyFile;
+		String artifactLabel = "dcae inv policy label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_POLICY;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addDcaeInventoryDocArtifactToResourceInstanceAndCertify() throws Exception {
+		String artifactFileName = dcaeInventoryDocFile;
+		String artifactName = dcaeInventoryDocFile;
+		String artifactLabel = "dcae inv doc label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_DOC;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addDcaeInventoryBluePrintArtifactToResourceInstanceAndCertify() throws Exception {
+		String artifactFileName = dcaeInventoryBlueprintFile;
+		String artifactName = dcaeInventoryBlueprintFile;
+		String artifactLabel = "dcae inv blueprint label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addDcaeInventoryEventArtifactToResourceInstanceAndCertify() throws Exception {
+		String artifactFileName = dcaeInventoryEventFile;
+		String artifactName = dcaeInventoryEventFile;
+		String artifactLabel = "dcae inv event label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_EVENT;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	private RestResponse addArtifactToResourceInstanceAndCertify(String artifactFileName, String artifactName, String artifactLabel, ArtifactTypeEnum artifactType) throws Exception {
+
+		// Get the resource
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+
+		// Certify VF
+		Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		assertTrue("response code is BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + changeComponentState.getRight().getErrorCode(), changeComponentState.getRight().getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Add VF instance to service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
+
+		// Get the VF instance
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ComponentInstance VfInstance = service.getComponentInstances().get(0);
+
+		// Create the artifact
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstance(artifactFileName, artifactName, artifactLabel, artifactType, VfInstance, serviceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addArtifactToResourceInstanceResponse.getResponseMessage());
+		return addArtifactToResourceInstanceResponse;
+	}
+
+	@Test
+	public void updateArtifactDescriptionToResourceInstance() throws Exception {
+		String artifactFileName = dcaeInventoryToscaFile;
+		String artifactName = dcaeInventoryToscaFile;
+		String artifactLabel = "dcae inv tosca label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_TOSCA;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		logger.debug("addInformationalArtifactToResource response: {}" ,addArtifactToResourceInstanceResponse.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Get the artifact from VF instance and change his description.
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ComponentInstance vfInstance = service.getComponentInstances().get(0);
+		Map<String, ArtifactDefinition> deploymentArtifacts = vfInstance.getDeploymentArtifacts();
+		ArtifactDefinition artifactDefinition = deploymentArtifacts.get("dcaeinvtoscalabel");
+		artifactDefinition.setDescription("My new description");
+
+		// Update the artifact
+		RestResponse updateDeploymentArtifactToRI = ArtifactRestUtils.updateArtifactToResourceInstance(artifactDefinition, sdncDesignerDetails1, vfInstance.getUniqueId(), service.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",updateDeploymentArtifactToRI.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + updateDeploymentArtifactToRI.getErrorCode(), updateDeploymentArtifactToRI.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void deleteArtifactToResourceInstance() throws Exception {
+		String artifactFileName = dcaeInventoryToscaFile;
+		String artifactName = dcaeInventoryToscaFile;
+		String artifactLabel = "dcae inv tosca label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.DCAE_INVENTORY_TOSCA;
+		RestResponse addArtifactToResourceInstanceResponse = addArtifactToResourceInstanceAndCertify(artifactFileName, artifactName, artifactLabel, artifactType);
+		logger.debug("addInformationalArtifactToResource response: {}",addArtifactToResourceInstanceResponse.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addArtifactToResourceInstanceResponse.getErrorCode(), addArtifactToResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Get the artifact from VF instance and change his description.
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ComponentInstance vfInstance = service.getComponentInstances().get(0);
+		Map<String, ArtifactDefinition> deploymentArtifacts = vfInstance.getDeploymentArtifacts();
+		ArtifactDefinition artifactDefinition = deploymentArtifacts.get("dcaeinvtoscalabel");
+
+		// Delete the artifact
+		RestResponse deleteInformationalArtifactFromResource = ArtifactRestUtils.deleteArtifactFromResourceInstance(artifactDefinition, sdncDesignerDetails1, vfInstance.getUniqueId(), service.getUniqueId());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + deleteInformationalArtifactFromResource.getErrorCode(), deleteInformationalArtifactFromResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addHeatArtifactToResource() throws Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+	}
+
+	@Test
+	public void addHeatAndHeatNetArtifactsToResource() throws Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+
+		// Add HEAT
+		logger.debug("listFileName: {}",listFileName.toString());
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Add HEAT_NET
+		String payloadNet = FileUtils.loadPayloadFile(listFileName, heatNetSuccessFile, true);
+		ArtifactReqDetails heatNetArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType());
+		heatNetArtifactDetails.setPayload(payloadNet);
+		heatNetArtifactDetails.setArtifactLabel(HEAT_NET_LABEL);
+
+		RestResponse addInformationalArtifactToResource1 = ArtifactRestUtils.uploadArtifactToPlaceholderOnResource(heatNetArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId(), HEAT_NET_LABEL);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource1.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource1.getErrorCode(), addInformationalArtifactToResource1.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(vfResourceDetails, sdncDesignerDetails1);
+		Resource resourceRespJavaObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+
+		ArtifactDefinition artifactDefinition = deploymentArtifacts.get(HEAT_LABEL);
+		assertNotNull(artifactDefinition);
+		String heatEsId = artifactDefinition.getEsId();
+		assertNotNull(heatEsId);
+
+		ArtifactDefinition artifactDefinitionNet = deploymentArtifacts.get(HEAT_NET_LABEL);
+		assertNotNull(artifactDefinitionNet);
+		String heatNetEsId = artifactDefinitionNet.getEsId();
+		assertNotNull(heatNetEsId);
+		assertFalse(heatEsId.equalsIgnoreCase(heatNetEsId));
+	}
+
+	@Test
+	public void addDeleteAddHeatArtifactToResource() throws Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		RestResponse deleteInformationalArtifactFromResource = ArtifactRestUtils.deleteInformationalArtifactFromResource(vfResourceDetails.getUniqueId(), heatArtifactDetails, sdncDesignerDetails1);
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + deleteInformationalArtifactFromResource.getErrorCode(), deleteInformationalArtifactFromResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+	}
+
+	@Test
+	public void addYangXmlArtifactToResource() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "asc_heat 0 2.XML";
+		String artifactLabel = "Label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.YANG_XML;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addOtherTypeDeploymentArtifactToResource() throws Exception {
+
+		String fileName = otherFile;
+		String artifactName = "other.txt";
+		String artifactLabel = "Label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.OTHER;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addYangXmlArtifactSameName() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "asc_heat_0_2.XML";
+		String artifactLabel = "Label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.YANG_XML;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// Changing label but not name
+		artifactLabel = "Label1";
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is not 400, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == 400);
+		BaseValidationUtils.checkErrorResponse(addInformationalArtifactToResource, ActionStatus.DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS, new String[] { "Resource", vfResourceDetails.getName(), artifactName });
+
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addInvalidYangXmlFormat() throws Exception {
+
+		String fileName = invalidYangFile;
+		String artifactName = "asc_heat_0_2.XML";
+		String artifactLabel = "Label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.YANG_XML;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is not 400, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == 400);
+		BaseValidationUtils.checkErrorResponse(addInformationalArtifactToResource, ActionStatus.INVALID_XML, new String[] { "YANG_XML" });
+
+	}
+
+	@Test
+	public void addSeveralYangXmlArtifacts() throws Exception {
+
+		// Adding 4 artifacts
+		String fileName = yangFile;
+		String artifactName = "asc_heat_0_2.XML";
+		String artifactLabel = "Label";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.YANG_XML;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// Changing label and name
+		artifactLabel = "Label1";
+		artifactName = "asc_heat_0_3.XML";
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Changing label and name
+		artifactLabel = "Label2";
+		artifactName = "asc_heat_0_4.XML";
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+
+		// Changing label and name
+		artifactLabel = "Label3";
+		artifactName = "asc_heat_0_5.XML";
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType);
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 4);
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void updateHeatArtifactToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		heatTypeArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// update
+		heatTypeArtifactDetails.setArtifactName("UPDATE.yaml");
+		heatTypeArtifactDetails.setPayloadData(null);
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",updateInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + updateInformationalArtifactToResource.getErrorCode(), updateInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void updateHeatArtifactTimeOutToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		Resource resource = getResourceByResDetails(vfResourceDetails, sdncDesignerDetails1);
+		int actualTimeout = resource.getDeploymentArtifacts().get(heatTypeArtifactDetails.getArtifactLabel().toLowerCase()).getTimeout();
+		assertTrue("verify " + heatTypeArtifactDetails.getArtifactLabel().toLowerCase() + " artifact timout, expected " + heatTypeArtifactDetails.getTimeout() + ", but was " + actualTimeout, heatTypeArtifactDetails.getTimeout() == actualTimeout);
+
+		// update
+		heatTypeArtifactDetails.setTimeout(35);
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",updateInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + updateInformationalArtifactToResource.getErrorCode(), updateInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		resource = getResourceByResDetails(vfResourceDetails, sdncDesignerDetails1);
+		actualTimeout = resource.getDeploymentArtifacts().get(heatTypeArtifactDetails.getArtifactLabel().toLowerCase()).getTimeout();
+		assertTrue("verify " + heatTypeArtifactDetails.getArtifactLabel().toLowerCase() + " artifact timout, expected " + heatTypeArtifactDetails.getTimeout() + ", but was " + actualTimeout, heatTypeArtifactDetails.getTimeout() == actualTimeout);
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void updateHeatArtifactDescriptionToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		Resource resource = getResourceByResDetails(vfResourceDetails, sdncDesignerDetails1);
+		String actualDescription = resource.getDeploymentArtifacts().get(heatTypeArtifactDetails.getArtifactLabel().toLowerCase()).getDescription();
+		assertTrue("verify " + heatTypeArtifactDetails.getArtifactLabel().toLowerCase() + " artifact Description, expected " + heatTypeArtifactDetails.getDescription() + ", but was " + actualDescription, heatTypeArtifactDetails.getDescription().equals(actualDescription));
+
+		// update
+		heatTypeArtifactDetails.setDescription("the best description was ever");
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",updateInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + updateInformationalArtifactToResource.getErrorCode(), updateInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		resource = getResourceByResDetails(vfResourceDetails, sdncDesignerDetails1);
+		actualDescription = resource.getDeploymentArtifacts().get(heatTypeArtifactDetails.getArtifactLabel().toLowerCase()).getDescription();
+		assertTrue("verify " + heatTypeArtifactDetails.getArtifactLabel().toLowerCase() + " artifact Description, expected " + heatTypeArtifactDetails.getDescription() + ", but was " + actualDescription, heatTypeArtifactDetails.getDescription().equals(actualDescription));
+	}
+
+	private Resource getResourceByResDetails(ResourceReqDetails resDetails, User userDetails) throws IOException {
+		RestResponse response = ResourceRestUtils.getResource(resDetails, userDetails);
+		assertTrue("response code on get resource not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + response.getErrorCode(), response.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		return resource;
+	}
+
+	// ---------------------------------Service
+	// success--------------------------------
+	@Test()
+	public void addAllTypesDepArtifactToService() throws Exception, Exception {
+
+		// String fileName = heatSuccessFile;
+		// List<String> listFileName =
+		// FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		// logger.debug("listFileName: {}",listFileName.toString());
+
+		// String payload = FileUtils.loadPayloadFile(listFileName, fileName,
+		// true);
+		ArtifactReqDetails otherArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.OTHER.getType());
+		// otherArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(otherArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToService.getErrorCode(), addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		ArtifactReqDetails yangXmlArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.YANG_XML.getType());
+
+		addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(yangXmlArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToService.getErrorCode(), addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+	}
+
+	@Test(enabled = false)
+	public void addMuranoPkgArtifactToService() throws Exception, Exception {
+
+		String fileName = muranoFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}" ,listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.MURANO_PKG.getType());
+		heatArtifactDetails.setPayload(payload);
+		heatArtifactDetails.setArtifactName("asc_heat 0 2.zip");
+		heatArtifactDetails.setArtifactLabel("Label");
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToService.getErrorCode(), addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+	}
+
+	@Test(dataProvider = "getServiceDepArtByType")
+	public void addHeatArtifactToServiceAndCertify(String artType) throws Exception, Exception {
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(artType);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToService.getErrorCode(), addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// certified service
+		RestResponse changeServiceState = LifecycleRestUtils.certifyService(serviceDetails);
+		int status = changeServiceState.getErrorCode();
+		assertEquals("certify service request returned status:" + status, BaseRestUtils.STATUS_CODE_SUCCESS, status);
+
+		Service resourceJavaObject = ResponseParser.convertServiceResponseToJavaObject(changeServiceState.getResponse());
+		Map<String, ArtifactDefinition> artifactsMap = resourceJavaObject.getDeploymentArtifacts();
+		boolean flag = false;
+		if (artifactsMap != null) {
+			for (Entry<String, ArtifactDefinition> art : artifactsMap.entrySet()) {
+				if (art.getValue().getArtifactName().equals(heatArtifactDetails.getArtifactName())) {
+					assertTrue("expected artifact type is " + ArtifactGroupTypeEnum.DEPLOYMENT.getType() + " but was " + art.getValue().getArtifactGroupType(), art.getValue().getArtifactGroupType().equals(ArtifactGroupTypeEnum.DEPLOYMENT));
+					flag = true;
+					break;
+				}
+			}
+			assertTrue("expected artifact not found", flag == true);
+		}
+
+	}
+
+	@Test(enabled = false, dataProvider = "getServiceDepArtByType")
+	public void updateHeatArtifactToService(String artType) throws Exception, Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(artType);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToService.getErrorCode(), addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// update
+		heatArtifactDetails.setPayloadData(payload);
+		RestResponse updateInformationalArtifactToService = ArtifactRestUtils.updateInformationalArtifactOfServiceByMethod(heatArtifactDetails, serviceDetails.getUniqueId(), sdncDesignerDetails1, "POST");
+		logger.debug("updateInformationalArtifactToService response: {}",updateInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + updateInformationalArtifactToService.getErrorCode(), updateInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+	}
+
+	// --------------------------------------Resource Negative
+	// Tests-------------------------------------
+
+	// TODO Andrey the method of DEPLOYMENT artifact is update and not add
+	@Test(dataProvider = "getServiceDepArtByType")
+	public void addTheSameAdditionalHeatArtifactToResource(String artType) throws Exception, Exception {
+
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(artType);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// add the same artifact one more time
+		artifactDetails.setArtifactLabel("the second artifact");
+		addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", vfResourceDetails.getName(), artifactDetails.getArtifactName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS.name(), variables, addInformationalArtifactToResource.getResponse());
+
+	}
+
+	@Test
+	public void addHeatArtifactTwiceSameNameToResource() throws Exception, Exception {
+
+		String filename1 = heatSuccessFile;
+		// String filename2 = heatSuccessMiniFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, filename1, true);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Add HEAT_NET
+		String payloadNet = FileUtils.loadPayloadFile(listFileName, heatNetSuccessFile, true);
+		ArtifactReqDetails heatNetArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType());
+		heatNetArtifactDetails.setPayload(payloadNet);
+		heatNetArtifactDetails.setArtifactLabel(HEAT_NET_LABEL);
+		heatNetArtifactDetails.setArtifactName(heatArtifactDetails.getArtifactName());
+
+		RestResponse addInformationalArtifactToResource1 = ArtifactRestUtils.uploadArtifactToPlaceholderOnResource(heatNetArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId(), HEAT_NET_LABEL);
+		logger.debug("addInformationalArtifactToResource response: {}" ,addInformationalArtifactToResource1.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource1.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", vfResourceDetails.getName(), heatNetArtifactDetails.getArtifactName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS.name(), variables, addInformationalArtifactToResource1.getResponse());
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void addHeatArtifactTwiceToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String filename1 = heatSuccessFile;
+		String filename2 = heatSuccessMiniFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, filename1, true);
+		heatTypeArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}" ,addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// add the second artifact
+		payload = FileUtils.loadPayloadFile(listFileName, heatSuccessMiniFile, true);
+		heatTypeArtifactDetails.setPayload(payload);
+		heatTypeArtifactDetails.setArtifactName(filename2);
+		heatTypeArtifactDetails.setArtifactLabel("the second artifact");
+
+		addInformationalArtifactToResource = ArtifactRestUtils.explicitAddInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", vfResourceDetails.getName(), heatTypeArtifactDetails.getArtifactType(), heatTypeArtifactDetails.getArtifactType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS.name(), variables, addInformationalArtifactToResource.getResponse());
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void addHeatArtifactInvalidHeatFormatToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String fileName = heatInvalidFormat;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		heatTypeArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_DEPLOYMENT_ARTIFACT_HEAT.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList(heatTypeArtifactDetails.getArtifactType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_DEPLOYMENT_ARTIFACT_HEAT.name(), variables, addInformationalArtifactToResource.getResponse());
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void addHeatArtifactInvalidYamlFormatToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String fileName = yamlInvalidFormat;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		heatTypeArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_YAML.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList(heatTypeArtifactDetails.getArtifactType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_YAML.name(), variables, addInformationalArtifactToResource.getResponse());
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void addHeatArtifactInvalidFileExtensionToResource(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String fileName = yangFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+
+		heatTypeArtifactDetails.setPayload(payload);
+		heatTypeArtifactDetails.setArtifactName(fileName);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList(heatTypeArtifactDetails.getArtifactType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name(), variables, addInformationalArtifactToResource.getResponse());
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void addHeatArtifactToResourceCertifyAndAddAdditionalHeatArtifact(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		heatTypeArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// certified resource
+		RestResponse changeResourceState = LifecycleRestUtils.certifyResource(vfResourceDetails);
+		int status = changeResourceState.getErrorCode();
+		assertEquals("certify resource request returned status:" + status, BaseRestUtils.STATUS_CODE_SUCCESS, status);
+
+		// add second HEAT artifact to the certified resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(vfResourceDetails, sdncDesignerDetails1, LifeCycleStatesEnum.CHECKOUT);
+		assertTrue("expected code response on change resource state to CHECKOUT BaseRestUtils.STATUS_CODE_SUCCESS, but was " + changeResourceState.getErrorCode(), changeResourceState.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// ArtifactReqDetails heatArtifactDetails1 =
+		// ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatTypeArtifactDetails.setPayload(payload);
+		heatTypeArtifactDetails.setArtifactName(fileName);
+		heatTypeArtifactDetails.setArtifactLabel("the second artifact");
+
+		addInformationalArtifactToResource = ArtifactRestUtils.explicitAddInformationalArtifactToResource(heatTypeArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", vfResourceDetails.getName(), heatTypeArtifactDetails.getArtifactType(), heatTypeArtifactDetails.getArtifactType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS.name(), variables, addInformationalArtifactToResource.getResponse());
+
+	}
+
+	// -----------------Service Negative
+	// Tests--------------------------------------------------------
+
+	// Absolute
+	@Test(enabled = false)
+	public void addHeatArtifactTwiceToService() throws Exception, Exception {
+
+		String fileName1 = heatSuccessFile;
+		String fileName2 = heatSuccessMiniFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName1, true);
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.OTHER.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToService.getErrorCode(), addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// add the second artifact
+		payload = FileUtils.loadPayloadFile(listFileName, fileName2, true);
+
+		ArtifactReqDetails heatArtifactDetails1 = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.OTHER.getType());
+		heatArtifactDetails1.setPayload(payload);
+		heatArtifactDetails1.setArtifactName(fileName2);
+		heatArtifactDetails1.setArtifactLabel("the second artifact");
+
+		addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails1, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToService.getErrorCode());
+
+		List<String> variables = Arrays.asList("Service", serviceDetails.getName(), ArtifactTypeEnum.OTHER.getType(), ArtifactTypeEnum.OTHER.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS.name(), variables, addInformationalArtifactToService.getResponse());
+
+	}
+
+	// TODO Andrey Obsolete
+	@Test(enabled = false)
+	public void addHeatArtifactInvalidHeatFormatToService() throws Exception, Exception {
+
+		String fileName = heatInvalidFormat;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_DEPLOYMENT_ARTIFACT_HEAT.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToService.getErrorCode());
+
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_DEPLOYMENT_ARTIFACT_HEAT.name(), variables, addInformationalArtifactToService.getResponse());
+
+	}
+
+	// TODO Andrey Obsolete
+	@Test(enabled = false)
+	public void addHeatArtifactInvalidYamlFormatToService() throws Exception, Exception {
+
+		String fileName = yamlInvalidFormat;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_YAML.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToService.getErrorCode());
+
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_YAML.name(), variables, addInformationalArtifactToService.getResponse());
+
+	}
+
+	@Test
+	public void addHeatArtifactInvalidFileExtensionToService() throws Exception, Exception {
+
+		String fileName = muranoFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.YANG_XML.getType());
+		heatArtifactDetails.setPayload(payload);
+		heatArtifactDetails.setArtifactName(fileName);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		logger.debug("addInformationalArtifactToService response: {}",addInformationalArtifactToService.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToService.getErrorCode());
+
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.YANG_XML.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name(), variables, addInformationalArtifactToService.getResponse());
+
+	}
+
+	@Test(dataProvider = "getDepArtByType")
+	public void addHeatEnvArtifactToResourceNotSupportedType(ArtifactReqDetails heatTypeArtifactDetails) throws Exception, Exception {
+
+		String fileName = heatEnvfile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_ENV.getType());
+		heatArtifactDetails.setPayload(payload);
+		heatArtifactDetails.setArtifactName("asc_heat 0 2.env");
+		heatArtifactDetails.setArtifactLabel(heatTypeArtifactDetails.getArtifactLabel());
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToResource.getErrorCode());
+
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT_ENV.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name(), variables, addInformationalArtifactToResource.getResponse());
+	}
+
+	// TODO Andrey
+	@Test
+	public void addHeatArtifactToServiceNotSupportDeploymentArt() throws Exception, Exception {
+
+		String fileName = heatSuccessFile;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}",listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, fileName, true);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(payload);
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(heatArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), addInformationalArtifactToService.getErrorCode());
+
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name(), variables, addInformationalArtifactToService.getResponse());
+
+	}
+
+	protected RestResponse addArtifactToResourceInstance(String artifactFileName, String artifactName, String artifactLabel, ArtifactTypeEnum artifactType, ComponentInstance componentInstance, ServiceReqDetails serviceDetails) throws Exception {
+		ArtifactReqDetails dcaeArtifactDetails = buildArtifactReqDetailsObject(testResourcesInstancesPath, artifactFileName, artifactName, artifactLabel, artifactType);
+		RestResponse addArtifactToResourceInstance = ArtifactRestUtils.addArtifactToResourceInstance(dcaeArtifactDetails, sdncDesignerDetails1, componentInstance.getUniqueId(), serviceDetails.getUniqueId());
+		return addArtifactToResourceInstance;
+	}
+
+	protected RestResponse addDeploymentArtifactToResource(String artifactFileName, String artifactName, String artifactLabel, ArtifactTypeEnum artifactType) throws Exception {
+		ArtifactReqDetails heatArtifactDetails = buildArtifactReqDetailsObject(testResourcesPath, artifactFileName, artifactName, artifactLabel, artifactType);
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, vfResourceDetails.getUniqueId());
+		return addInformationalArtifactToResource;
+	}
+
+	protected RestResponse addDeploymentArtifactToResource(String artifactFileName, String artifactName, String artifactLabel, ArtifactTypeEnum artifactType, ResourceReqDetails resource) throws Exception {
+		ArtifactReqDetails heatArtifactDetails = buildArtifactReqDetailsObject(testResourcesPath, artifactFileName, artifactName, artifactLabel, artifactType);
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1, resource.getUniqueId());
+		return addInformationalArtifactToResource;
+	}
+
+	// US672293 - Support new artifact type : BEVF_LICENSE , VENDOR_LICENSE
+	@Test
+	public void addNewArtifactsToVFResource() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "artifact1.xml";
+		String artifactLabel = "Label1";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VNF_CATALOG;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response:{}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		artifactName = "artifact2.xml";
+		artifactLabel = "Label2";
+		artifactType = ArtifactTypeEnum.VF_LICENSE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact4.xml";
+		artifactLabel = "Label4";
+		artifactType = ArtifactTypeEnum.MODEL_INVENTORY_PROFILE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact5.xml";
+		artifactLabel = "Label5";
+		artifactType = ArtifactTypeEnum.MODEL_QUERY_SPEC;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact6.xml";
+		artifactLabel = "Label6";
+		artifactType = ArtifactTypeEnum.APPC_CONFIG;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		fileName = jsonFile;
+		artifactName = "artifact7.json";
+		artifactLabel = "Label7";
+		artifactType = ArtifactTypeEnum.APPC_CONFIG;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 2);
+		
+		//MIB artifacts: SNMP_POLL, SNMP_TRAP
+		fileName = jsonFile;
+		artifactName = "artifact8.json";
+		artifactLabel = "Label8";
+		artifactType = ArtifactTypeEnum.SNMP_POLL;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		
+		fileName = jsonFile;
+		artifactName = "artifact9.json";
+		artifactLabel = "Label9";
+		artifactType = ArtifactTypeEnum.SNMP_TRAP;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		//MIB artifacts: SNMP_POLL, SNMP_TRAP
+		fileName = jsonFile;
+		artifactName = "artifact8.json";
+		artifactLabel = "Label8";
+		artifactType = ArtifactTypeEnum.SNMP_POLL;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		
+		fileName = jsonFile;
+		artifactName = "artifact9.json";
+		artifactLabel = "Label9";
+		artifactType = ArtifactTypeEnum.SNMP_TRAP;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactsToVFCResource() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "artifact1.xml";
+		String artifactLabel = "Label1";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VNF_CATALOG;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact2.xml";
+		artifactLabel = "Label2";
+		artifactType = ArtifactTypeEnum.VF_LICENSE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact4.xml";
+		artifactLabel = "Label4";
+		artifactType = ArtifactTypeEnum.MODEL_INVENTORY_PROFILE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifac5.xml";
+		artifactLabel = "Label5";
+		artifactType = ArtifactTypeEnum.MODEL_QUERY_SPEC;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactsToVfc() throws Exception {
+		String fileName = yangFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VF_LICENSE;
+		RestResponse addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}",addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactsToCp() throws Exception {
+		String fileName = yangFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VF_LICENSE;
+		RestResponse addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, cpResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(cpResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, cpResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(cpResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactsToVl() throws Exception {
+		String fileName = yangFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VF_LICENSE;
+		RestResponse addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vlResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vlResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vlResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vlResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addVfInstanceWithNewArtifactsToService() throws Exception {
+		String fileName = yangFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VF_LICENSE;
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		// Certify VF
+		Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		assertTrue("response code is BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + changeComponentState.getRight().getErrorCode(), changeComponentState.getRight().getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// Add VF instance to service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
+		// get service and verify VF instance contain the Artifacts :VF_LICENSE
+		// and VENDOR_LICENSE
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ComponentInstance VfInstance = service.getComponentInstances().get(0);
+		ArtifactValidationUtils.validateArtifactsNumberInComponentInstance(VfInstance, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.VENDOR_LICENSE, 1);
+		ArtifactValidationUtils.validateArtifactsNumberInComponentInstance(VfInstance, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.VF_LICENSE, 1);
+	}
+
+	@Test
+	public void addNotSupportedArtifactsTypeToService01() throws Exception, Exception {
+		// Artifact type : VF_LICENSE
+		ArtifactReqDetails deploymentArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.VF_LICENSE.getType());
+		RestResponse addDeploymentArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(deploymentArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code  eturned :" + addDeploymentArtifactToService.getErrorCode(), addDeploymentArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("VF_LICENSE");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name(), variables, addDeploymentArtifactToService.getResponse());
+	}
+
+	@Test
+	public void addNotSupportedArtifactsTypeToService02() throws Exception, Exception {
+		// Artifact type : VENDOR_LICENSE
+		ArtifactReqDetails deploymentArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.VENDOR_LICENSE.getType());
+		RestResponse addDeploymentArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(deploymentArtifactDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code  eturned :" + addDeploymentArtifactToService.getErrorCode(), addDeploymentArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("VENDOR_LICENSE");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name(), variables, addDeploymentArtifactToService.getResponse());
+	}
+
+	@Test
+	public void addInvalidFileForArtifactTypeVendorLicenseToResource() throws Exception {
+		String fileName = yangFile;
+		String NonXmlFile = heatSuccessFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VF_LICENSE;
+		RestResponse addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		// Artifact type VENDOR_LICENSE must be XML file
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		addDeploymentArtifactToResource = addDeploymentArtifactToResource(NonXmlFile, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code  400 returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("VENDOR_LICENSE");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_XML.name(), variables, addDeploymentArtifactToResource.getResponse());
+		// get resource and verify that file not exist within
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 0);
+	}
+
+	@Test
+	public void addInvalidFileForArtifactTypeVfLicenseToResource() throws Exception {
+		String fileName = yangFile;
+		String NonXmlFile = heatSuccessFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		RestResponse addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		// Artifact type VF_LICENSE must be XML file
+		artifactName = "artifact3.xml";
+		artifactLabel = "Label3";
+		artifactType = ArtifactTypeEnum.VF_LICENSE;
+		addDeploymentArtifactToResource = addDeploymentArtifactToResource(NonXmlFile, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code  400 returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("VF_LICENSE");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_XML.name(), variables, addDeploymentArtifactToResource.getResponse());
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 0);
+	}
+
+	@Test
+	public void addVendorLicenseArtifactAlreadyExistsInResource() throws Exception {
+		String fileName = yangFile;
+		String artifactName = "artifact2.xml";
+		String artifactLabel = "Label2";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VENDOR_LICENSE;
+		RestResponse addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		// Add same file again to resource
+		addDeploymentArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addDeploymentArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 400, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(artifactLabel.toLowerCase());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_EXIST.name(), variables, addDeploymentArtifactToResource.getResponse());
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	// US672294
+
+	@Test()
+	public void addVnfCatalogArtifactsToService() throws Exception, Exception {
+
+		ArtifactReqDetails artDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.VNF_CATALOG.getType());
+		RestResponse resp = ArtifactRestUtils.addInformationalArtifactToService(artDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + resp.getErrorCode(), resp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// get service and verify the Artifacts :VNF_CATALOG
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(service, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.VNF_CATALOG, 1);
+	}
+
+	@Test()
+	public void addModelInventoryProfileArtifactsToService() throws Exception, Exception {
+
+		ArtifactReqDetails artDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType());
+		RestResponse resp = ArtifactRestUtils.addInformationalArtifactToService(artDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + resp.getErrorCode(), resp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// get service and verify the Artifacts :VNF_CATALOG
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(service, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, 1);
+	}
+
+	@Test()
+	public void addModelQuerySpecArtifactsToService() throws Exception, Exception {
+
+		ArtifactReqDetails artDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.MODEL_QUERY_SPEC.getType());
+		RestResponse resp = ArtifactRestUtils.addInformationalArtifactToService(artDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + resp.getErrorCode(), resp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// get service and verify the Artifacts :VNF_CATALOG
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(service, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.MODEL_QUERY_SPEC, 1);
+	}
+
+	@Test
+	public void addVfInstanceWithNewArtifactsToService02() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "artifact1.xml";
+		String artifactLabel = "Label1";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VNF_CATALOG;
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		fileName = yangFile;
+		artifactName = "artifact2.xml";
+		artifactLabel = "Label2";
+		artifactType = ArtifactTypeEnum.APPC_CONFIG;
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact4.xml";
+		artifactLabel = "Label4";
+		artifactType = ArtifactTypeEnum.MODEL_INVENTORY_PROFILE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifac5.xml";
+		artifactLabel = "Label5";
+		artifactType = ArtifactTypeEnum.MODEL_QUERY_SPEC;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+		// Certify VF
+		Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		assertTrue("response code is BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + changeComponentState.getRight().getErrorCode(), changeComponentState.getRight().getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		// Add VF instance to service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
+
+		// get service and verify VF instance contain the Artifacts :VF_LICENSE
+		// and VENDOR_LICENSE
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ComponentInstance VfInstance = service.getComponentInstances().get(0);
+		ArtifactValidationUtils.validateArtifactsNumberInComponentInstance(VfInstance, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.VNF_CATALOG, 1);
+		ArtifactValidationUtils.validateArtifactsNumberInComponentInstance(VfInstance, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, 1);
+		ArtifactValidationUtils.validateArtifactsNumberInComponentInstance(VfInstance, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.MODEL_QUERY_SPEC, 1);
+		ArtifactValidationUtils.validateArtifactsNumberInComponentInstance(VfInstance, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.APPC_CONFIG, 1);
+	}
+
+	@Test
+	public void addAppcConfigArtifactToVfc() throws Exception {
+		String fileName = jsonFile;
+		String artifactName = "artifact7.json";
+		String artifactLabel = "Label7";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.APPC_CONFIG;
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code 400, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(artifactName);
+		variables.add("[VF]");
+		variables.add("VFC (Virtual Function Component)");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISMATCH_BETWEEN_ARTIFACT_TYPE_AND_COMPONENT_TYPE.name(), variables, addInformationalArtifactToResource.getResponse());
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 0);
+	}
+
+	@Test
+	public void addAppcConfigArtifactToCp() throws Exception {
+		String fileName = jsonFile;
+		String artifactName = "artifact7.json";
+		String artifactLabel = "Label7";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.APPC_CONFIG;
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, cpResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code 400, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(artifactName);
+		variables.add("[VF]");
+		variables.add("CP (Connection Point)");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISMATCH_BETWEEN_ARTIFACT_TYPE_AND_COMPONENT_TYPE.name(), variables, addInformationalArtifactToResource.getResponse());
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 0);
+	}
+
+	@Test
+	public void addAppcConfigArtifactToVl() throws Exception {
+		String fileName = jsonFile;
+		String artifactName = "artifact7.json";
+		String artifactLabel = "Label7";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.APPC_CONFIG;
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vlResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code 400, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(artifactName);
+		variables.add("[VF]");
+		variables.add("VL (Virtual Link)");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISMATCH_BETWEEN_ARTIFACT_TYPE_AND_COMPONENT_TYPE.name(), variables, addInformationalArtifactToResource.getResponse());
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 0);
+	}
+
+	@Test()
+	public void addAppcConfigArtifactsToService() throws Exception, Exception {
+		ArtifactReqDetails artDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.APPC_CONFIG.getType());
+		RestResponse addDeploymentArtifactToResource = ArtifactRestUtils.addInformationalArtifactToService(artDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code 400, returned :" + addDeploymentArtifactToResource.getErrorCode(), addDeploymentArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(ArtifactTypeEnum.APPC_CONFIG.toString());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name(), variables, addDeploymentArtifactToResource.getResponse());
+	}
+
+	@Test
+	public void addAppcConfigInvalidJsonToVFResourceFailed() throws Exception {
+
+		String fileName = invalidJsonFile;
+		String artifactName = "invalidJson.json";
+		String artifactLabel = "Label7";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.APPC_CONFIG;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is 400, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(ArtifactTypeEnum.APPC_CONFIG.toString());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_JSON.name(), variables, addInformationalArtifactToResource.getResponse());
+
+		RestResponse getResource = ResourceRestUtils.getResource(vfResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 0);
+
+	}
+
+	@Test
+	public void addNewArtifactsToCp02() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "artifact1.xml";
+		String artifactLabel = "Label1";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VNF_CATALOG;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, cpResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(cpResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact4.xml";
+		artifactLabel = "Label4";
+		artifactType = ArtifactTypeEnum.MODEL_INVENTORY_PROFILE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, cpResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(cpResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifac5.xml";
+		artifactLabel = "Label5";
+		artifactType = ArtifactTypeEnum.MODEL_QUERY_SPEC;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, cpResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(cpResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactsToVl02() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "artifact1.xml";
+		String artifactLabel = "Label1";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VNF_CATALOG;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vlResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vlResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact4.xml";
+		artifactLabel = "Label4";
+		artifactType = ArtifactTypeEnum.MODEL_INVENTORY_PROFILE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vlResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vlResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifac5.xml";
+		artifactLabel = "Label5";
+		artifactType = ArtifactTypeEnum.MODEL_QUERY_SPEC;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vlResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vlResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactsToVfc02() throws Exception {
+
+		String fileName = yangFile;
+		String artifactName = "artifact1.xml";
+		String artifactLabel = "Label1";
+		ArtifactTypeEnum artifactType = ArtifactTypeEnum.VNF_CATALOG;
+
+		RestResponse addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifact4.xml";
+		artifactLabel = "Label4";
+		artifactType = ArtifactTypeEnum.MODEL_INVENTORY_PROFILE;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+
+		artifactName = "artifac5.xml";
+		artifactLabel = "Label5";
+		artifactType = ArtifactTypeEnum.MODEL_QUERY_SPEC;
+
+		addInformationalArtifactToResource = addDeploymentArtifactToResource(fileName, artifactName, artifactLabel, artifactType, vfcResourceDetails);
+		logger.debug("addInformationalArtifactToResource response: {}", addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addInformationalArtifactToResource.getErrorCode(), addInformationalArtifactToResource.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		getResource = ResourceRestUtils.getResource(vfcResourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(resource, ArtifactGroupTypeEnum.DEPLOYMENT, artifactType, 1);
+	}
+
+	@Test
+	public void addNewArtifactAlreadyExistsInService() throws Exception {
+		ArtifactReqDetails artDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.MODEL_QUERY_SPEC.getType());
+		RestResponse addDeploymentArtifactoService = ArtifactRestUtils.addInformationalArtifactToService(artDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code is  BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + addDeploymentArtifactoService.getErrorCode(), addDeploymentArtifactoService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		// get service and verify the Artifacts :VNF_CATALOG
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(service, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.MODEL_QUERY_SPEC, 1);
+		// Add same file again to resource
+		addDeploymentArtifactoService = ArtifactRestUtils.addInformationalArtifactToService(artDetails, sdncDesignerDetails1, serviceDetails.getUniqueId());
+		assertTrue("response code is 400, returned :" + addDeploymentArtifactoService.getErrorCode(), addDeploymentArtifactoService.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(artDetails.getArtifactLabel().toLowerCase());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.ARTIFACT_EXIST.name(), variables, addDeploymentArtifactoService.getResponse());
+		// get service and verify the Artifacts :VNF_CATALOG is still exist and
+		// has one occurrences
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails1);
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ArtifactValidationUtils.validateArtifactsNumberInComponent(service, ArtifactGroupTypeEnum.DEPLOYMENT, ArtifactTypeEnum.MODEL_QUERY_SPEC, 1);
+	}
+
+	private ArtifactReqDetails buildArtifactReqDetailsObject(String filesPath, String artifactFileName, String artifactName, String artifactLabel, ArtifactTypeEnum artifactType) throws IOException, Exception {
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(filesPath);
+		logger.debug("listFileName: {}", listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, artifactFileName, true);
+
+		ArtifactReqDetails dcaeArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(artifactType.getType());
+		dcaeArtifactDetails.setPayload(payload);
+		dcaeArtifactDetails.setArtifactName(artifactName);
+		dcaeArtifactDetails.setArtifactLabel(artifactLabel);
+		return dcaeArtifactDetails;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java
new file mode 100644
index 0000000..bb2b662
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java
@@ -0,0 +1,665 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpResponseException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicResponseHandler;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Decoder;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.util.GeneralUtility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.testng.internal.Yaml;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.typesafe.config.ConfigException.Null;
+
+import fj.data.Either;
+import fj.data.List;
+
+public class DownloadComponentArt extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(DownloadComponentArt.class.getName());
+	protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
+	protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+
+
+	protected Gson gson = new Gson();
+	protected JSONParser jsonParser = new JSONParser();
+
+
+	protected String serviceVersion;
+	protected ResourceReqDetails resourceDetails;
+	protected User sdncUserDetails;
+	protected ServiceReqDetails serviceDetails;
+	
+
+	@BeforeMethod
+	public void init() throws Exception{
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		Resource resourceObj = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		Service serviceObj = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		
+		
+		resourceDetails = new ResourceReqDetails(resourceObj); 
+		serviceDetails = new ServiceReqDetails(serviceObj);
+	}
+	
+	@Rule 
+	public static TestName name = new TestName();
+
+	public DownloadComponentArt() {
+		super(name, DownloadComponentArt.class.getName());
+
+	}
+		
+
+	
+	// External API - Download artifact for resource
+	@Test
+	public void downloadArtifactFromResourceViaExternalAPI() throws Exception {
+		Resource resourceDetailsVF;
+		Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF = createdResource.left().value();
+		ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF, UserRoleEnum.DESIGNER, true, true).left().value();
+		resourceDetails = new ResourceReqDetails(resourceDetailsVF); 
+		
+		String resourceUUID = resourceDetailsVF.getUUID();
+		String artifactUUID = heatArtifact.getArtifactUUID();
+		
+		System.out.println("Resource UUID: " + resourceUUID);
+		System.out.println("Artifact UUID: " + artifactUUID);
+		
+		RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Resource");
+		
+		Integer responseCode = restResponse.getErrorCode();
+		Integer expectedCode = 200;
+		Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
+		
+		String response = restResponse.getResponse();
+		
+		String payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
+		String decodedPaypload = Decoder.decode(payloadData);
+		
+		Assert.assertEquals(response, decodedPaypload, "Response deployment artifact not correct.");
+		
+		String auditAction = "DownloadArtifact";
+		
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName());
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		
+		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+		String resource_url = String.format("/sdc/v1/catalog/resources/%s/artifacts/%s", resourceUUID, artifactUUID);
+		expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+		
+		AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+	
+	
+	// External API - Download artifact for resource - negative test
+	@Test
+	public void downloadArtifactFromResourceViaExternalAPINegativeTest() throws Exception {
+		Resource resourceDetailsVF;
+		Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF = createdResource.left().value();
+		ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF, UserRoleEnum.DESIGNER, true, true).left().value();
+		resourceDetails = new ResourceReqDetails(resourceDetailsVF); 
+		
+		String resourceUUID = resourceDetailsVF.getUUID();
+		String artifactUUID = heatArtifact.getArtifactUUID();
+		
+		System.out.println("Resource UUID: " + resourceUUID);
+		System.out.println("Artifact UUID: " + artifactUUID);
+		
+		RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, "dfsgfdsg324", ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Resource");
+		
+		Integer responseCode = restResponse.getErrorCode();
+		Integer expectedCode = 200;
+		Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
+	}
+	
+	
+	
+	
+	
+	// External API - Download artifact for service - negative test
+	@Test
+	public void downloadArtifactFromServiceViaExternalAPI() throws Exception {
+		
+		Service resourceDetailsService;
+		Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetailsService = createdResource.left().value();
+		
+		ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsService, UserRoleEnum.DESIGNER, true, true).left().value();
+
+		String resourceUUID = resourceDetailsService.getUUID();
+		String artifactUUID = heatArtifact.getArtifactUUID();
+		
+		System.out.println("Resource UUID: " + resourceUUID);
+		System.out.println("Artifact UUID: " + artifactUUID);
+		
+		RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Service");
+		
+		Integer responseCode = restResponse.getErrorCode();
+		Integer expectedCode = 200;
+		Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
+		
+		String response = restResponse.getResponse();
+		
+		String payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
+		String decodedPaypload = Decoder.decode(payloadData);
+		
+		Assert.assertEquals(response, decodedPaypload, "Response deployment artifact not correct.");
+		
+		String auditAction = "DownloadArtifact";
+		
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setResourceName(resourceDetailsService.getName());
+		expectedResourceAuditJavaObject.setResourceType("Service");
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		
+		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+		String resource_url = String.format("/sdc/v1/catalog/services/%s/artifacts/%s", resourceUUID, artifactUUID);
+		expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+		
+		AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+	
+	
+	
+	
+	
+	
+	// External API - Download ComponentInstance artifact of service - negative test
+	@Test
+	public void downloadArtifactOfComponentInstanceFromServiceViaExternalAPI() throws Exception {
+		
+		Either<Resource, RestResponse> resourceDetailsVF_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		Component resourceDetailsVF_01 = resourceDetailsVF_01e.left().value();
+		ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true).left().value();
+
+		resourceDetailsVF_01 = AtomicOperationUtils.changeComponentState(resourceDetailsVF_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		
+		Service resourceDetailsService;
+		Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetailsService = createdResource.left().value();
+		
+		
+		ComponentInstance resourceDetailsVF1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVF_01, resourceDetailsService, UserRoleEnum.DESIGNER, true).left().value();
+		
+		
+		System.out.println("-----");
+		
+		
+		String resourceUUID = resourceDetailsService.getUUID();
+		String componentNormalizedName = resourceDetailsVF1ins_01.getNormalizedName();
+		String artifactUUID = heatArtifact.getArtifactUUID();
+			
+		System.out.println("Resource UUID: " + resourceUUID);
+		System.out.println("Component NormalizedName: " + componentNormalizedName);
+		System.out.println("Artifact UUID: " + artifactUUID);
+		
+		RestResponse restResponse = ArtifactRestUtils.getComponentInstanceDeploymentArtifactExternalAPI(resourceUUID, componentNormalizedName, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Service");
+//			
+		Integer responseCode = restResponse.getErrorCode();
+		Integer expectedCode = 200;
+		Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
+			
+		String response = restResponse.getResponse();
+			
+		String payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
+		String decodedPaypload = Decoder.decode(payloadData);
+			
+		Assert.assertEquals(response, decodedPaypload, "Response deployment artifact not correct.");
+			
+		String auditAction = "DownloadArtifact";
+			
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setResourceName(resourceDetailsVF1ins_01.getName());
+		expectedResourceAuditJavaObject.setResourceType("Service");
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+			
+		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+		String resource_url = String.format("/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s", resourceUUID, componentNormalizedName, artifactUUID);
+		expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+			
+		AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	@Test
+	public void downloadArtifactFromResourceTest() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			String jsonBody = createUploadArtifactBodyJson();
+
+			String resourceId = resourceDetails.getUniqueId();
+			String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
+			HttpPost httppost = createPostAddArtifactRequeast(jsonBody, url, true);
+			HttpResponse response = httpclient.execute(httppost);
+			int status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("failed to add artifact", 200, status);
+
+			ArtifactDefinition origArtifact = getArtifactDataFromJson(jsonBody);
+			addArtifactDataFromResponse(response, origArtifact);
+			String artifactId = origArtifact.getUniqueId();
+			
+			url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, artifactId);
+			HttpGet httpGet = createGetRequest(url);
+			response = httpclient.execute(httpGet);
+			status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("failed to download artifact", 200, status);
+									
+			InputStream inputStream = response.getEntity().getContent();
+			ArtifactUiDownloadData artifactUiDownloadData = getArtifactUiDownloadData(IOUtils.toString(inputStream));
+			AssertJUnit.assertEquals("Downloaded payload is different from uploaded one", UPLOAD_ARTIFACT_PAYLOAD, artifactUiDownloadData.getBase64Contents());
+			AssertJUnit.assertEquals("Downloaded artifact name is different from uploaded one", UPLOAD_ARTIFACT_NAME, artifactUiDownloadData.getArtifactName());
+
+			// validate audit
+					
+			ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor.constructFieldsForAuditValidation(resourceDetails, resourceDetails.getVersion(), sdncUserDetails);
+			String auditAction = "ArtifactDownload";
+			expectedResourceAuditJavaObject.setAction(auditAction);
+			expectedResourceAuditJavaObject.setPrevState("");
+			expectedResourceAuditJavaObject.setPrevVersion("");
+			expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+			expectedResourceAuditJavaObject.setStatus("200");
+			expectedResourceAuditJavaObject.setDesc("OK");
+			expectedResourceAuditJavaObject.setArtifactData(AuditValidationUtils.buildArtifactDataAudit(origArtifact));
+			expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
+			expectedResourceAuditJavaObject.setPrevArtifactUuid("");
+			AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+			
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void downloadArtifactFromServiceTest() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+
+		try {
+
+			String jsonStr = createUploadArtifactBodyJson();
+
+			String url = String.format(Urls.ADD_ARTIFACT_TO_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceDetails.getUniqueId());
+			HttpPost httpPost = createPostAddArtifactRequeast(jsonStr, url, true);
+			CloseableHttpResponse result = httpclient.execute(httpPost);
+			int status = result.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("failed to add artifact", 200, status);
+
+			ArtifactDefinition origArtifact = getArtifactDataFromJson(jsonStr);
+			addArtifactDataFromResponse(result, origArtifact);
+			String artifactId = origArtifact.getUniqueId();
+
+			url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceDetails.getUniqueId(), artifactId);
+			HttpGet httpGet = createGetRequest(url);
+			CloseableHttpResponse response2 = httpclient.execute(httpGet);
+			status = response2.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("failed to download artifact", 200, status);
+			InputStream inputStream = response2.getEntity().getContent();
+			ArtifactUiDownloadData artifactUiDownloadData = getArtifactUiDownloadData(IOUtils.toString(inputStream));
+			AssertJUnit.assertEquals("Downloaded payload is different from uploaded one", UPLOAD_ARTIFACT_PAYLOAD, artifactUiDownloadData.getBase64Contents());
+			AssertJUnit.assertEquals("Downloaded artifact name is different from uploaded one", UPLOAD_ARTIFACT_NAME, artifactUiDownloadData.getArtifactName());
+
+			// validate audit
+			ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = AuditValidationUtils.constructFieldsForAuditValidation(serviceDetails, serviceDetails.getVersion(), sdncUserDetails);
+			String auditAction = "ArtifactDownload";
+			expectedResourceAuditJavaObject.setAction(auditAction);
+			expectedResourceAuditJavaObject.setPrevState("");
+			expectedResourceAuditJavaObject.setPrevVersion("");
+			expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+			expectedResourceAuditJavaObject.setStatus("200");
+			expectedResourceAuditJavaObject.setDesc("OK");
+			expectedResourceAuditJavaObject.setArtifactData(AuditValidationUtils.buildArtifactDataAudit(origArtifact));
+			expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
+			expectedResourceAuditJavaObject.setPrevArtifactUuid("");
+			
+			AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+		} finally {
+//			RestResponse response = ServiceRestUtils.deleteService(serviceDetails, serviceVersion, sdncUserDetails );
+//			checkDeleteResponse(response);
+			httpclient.close();
+		}
+	}
+
+	@Test
+	public void downloadArtifactFromResourceNotFound() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+
+			String resourceId = resourceDetails.getUniqueId();
+			String artifactIdNotFound = "11111";
+
+			ArtifactDefinition origArtifact = new ArtifactDefinition();
+			origArtifact.setUniqueId(artifactIdNotFound);
+			
+			String url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, artifactIdNotFound);
+			HttpGet httpGet = createGetRequest(url);
+			CloseableHttpResponse response = httpclient.execute(httpGet);
+			int status = response.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("expected 404 not found", 404, status);
+
+			// validate audit
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
+			ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor.constructFieldsForAuditValidation(resourceDetails, resourceDetails.getVersion(), sdncUserDetails);
+			String auditAction = "ArtifactDownload";
+			expectedResourceAuditJavaObject.setAction(auditAction);
+			expectedResourceAuditJavaObject.setPrevState("");
+			expectedResourceAuditJavaObject.setPrevVersion("");
+			expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+			expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+			expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
+			expectedResourceAuditJavaObject.setArtifactData("");
+			expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
+			expectedResourceAuditJavaObject.setPrevArtifactUuid("");
+			AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+			expectedResourceAuditJavaObject.setPrevArtifactUuid(null);
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void downloadArtifactFromServiceNotFound() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+
+			String artifactIdNotFound = "11111";
+			ArtifactDefinition origArtifact = new ArtifactDefinition();
+			origArtifact.setUniqueId(artifactIdNotFound);
+
+			String url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceDetails.getUniqueId(), artifactIdNotFound);
+			HttpGet httpGet = createGetRequest(url);
+			CloseableHttpResponse response2 = httpclient.execute(httpGet);
+			int status = response2.getStatusLine().getStatusCode();
+			AssertJUnit.assertEquals("expected 404 not found", 404, status);
+
+			// validate audit
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
+			ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails, serviceDetails.getVersion(), sdncUserDetails);
+			String auditAction = "ArtifactDownload";
+			expectedResourceAuditJavaObject.setAction(auditAction);
+			expectedResourceAuditJavaObject.setPrevState("");
+			expectedResourceAuditJavaObject.setPrevVersion("");
+			expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+			expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+			expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
+			expectedResourceAuditJavaObject.setArtifactData("");
+			expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
+			expectedResourceAuditJavaObject.setPrevArtifactUuid("");
+			AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+		} finally {
+			httpclient.close();
+		}
+
+	}
+
+	@Test
+	public void addArtifactToResourceTest() throws Exception {
+
+		ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultArtifact();
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails, resourceDetails.getUniqueId());
+		int status = response.getErrorCode();
+		AssertJUnit.assertEquals("add informational artifact request returned status: " + response.getErrorCode(), 200, status);
+
+		RestResponse resourceResp = ResourceRestUtils.getResource(resourceDetails.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
+		AssertJUnit.assertNotNull(resource);
+
+		Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
+		boolean isExist = false;
+		for (Map.Entry<String, ArtifactDefinition> entry : artifacts.entrySet()) {
+			if (entry.getKey().equals(defaultArtifact.getArtifactLabel())) {
+				isExist = true;
+
+			}
+		}
+		AssertJUnit.assertTrue(isExist);
+	}
+	
+	
+	protected String createUploadArtifactBodyJson() {
+		Map<String, Object> jsonBody = new HashMap<String, Object>();
+		jsonBody.put("artifactName", UPLOAD_ARTIFACT_NAME);
+		jsonBody.put("artifactDisplayName", "configure");
+		jsonBody.put("artifactType", "SHELL");
+		jsonBody.put("mandatory", "false");
+		jsonBody.put("description", "ff");
+		jsonBody.put("payloadData", UPLOAD_ARTIFACT_PAYLOAD);
+		jsonBody.put("artifactLabel", "configure");
+		return gson.toJson(jsonBody);
+	}
+	
+	protected ArtifactDefinition getArtifactDataFromJson(String json) {
+		Gson gson = new Gson();
+		JsonObject jsonElement = new JsonObject();
+		jsonElement = gson.fromJson(json, jsonElement.getClass());
+		ArtifactDefinition artifact = new ArtifactDefinition(); 
+		String payload = null;
+		JsonElement artifactPayload = jsonElement.get(Constants.ARTIFACT_PAYLOAD_DATA);
+		if (artifactPayload != null && !artifactPayload.isJsonNull()) {
+			payload = artifactPayload.getAsString();
+		}
+		jsonElement.remove(Constants.ARTIFACT_PAYLOAD_DATA);
+		artifact = gson.fromJson(jsonElement, ArtifactDefinition.class);
+		artifact.setPayloadData(payload);
+		
+		/*atifact.setArtifactName(UPLOAD_ARTIFACT_NAME);
+artifact.setArtifactDisplayName("configure");
+artifact.setArtifactType("SHELL");
+artifact.setMandatory(false);
+artifact.setDescription("ff");
+artifact.setPayloadData(UPLOAD_ARTIFACT_PAYLOAD);
+artifact.setArtifactLabel("configure");*/
+		return artifact;
+	}
+	
+	protected HttpGet createGetRequest(String url) {
+		HttpGet httpGet = new HttpGet(url);
+		httpGet.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		httpGet.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		httpGet.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		return httpGet;
+	}
+	
+	protected String getArtifactUid(HttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		String artifactId = (String) responseMap.get("uniqueId");
+		return artifactId;
+	}
+	
+	protected String getArtifactEsId(HttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		String esId = (String) responseMap.get("EsId");
+		return esId;
+	}
+	
+	protected ArtifactDefinition addArtifactDataFromResponse(HttpResponse response, ArtifactDefinition artifact) throws HttpResponseException, IOException, ParseException {
+		//String responseString = new BasicResponseHandler().handleResponse(response);
+		HttpEntity entity = response.getEntity();
+		String responseString = EntityUtils.toString(entity);				
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		artifact.setEsId((String)responseMap.get("esId"));
+		artifact.setUniqueId((String) responseMap.get("uniqueId"));
+		artifact.setArtifactGroupType(ArtifactGroupTypeEnum.findType((String) responseMap.get("artifactGroupType")));
+		artifact.setTimeout(((Long) responseMap.get("timeout")).intValue());
+		return artifact;
+	}
+	
+	protected String getLifecycleArtifactUid(CloseableHttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		responseMap = (JSONObject) responseMap.get("implementation");
+		String artifactId = (String) responseMap.get("uniqueId");
+		return artifactId;
+	}
+	
+	protected HttpDelete createDeleteArtifactRequest(String url) {
+		HttpDelete httpDelete = new HttpDelete(url);
+		httpDelete.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		httpDelete.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		return httpDelete;
+	}
+	
+	protected HttpPost createPostAddArtifactRequeast(String jsonBody, String url, boolean addMd5Header) throws UnsupportedEncodingException {
+		HttpPost httppost = new HttpPost(url);
+		httppost.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		if (addMd5Header) {
+			httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody));
+		}
+		StringEntity input = new StringEntity(jsonBody);
+		input.setContentType("application/json");
+		httppost.setEntity(input);
+		log.debug("Executing request {}" , httppost.getRequestLine());
+		return httppost;
+	}
+	
+	protected String createLoadArtifactBody() {
+		Map<String, Object> json = new HashMap<String, Object>();
+		json.put("artifactName", "install_apache2.sh");
+		json.put("artifactType", "SHELL");
+		json.put("description", "ddd");
+		json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+		json.put("artifactLabel", "name123");
+		
+		String jsonStr = gson.toJson(json);
+		return jsonStr;
+	}
+	
+	protected void checkDeleteResponse(RestResponse response) {
+		BaseRestUtils.checkStatusCode(response, "delete request failed", false, 204, 404);
+	}
+	
+	protected ArtifactUiDownloadData getArtifactUiDownloadData(String artifactUiDownloadDataStr) throws Exception {
+		
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			ArtifactUiDownloadData artifactUiDownloadData = mapper.readValue(artifactUiDownloadDataStr, ArtifactUiDownloadData.class);
+			return artifactUiDownloadData;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java
new file mode 100644
index 0000000..e50d5b4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java
@@ -0,0 +1,192 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.HeatParameterDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+public class HeatEnvArtifact extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public HeatEnvArtifact() {
+		super(name, HeatEnvArtifact.class.getName());
+	}
+
+	@Test(enabled = true)
+	public void heatEnvOnResourceFormatTest() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csarHeatEnv.csar");
+		assertNotNull(createdResource);
+
+		RestResponse certifyState = LifecycleRestUtils.changeComponentState(createdResource, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		BaseRestUtils.checkSuccess(certifyState);
+
+		Resource certifiedResource = ResponseParser.parseToObjectUsingMapper(certifyState.getResponse(), Resource.class);
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService("ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncModifierDetails.getUserId());
+
+		// 2 create service
+		RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifierDetails);
+		ResourceRestUtils.checkCreateResponse(createServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(createServiceResponse.getResponse(), Service.class);
+
+		// 3 create vf instance in service
+		ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(certifiedResource);
+		RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, sdncModifierDetails, service);
+		ResourceRestUtils.checkCreateResponse(createComponentInstance);
+
+		RestResponse getService = ServiceRestUtils.getService(service.getUniqueId());
+		BaseRestUtils.checkSuccess(getService);
+		service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
+
+		List<ComponentInstance> componentInstances = service.getComponentInstances();
+		assertNotNull(componentInstances);
+		assertEquals(1, componentInstances.size());
+
+		ComponentInstance vfi = componentInstances.get(0);
+		Map<String, ArtifactDefinition> deploymentArtifacts = vfi.getDeploymentArtifacts();
+		assertNotNull(deploymentArtifacts);
+		assertEquals(4, deploymentArtifacts.size());
+		ArtifactDefinition heatEnv = deploymentArtifacts.get("heat0env");
+		assertNotNull(heatEnv);
+
+		Map<String, Object> yaml = downloadComponentInstanceYamlFile(service.getUniqueId(), vfi.getUniqueId(), sdncModifierDetails, heatEnv.getUniqueId());
+		assertNotNull(yaml);
+		Map<String, Object> paramters = (Map<String, Object>)yaml.get("parameters");
+		assertNotNull(paramters);
+		assertEquals(8, paramters.size());
+		assertEquals(null, paramters.get("param8"));
+		List<HeatParameterDataDefinition> heatParameters = heatEnv.getHeatParameters();
+		heatParameters.forEach(p -> {
+			assertEquals(p.getCurrentValue(), paramters.get(p.getName()));
+		});
+	}
+	@Test(enabled = true)
+	public void noHeatEnvOnResourceFormatTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csarHeatNoEnv.csar");
+		assertNotNull(createdResource);
+
+		RestResponse certifyState = LifecycleRestUtils.changeComponentState(createdResource, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		BaseRestUtils.checkSuccess(certifyState);
+
+		Resource certifiedResource = ResponseParser.parseToObjectUsingMapper(certifyState.getResponse(), Resource.class);
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService("ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncModifierDetails.getUserId());
+
+		// 2 create service
+		RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifierDetails);
+		ResourceRestUtils.checkCreateResponse(createServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(createServiceResponse.getResponse(), Service.class);
+
+		// 3 create vf instance in service
+		ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(certifiedResource);
+		RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, sdncModifierDetails, service);
+		ResourceRestUtils.checkCreateResponse(createComponentInstance);
+
+		RestResponse getService = ServiceRestUtils.getService(service.getUniqueId());
+		BaseRestUtils.checkSuccess(getService);
+		service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
+
+		List<ComponentInstance> componentInstances = service.getComponentInstances();
+		assertNotNull(componentInstances);
+		assertEquals(1, componentInstances.size());
+		
+		ComponentInstance vfi = componentInstances.get(0);
+		Map<String, ArtifactDefinition> deploymentArtifacts = vfi.getDeploymentArtifacts();
+		assertNotNull(deploymentArtifacts);
+		assertEquals(4, deploymentArtifacts.size());
+		ArtifactDefinition heatEnv = deploymentArtifacts.get("heat0env");
+		assertNotNull(heatEnv);
+
+		Map<String, Object> yaml = downloadComponentInstanceYamlFile(service.getUniqueId(), vfi.getUniqueId(), sdncModifierDetails, heatEnv.getUniqueId());
+		assertNotNull(yaml);
+		Map<String, Object> paramters = (Map<String, Object>)yaml.get("parameters");
+		assertNotNull(paramters);
+		assertEquals(8, paramters.size());
+		assertEquals(null, paramters.get("param1"));
+		assertEquals(null, paramters.get("param2"));
+		assertEquals(null, paramters.get("param4"));
+		assertEquals(null, paramters.get("param5"));
+		assertEquals(null, paramters.get("param7"));
+		assertEquals(null, paramters.get("param8"));
+		List<HeatParameterDataDefinition> heatParameters = heatEnv.getHeatParameters();
+		heatParameters.forEach(p -> {
+			assertEquals(p.getCurrentValue(), paramters.get(p.getName()));
+		});
+
+	}
+	//****************************************
+	private Map<String, Object> downloadComponentInstanceYamlFile(String serviceUniqueId, String resourceInstanceId, User user, String artifactUniqeId) throws Exception {
+		RestResponse heatEnvDownloadResponse = ArtifactRestUtils.downloadResourceInstanceArtifact(serviceUniqueId, resourceInstanceId, user, artifactUniqeId);
+		BaseRestUtils.checkSuccess(heatEnvDownloadResponse);
+
+		ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(heatEnvDownloadResponse.getResponse(), ArtifactUiDownloadData.class);
+		byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
+		byte[] decodeBase64 = Base64.decodeBase64(fromUiDownload);
+		Yaml yaml = new Yaml();
+
+		InputStream inputStream = new ByteArrayInputStream(decodeBase64);
+
+		Map<String, Object> load = (Map<String, Object>) yaml.load(inputStream);
+
+		return load;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java
new file mode 100644
index 0000000..0718fb6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java
@@ -0,0 +1,704 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+//import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.javatuples.Pair;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.datastax.driver.core.Row;
+
+import fj.data.Either;
+
+public class PlaceHolderValidations extends ComponentBaseTest {
+	private static Logger logger = LoggerFactory.getLogger(PlaceHolderValidations.class.getName());
+	private static final String heatExtension = "yaml";
+	// private static final String yangXmlExtension = "xml";
+	// private static final String muranoPkgExtension = "zip";
+	private final String folderName = "addHeatArtifactToServiceAndSertify";
+	private Resource resource;
+	private final int timeOut = 60;
+	private ArtifactReqDetails updateArtifactReqDetails = null;
+	protected User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	protected User sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
+	protected ResourceReqDetails resourceDetails1;
+	protected ResourceReqDetails resourceVF;
+	protected ResourceReqDetails resourceCP;
+	protected ResourceReqDetails resourceVL;
+
+	protected ArtifactReqDetails heatArtifactDetails;
+	protected ArtifactReqDetails heatVolArtifactDetails;
+	protected ArtifactReqDetails heatNetArtifactDetails;
+
+	public PlaceHolderValidations() {
+		super(name, PlaceHolderValidations.class.getName());
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	@BeforeMethod
+	public void init() throws IOException, Exception {
+
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatNetArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType());
+		heatVolArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_VOL.getType());
+		Resource resourceObject = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetails1 = new ResourceReqDetails(resourceObject);
+		resourceObject = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		resourceVF = new ResourceReqDetails(resourceObject);
+		resourceObject = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		resourceCP = new ResourceReqDetails(resourceObject);
+		resourceObject = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		resourceVL = new ResourceReqDetails(resourceObject);
+	}
+
+	@Test
+	public void validateDeploymentPlaceHoldersByConfig() throws IOException {
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
+		Resource resourceObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceObject.getDeploymentArtifacts();
+		assertNotNull("deploymentArtifacts list is null", deploymentArtifacts);
+		List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
+		for (String resDepArtType : listOfResDepArtTypesFromConfig) {
+			assertNotNull("placeholder of " + resDepArtType + " type doesn't exist",
+					deploymentArtifacts.get(resDepArtType));
+		}
+	}
+
+	private void validateToscaArtifactsBeforeAndAfterSFT(ResourceReqDetails resourceDetails)
+			throws IOException, Exception {
+		RestResponse componentResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails1);
+		Component component = ResponseParser.convertResourceResponseToJavaObject(componentResponse.getResponse());
+		Map<String, ArtifactDefinition> toscaArtifacts = component.getToscaArtifacts();
+		for (ArtifactDefinition artifact : toscaArtifacts.values()) {
+			assertNull(artifact.getEsId());
+		}
+
+		componentResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails1,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		component = ResponseParser.convertResourceResponseToJavaObject(componentResponse.getResponse());
+		toscaArtifacts = component.getToscaArtifacts();
+
+		for (ArtifactDefinition artifact : toscaArtifacts.values()) {
+			assertEquals(artifact.getEsId(), artifact.getUniqueId());
+			List<Pair<String, String>> fields = new ArrayList();
+			fields.add(new Pair<String, String>("id", artifact.getEsId()));
+			List<Row> fetchFromTable = CassandraUtils.fetchFromTableQuery("sdcartifact", "resources", fields);
+			assertTrue(1 == fetchFromTable.size());
+		}
+	}
+
+	@Test
+	public void validateToscaArtifactsBeforeAndAfterSFT() throws IOException, Exception {
+		// TODO ADD VF and Service
+		validateToscaArtifactsBeforeAndAfterSFT(resourceDetails1);
+		validateToscaArtifactsBeforeAndAfterSFT(resourceCP);
+		validateToscaArtifactsBeforeAndAfterSFT(resourceVL);
+	}
+
+	@Test
+	public void validateToscaPlaceHoldersByConfig() throws IOException, Exception {
+		List<Component> components = new ArrayList<>();
+		RestResponse componentGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
+		components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
+
+		componentGetResponse = ResourceRestUtils.getResource(resourceCP, sdncDesignerDetails1);
+		components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
+
+		componentGetResponse = ResourceRestUtils.getResource(resourceVF, sdncDesignerDetails1);
+		components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
+
+		componentGetResponse = ResourceRestUtils.getResource(resourceVL, sdncDesignerDetails1);
+		components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
+
+		Service service = AtomicOperationUtils
+				.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		componentGetResponse = ServiceRestUtils.getService(service.getUniqueId(),
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		components.add(ResponseParser.parseToObjectUsingMapper(componentGetResponse.getResponse(), Service.class));
+
+		for (Component component : components) {
+			Map<String, ArtifactDefinition> toscaArtifacts = component.getToscaArtifacts();
+			assertNotNull("toscaArtifacts list is null", toscaArtifacts);
+			List<String> listOfToscaArtTypesFromConfig = Utils.getListOfToscaArtLabels(true);
+			assertNotNull("tosca artifact types list is null", listOfToscaArtTypesFromConfig);
+			for (String toscaArtType : listOfToscaArtTypesFromConfig) {
+				assertNotNull("placeholder of " + toscaArtType + " type doesn't exist",
+						toscaArtifacts.get(toscaArtType));
+			}
+		}
+
+	}
+
+	// test check configuration of "displayName" field for "heat" type
+	// deployment artifact
+	@Test
+	public void validateDeploymentPlaceHoldersDescriptionOfHeatByConfig() throws IOException {
+
+		Map<String, Object> mapOfDepResArtTypesObjects = getMapOfDepResArtTypesObjects();
+		assertNotNull("deployment artifact types list is null", mapOfDepResArtTypesObjects);
+		Object object = mapOfDepResArtTypesObjects.get("heat");
+		if (object instanceof Map<?, ?>) {
+			Map<String, Object> map = (Map<String, Object>) object;
+			assertTrue(map.get("displayName").equals("Base HEAT Template"));
+		} else {
+			assertTrue("return object does not instance of map", false);
+		}
+	}
+
+	@Test
+	public void addDepResArtEachType() throws Exception {
+
+		String artType;
+
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
+		for (String iter : listOfResDepArtTypesFromConfig) {
+			artType = iter;
+			verifyDepArtPlaceHoldersByType(artType);
+		}
+	}
+
+	@Test
+	public void checkHeatParametersExistingForEachType() throws Exception {
+
+		String artType;
+
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
+		for (String iter : listOfResDepArtTypesFromConfig) {
+			artType = iter;
+			verifyDepArtPlaceHoldersByType(artType);
+			verifyHeatParametersExistance(artType, false);
+		}
+	}
+
+	@Test
+	public void checkHeatParametersExistingForSpecificType() throws Exception {
+
+		String artType;
+
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
+		for (String iter : listOfResDepArtTypesFromConfig) {
+			artType = iter;
+			if (heatArtifactDetails.getArtifactLabel().equals(iter)) {
+				verifyHeatParametersExistance(artType, true);
+			} else {
+				verifyHeatParametersExistance(artType, false);
+			}
+		}
+	}
+
+	@Test
+	public void addAndDeleteDepResArtEachType() throws Exception {
+
+		String artType;
+
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
+		addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
+		for (String iter : listOfResDepArtTypesFromConfig) {
+			artType = iter;
+			verifyDepArtPlaceHoldersByType(artType);
+		}
+		RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1,
+				sdncDesignerDetails1, LifeCycleStatesEnum.CHECKIN);
+		assertTrue("expected response code in CHECKIN 200", restResponseResource.getErrorCode() == 200);
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1, sdncDesignerDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertTrue("expected response code in CHECKOUT 200", restResponseResource.getErrorCode() == 200);
+
+		// delete all deployment artifacts
+		deleteDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
+		deleteDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
+		deleteDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
+		response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
+		for (String iter : listOfResDepArtTypesFromConfig) {
+			artType = iter;
+			verifyDepArtPlaceHoldersByType(artType);
+		}
+	}
+
+	@Test
+	public void addRemoveAddAgainArtifact() throws Exception {
+
+		// get MAP before upload artifact
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+
+		ArtifactDefinition artifactDefinition = deploymentArtifacts.get("heat");
+
+		// validate place holder exist
+		assertNotNull(artifactDefinition);
+
+		// add artifact
+		updateArtifactReqDetails = getUpdateArtifactDetails(ArtifactTypeEnum.HEAT.getType());
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
+				updateArtifactReqDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response:  "
+				+ addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 200);
+
+		ArtifactDefinition artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
+		ArtifactDefinition artDef1 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
+
+		// remove artifact
+		RestResponse deleteArtifactFromResource = ArtifactRestUtils.deleteInformationalArtifactFromResource(
+				resourceDetails1.getUniqueId(), updateArtifactReqDetails, sdncDesignerDetails1);
+		logger.debug(
+				"addInformationalArtifactToResource response:  " + deleteArtifactFromResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + deleteArtifactFromResource.getErrorCode(),
+				deleteArtifactFromResource.getErrorCode() == 200);
+
+		RestResponse getResourceResp = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
+
+		artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(deleteArtifactFromResource.getResponse());
+		assertTrue(artifactDefinitionResponseJavaObject.getArtifactName().isEmpty());
+		assertTrue(artifactDefinitionResponseJavaObject.getDescription().isEmpty());
+		assertTrue(artifactDefinitionResponseJavaObject.getArtifactChecksum().isEmpty());
+		assertTrue(artifactDefinitionResponseJavaObject.getEsId().isEmpty());
+		assertTrue(artifactDefinitionResponseJavaObject.getArtifactUUID().isEmpty());
+		assertNull(artifactDefinitionResponseJavaObject.getHeatParameters());
+
+		// add artifact again with different user
+		addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response:  "
+				+ addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 200);
+
+		artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
+		ArtifactDefinition artDef2 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
+
+		assertFalse("check artifact checksum", artDef1.getArtifactChecksum().equals(artDef2.getArtifactChecksum()));
+		assertTrue("check artifact EsId", artDef1.getEsId().equals(artDef2.getEsId()));
+		assertFalse("check artifact UUID", artDef1.getArtifactUUID().equals(artDef2.getArtifactUUID()));
+		assertTrue("check UserIdCreator", artDef1.getUserIdCreator().equals(artDef2.getUserIdCreator()));
+		assertTrue("check UserIdLastUpdater", artDef1.getUserIdLastUpdater().equals(artDef2.getUserIdLastUpdater()));
+	}
+
+	@Test
+	public void addUpdateArtifactByType() throws Exception {
+
+		// get MAP before upload artifact
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+
+		ArtifactDefinition artifactDefinition = deploymentArtifacts.get("heat");
+
+		// validate place holder exist
+		assertNotNull(artifactDefinition);
+
+		// add artifact
+		updateArtifactReqDetails = getUpdateArtifactDetails(ArtifactTypeEnum.HEAT.getType());
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
+				updateArtifactReqDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response:  "
+				+ addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 200);
+
+		ArtifactDefinition artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
+		ArtifactDefinition artDef1 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
+
+		RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1,
+				sdncDesignerDetails1, LifeCycleStatesEnum.CHECKIN);
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1, sdncDesignerDetails2,
+				LifeCycleStatesEnum.CHECKOUT);
+
+		// update with different user artifact
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setUniqueId(artifactDefinition.getUniqueId());
+		heatArtifactDetails.setArtifactName("2.yaml");
+		heatArtifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
+
+		addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails2, resourceDetails1.getUniqueId(), "heat");
+		logger.debug("addInformationalArtifactToResource response:  "
+				+ addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 200);
+
+		artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
+		ArtifactDefinition artDef2 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
+		verifyArtDefFields(artDef1, artDef2);
+
+	}
+
+	@Test
+	public void addUpdateDeleteArtifact() throws Exception {
+
+		// get MAP before upload artifact
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+
+		ArtifactDefinition artifactDefinition = deploymentArtifacts.get("heat");
+
+		// validate place holder exist
+		assertNotNull(artifactDefinition);
+
+		updateArtifactReqDetails = getUpdateArtifactDetails(ArtifactTypeEnum.HEAT.getType());
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
+				updateArtifactReqDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
+		logger.debug("addInformationalArtifactToResource response:  "
+				+ addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 200);
+
+		ArtifactDefinition artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
+		ArtifactDefinition artDef1 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
+
+		RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1,
+				sdncDesignerDetails1, LifeCycleStatesEnum.CHECKIN);
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1, sdncDesignerDetails2,
+				LifeCycleStatesEnum.CHECKOUT);
+
+		// update with different user artifact
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setArtifactName("2.yaml");
+
+		addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails2, resourceDetails1.getUniqueId(), "heat");
+		logger.debug("addInformationalArtifactToResource response:  "
+				+ addInformationalArtifactToResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 200);
+
+		artifactDefinitionResponseJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
+		ArtifactDefinition artDef2 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
+
+		verifyArtDefFields(artDef1, artDef2);
+
+		RestResponse delteArtifactFromResource = ArtifactRestUtils.deleteInformationalArtifactFromResource(
+				resourceDetails1.getUniqueId(), heatArtifactDetails, sdncDesignerDetails2);
+		logger.debug("addInformationalArtifactToResource response: {}", delteArtifactFromResource.getResponseMessage());
+		assertTrue("response code is not 200, returned :" + delteArtifactFromResource.getErrorCode(),
+				delteArtifactFromResource.getErrorCode() == 200);
+
+	}
+
+	@Test
+	public void addHeatVolArtInvalidExtension() throws Exception {
+
+		heatVolArtifactDetails.setArtifactName("heatVol.txt");
+		RestResponse response = getResponseOnAddDeploymentArtifactByTypeToResource(resourceDetails1,
+				heatVolArtifactDetails);
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name());
+		assertEquals("Check response code after upload artifact", errorInfo.getCode(), response.getErrorCode());
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT_VOL.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name(), variables,
+				response.getResponse());
+	}
+
+	@Test
+	public void addHeatNetArtInvalidExtension() throws Exception {
+
+		heatNetArtifactDetails.setArtifactName("yaml");
+		RestResponse response = getResponseOnAddDeploymentArtifactByTypeToResource(resourceDetails1,
+				heatNetArtifactDetails);
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name());
+		assertEquals("Check response code after upload artifact", errorInfo.getCode(), response.getErrorCode());
+		List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT_NET.getType());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name(), variables,
+				response.getResponse());
+	}
+
+	@Test
+	public void checkServiceSecurityTemplateInformationalArtifactsCreation() throws IOException, Exception {
+
+		Either<Service, RestResponse> createServiceResponse = AtomicOperationUtils
+				.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true);
+		Map<String, ArtifactDefinition> artifacts = null;
+		ArtifactDefinition securitytemplate = null;
+		if (createServiceResponse.isLeft()) {
+			Component component = createServiceResponse.left().value();
+			artifacts = component.getArtifacts();
+			securitytemplate = artifacts.get("servicesecuritytemplate");
+			assertNotNull(securitytemplate);
+			assertEquals("Service Security Template", securitytemplate.getArtifactDisplayName());
+		} else {
+			logger.debug("checkSecurityTemplateInformationalArtifactsCreation service creation response:  "
+					+ createServiceResponse.right().value().getResponseMessage());
+		}
+	}
+
+	@Test
+	public void checkResourceSecurityTemplateInformationalArtifactsCreation() throws IOException, Exception {
+
+		Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.CONTAINER_APPLICATION, ResourceCategoryEnum.APPLICATION_L4_BORDER,
+				UserRoleEnum.DESIGNER, true).left().value();
+		Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
+		ArtifactDefinition securitytemplate = artifacts.get("resourcesecuritytemplate");
+		assertNotNull(securitytemplate);
+		assertEquals("Resource Security Template", securitytemplate.getArtifactDisplayName());
+	}
+
+	// Benny
+	@Test
+	public void serviceSecurityTemplateInformationalArtifact() throws IOException, Exception {
+		String artifactPlaceHolder = "servicesecuritytemplate";
+		Service service = AtomicOperationUtils
+				.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		Map<String, ArtifactDefinition> artifacts = service.getArtifacts();
+		ArtifactDefinition securitytemplate = artifacts.get(artifactPlaceHolder);
+		assertNotNull(securitytemplate);
+		assertEquals("Service Security Template", securitytemplate.getArtifactDisplayName());
+		assertEquals("OTHER", securitytemplate.getArtifactType());
+		assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
+		// Get service
+		RestResponse getService = ServiceRestUtils.getService(service.getUniqueId(),
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, getService.getErrorCode().intValue());
+		service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
+		artifacts = service.getArtifacts();
+		securitytemplate = artifacts.get(artifactPlaceHolder);
+		assertNotNull(securitytemplate);
+		assertEquals("Service Security Template", securitytemplate.getArtifactDisplayName());
+		assertEquals("OTHER", securitytemplate.getArtifactType());
+		assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
+	}
+
+	@Test
+	public void resourceSecurityTemplateInformationalArtifacts() throws IOException, Exception {
+		String artifactPlaceHolder = "resourcesecuritytemplate";
+		Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.CONTAINER_APPLICATION, ResourceCategoryEnum.APPLICATION_L4_BORDER,
+				UserRoleEnum.DESIGNER, true).left().value();
+		Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
+		ArtifactDefinition securitytemplate = artifacts.get("resourcesecuritytemplate");
+		assertNotNull(securitytemplate);
+		assertEquals("Resource Security Template", securitytemplate.getArtifactDisplayName());
+		assertEquals("OTHER", securitytemplate.getArtifactType());
+		assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
+		// Get resource
+		RestResponse getresource = ResourceRestUtils.getResource(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				resource.getUniqueId());
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, getresource.getErrorCode().intValue());
+		resource = ResponseParser.parseToObjectUsingMapper(getresource.getResponse(), Resource.class);
+		artifacts = resource.getArtifacts();
+		securitytemplate = artifacts.get(artifactPlaceHolder);
+		assertNotNull(securitytemplate);
+		assertEquals("Resource Security Template", securitytemplate.getArtifactDisplayName());
+		assertEquals("OTHER", securitytemplate.getArtifactType());
+		assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
+	}
+
+	// ================================================
+
+	@SuppressWarnings("unchecked")
+	private Map<String, Object> getMapOfDepResArtTypesObjects() throws FileNotFoundException {
+
+		return (Map<String, Object>) Utils.parseYamlConfig("deploymentResourceArtifacts");
+
+	}
+
+	private void addDeploymentArtifactByTypeToResource(ResourceReqDetails resourceReqDetails,
+			ArtifactReqDetails artReqDetails) throws IOException, Exception {
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(artReqDetails,
+				sdncDesignerDetails1, resourceReqDetails.getUniqueId());
+		assertTrue("add" + artReqDetails.getArtifactLabel() + " artifact to resource request returned status:"
+				+ response.getErrorCode(), response.getErrorCode() == 200);
+	}
+
+	private RestResponse getResponseOnAddDeploymentArtifactByTypeToResource(ResourceReqDetails resourceReqDetails,
+			ArtifactReqDetails artReqDetails) throws IOException, Exception {
+
+		return ArtifactRestUtils.addInformationalArtifactToResource(artReqDetails, sdncDesignerDetails1,
+				resourceReqDetails.getUniqueId());
+	}
+
+	private void deleteDeploymentArtifactByTypeToResource(ResourceReqDetails resourceReqDetails,
+			ArtifactReqDetails artReqDetails) throws IOException, Exception {
+
+		RestResponse response = ArtifactRestUtils.deleteInformationalArtifactFromResource(
+				resourceReqDetails.getUniqueId(), artReqDetails, sdncDesignerDetails1);
+		assertTrue("delete" + artReqDetails.getArtifactLabel() + " artifact to resource request returned status:"
+				+ response.getErrorCode(), response.getErrorCode() == 200);
+	}
+
+	private void verifyDepArtPlaceHoldersByType(String artType) {
+
+		Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
+		assertNotNull("deployment artifact data is null", deploymentArtifacts.get(artType));
+		assertNotNull("deployment artifact data is null", deploymentArtifacts.get(artType).getEsId());
+		assertNotNull("deployment artifact data is null", deploymentArtifacts.get(artType).getDescription());
+		assertTrue(
+				"deployment artifact timeout does not equal to default value " + timeOut + " expected " + timeOut
+						+ ", actual - " + deploymentArtifacts.get(artType).getTimeout(),
+				deploymentArtifacts.get(artType).getTimeout() == timeOut);
+		assertTrue("deployment artifact label value ",
+				deploymentArtifacts.get(artType).getArtifactLabel().equals(artType));
+	}
+
+	private void verifyHeatParametersExistance(String artType, Boolean isNull) {
+		Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
+		if (isNull) {
+			assertNull("heatParameters list for type " + artType + " is not null",
+					deploymentArtifacts.get(artType).getHeatParameters());
+		} else {
+			assertNotNull("heatParameters list for type " + artType + " is null",
+					deploymentArtifacts.get(artType).getHeatParameters());
+		}
+	}
+
+	private void verifyArtDefFields(ArtifactDefinition artDef1, ArtifactDefinition artDef2) {
+
+		assertFalse("check artifact checksum", artDef1.getArtifactChecksum().equals(artDef2.getArtifactChecksum()));
+		assertFalse("check artifact EsId", artDef1.getEsId().equals(artDef2.getEsId()));
+		assertFalse("check artifact UUID", artDef1.getArtifactUUID().equals(artDef2.getArtifactUUID()));
+		assertTrue("check UserIdCreator", artDef1.getUserIdCreator().equals(artDef2.getUserIdCreator()));
+		assertFalse("check UserIdLastUpdater", artDef1.getUserIdLastUpdater().equals(artDef2.getUserIdLastUpdater()));
+
+	}
+
+	private ArtifactDefinition fillArtDefFromResponse(ArtifactDefinition artifactDefinitionResponseJavaObject) {
+		ArtifactDefinition artDef = new ArtifactDefinition();
+		artDef.setArtifactChecksum(artifactDefinitionResponseJavaObject.getArtifactChecksum());
+		artDef.setEsId(artifactDefinitionResponseJavaObject.getEsId());
+		artDef.setArtifactUUID(artifactDefinitionResponseJavaObject.getArtifactUUID());
+		artDef.setUserIdCreator(artifactDefinitionResponseJavaObject.getUserIdCreator());
+		artDef.setUserIdLastUpdater(artifactDefinitionResponseJavaObject.getUserIdLastUpdater());
+		return artDef;
+	}
+
+	private ArtifactReqDetails getUpdateArtifactDetails(String artType) throws IOException, Exception {
+		String ext = heatExtension;
+		String sourceDir = config.getResourceConfigDir();
+		String testResourcesPath = sourceDir + File.separator + folderName;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		logger.debug("listFileName: {}", listFileName.toString());
+
+		String payload = FileUtils.loadPayloadFile(listFileName, ext, true);
+		ArtifactReqDetails updateArtifactReqDetails = ElementFactory.getDefaultDeploymentArtifactForType(artType);
+		updateArtifactReqDetails.setPayload(payload);
+		updateArtifactReqDetails.setArtifactName("1.yaml");
+		return updateArtifactReqDetails;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java
new file mode 100644
index 0000000..6b902db
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateArtResponse.java
@@ -0,0 +1,632 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.HeatParameterDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Decoder;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+public class ValidateArtResponse extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+	protected String serviceVersion;
+
+	public ValidateArtResponse() {
+		super(name, ArtifactServletTest.class.getName());
+
+	}
+
+	protected final String pathToFile = "heatArtifactParameters";
+	protected final String heatWithValidParams = "heatWithValidParams.yaml";
+	protected final String heatWithParamsMissingDefault = "heatWithParamsMissingDefault.yaml";
+	protected final String heatWithParamsMissingDesc = "heatWithParamsMissingDesc.yaml";
+	protected final String heatWithParamsMissingType = "heatWithParamsMissingType.yaml";
+	protected final String importNoDerivedFromFile = "myComputeDerivedFromNotExists.yml";
+	protected final String decodedPayload = "decodedPayload";
+	protected final String encodedPayload = "encodedPayload";
+
+	protected Resource resourceDetailsObj;
+	protected ResourceReqDetails resourceDetails;
+	protected User sdncDesignerDetails;
+
+	@BeforeMethod
+	public void init() throws Exception {
+
+		resourceDetailsObj = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetails = new ResourceReqDetails(resourceDetailsObj);
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+	}
+
+	@Test
+	public void compareParamtersVsYaml() throws Exception {
+
+		// select file to upload
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithValidParams);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// create MAP from received JSON
+
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	protected void assertnull(String string, boolean equals) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public Map<String, String> extractSingleParameter(Map<String, String> curr) {
+		Map<String, String> innerMap = new HashMap<String, String>();
+		if (curr.containsKey("description")) {
+			innerMap.put("description", curr.get("description"));
+		}
+
+		if (curr.containsKey("defaultValue")) {
+			innerMap.put("default", curr.get("defaultValue"));
+		} else {
+			// System.out.println("kuku");
+		}
+		innerMap.put("type", curr.get("type"));
+		return innerMap;
+	}
+
+	public Map<String, Map> createMapFromYaml(String payload) {
+		ArrayList<String> parametersList = new ArrayList<String>();
+
+		Yaml yaml = new Yaml();
+
+		Map<String, Map> result = (Map<String, Map>) yaml.load(payload);
+		Map<String, Map> paramters = (Map<String, Map>) result.get("parameters");
+
+		for (Map.Entry<String, Map> entry : paramters.entrySet()) {
+			Map<String, String> origInnerMap = (Map<String, String>) entry.getValue();
+
+			if (origInnerMap.containsKey("label")) {
+				origInnerMap.remove("label");
+				paramters.remove(entry);
+				paramters.put(entry.getKey(), origInnerMap);
+			}
+		}
+		return paramters;
+	}
+
+	public Map<String, Map<String, String>> jsonToMap(RestResponse addInformationalArtifactToResource,
+			String section2extract, String createKeyMapBy) {
+		Map<String, Object> JsonToMap = new HashMap<String, Object>();
+		JsonToMap = (Map<String, Object>) ResponseParser.parseToObject(addInformationalArtifactToResource.getResponse(),
+				JsonToMap.getClass());
+
+		List<Map<String, String>> listOfParamters = (List<Map<String, String>>) JsonToMap.get(section2extract);
+		Map<String, Map<String, String>> mapOfActualParameters = new HashMap<String, Map<String, String>>();
+
+		for (Map<String, String> curr : listOfParamters) {
+			Map<String, String> innerMap = extractSingleParameter(curr);
+
+			mapOfActualParameters.put(curr.get(createKeyMapBy), innerMap);
+		}
+		return mapOfActualParameters;
+	}
+
+	public Map<String, String> selectFileToUpload(String pathToFile, String fileName) throws IOException {
+		String sourceDir = config.getResourceConfigDir();
+		String testResourcesPath = sourceDir + File.separator + pathToFile;
+		String file = fileName;
+		Map<String, String> filePayload = new HashMap<String, String>();
+		String payload = Decoder.readFileToString(testResourcesPath + File.separator + file);
+		filePayload.put(decodedPayload, payload);
+		filePayload.put(encodedPayload, Decoder.encode(payload.getBytes()));
+
+		return filePayload;
+	}
+
+	@Test
+	public void missingDescParam() throws Exception {
+
+		// select file to upload
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithParamsMissingDesc);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// create MAP from received JSON
+
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	@Test
+	public void missingDefaultParam() throws Exception {
+
+		// select file to upload
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithParamsMissingDefault);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// create MAP from received JSON
+
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	@Test
+	public void missingTypeParam() throws Exception {
+
+		// select file to upload
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithParamsMissingType);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// System.out.println(addInformationalArtifactToResource);
+		AssertJUnit.assertTrue(
+				"response code is not 400, returned :" + addInformationalArtifactToResource.getErrorCode(),
+				addInformationalArtifactToResource.getErrorCode() == 400);
+
+	}
+
+	@Test
+	public void updateValueParam() throws Exception {
+
+		String updateValueParam = "changed";
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithValidParams);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+		// System.out.println(resourceGetResponse.getResponse().toString());
+		String atifactUniqueId = ResponseParser
+				.getValueFromJsonResponse(addInformationalArtifactToResource.getResponse(), "uniqueId");
+
+		ArtifactReqDetails artifacJavaObject = ResponseParser
+				.convertArtifactReqDetailsToJavaObject(addInformationalArtifactToResource.getResponse());
+		List<HeatParameterDefinition> heatParameters2 = artifacJavaObject.getHeatParameters();
+
+		for (HeatParameterDefinition heatParameterDefinition : heatParameters2) {
+			heatParameterDefinition.setCurrentValue(updateValueParam);
+		}
+		artifacJavaObject.setHeatParameters(heatParameters2);
+		artifacJavaObject.setPayloadData(null);
+
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateDeploymentArtifactToResource(
+				artifacJavaObject, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// verify change in update response
+
+		ArtifactDefinition ArtifactDefinitionRespJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(updateInformationalArtifactToResource.getResponse());
+		List<HeatParameterDataDefinition> heatParameters = ArtifactDefinitionRespJavaObject.getHeatParameters();
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			String verify = updateValueParam;
+			AssertJUnit.assertTrue("verification failed", verify.equals(heatParameterDefinition.getCurrentValue()));
+		}
+
+		// verify change in getResource
+
+		resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+		deploymentArtifacts.get(heatArtifactDetails.getArtifactName());
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			String verify = updateValueParam;
+			AssertJUnit.assertTrue("verification failed", verify.equals(heatParameterDefinition.getCurrentValue()));
+		}
+
+		// create MAP from received JSON
+
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	@Test
+	public void updateValueParamMissingDefault() throws Exception {
+
+		String updateValueParam = "changed";
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithParamsMissingDefault);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+		// System.out.println(resourceGetResponse.getResponse().toString());
+		String atifactUniqueId = ResponseParser
+				.getValueFromJsonResponse(addInformationalArtifactToResource.getResponse(), "uniqueId");
+
+		ArtifactReqDetails artifacJavaObject = ResponseParser
+				.convertArtifactReqDetailsToJavaObject(addInformationalArtifactToResource.getResponse());
+		List<HeatParameterDefinition> heatParameters2 = artifacJavaObject.getHeatParameters();
+
+		for (HeatParameterDefinition heatParameterDefinition : heatParameters2) {
+			heatParameterDefinition.setCurrentValue(updateValueParam);
+		}
+		artifacJavaObject.setHeatParameters(heatParameters2);
+		artifacJavaObject.setPayloadData(null);
+
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateDeploymentArtifactToResource(
+				artifacJavaObject, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// verify change in update response
+
+		ArtifactDefinition ArtifactDefinitionRespJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(updateInformationalArtifactToResource.getResponse());
+		List<HeatParameterDataDefinition> heatParameters = ArtifactDefinitionRespJavaObject.getHeatParameters();
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			String verify = updateValueParam;
+			AssertJUnit.assertTrue("verification failed", verify.equals(heatParameterDefinition.getCurrentValue()));
+		}
+
+		// verify change in getResource
+
+		resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+		deploymentArtifacts.get(heatArtifactDetails.getArtifactName());
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			String verify = updateValueParam;
+			AssertJUnit.assertTrue("verification failed", verify.equals(heatParameterDefinition.getCurrentValue()));
+		}
+
+		// create MAP from received JSON
+
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	@Test
+	public void updateValueParamNull() throws Exception {
+
+		String updateValueParam = null;
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithValidParams);
+
+		// upload HEAT file and save JSON response
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+		// System.out.println(resourceGetResponse.getResponse().toString());
+		String atifactUniqueId = ResponseParser
+				.getValueFromJsonResponse(addInformationalArtifactToResource.getResponse(), "uniqueId");
+
+		ArtifactReqDetails artifacJavaObject = ResponseParser
+				.convertArtifactReqDetailsToJavaObject(addInformationalArtifactToResource.getResponse());
+		List<HeatParameterDefinition> heatParameters2 = artifacJavaObject.getHeatParameters();
+
+		for (HeatParameterDefinition heatParameterDefinition : heatParameters2) {
+			heatParameterDefinition.setCurrentValue(updateValueParam);
+		}
+		artifacJavaObject.setHeatParameters(heatParameters2);
+		artifacJavaObject.setPayloadData(null);
+
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateDeploymentArtifactToResource(
+				artifacJavaObject, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// verify change in update response
+		ArtifactDefinition ArtifactDefinitionRespJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(updateInformationalArtifactToResource.getResponse());
+		List<HeatParameterDataDefinition> heatParameters = ArtifactDefinitionRespJavaObject.getHeatParameters();
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			// String verify = updateValueParam;
+			if (heatParameterDefinition.getDefaultValue() != null) {
+				AssertJUnit.assertTrue(
+						heatParameterDefinition.getDefaultValue().equals(heatParameterDefinition.getCurrentValue()));
+			} else {
+				AssertJUnit.assertNull("verification failed", heatParameterDefinition.getCurrentValue());
+			}
+		}
+
+		// verify change in getResource
+		resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+		deploymentArtifacts.get(heatArtifactDetails.getArtifactName());
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			// String verify = updateValueParam;
+			if (heatParameterDefinition.getDefaultValue() != null) {
+				AssertJUnit.assertTrue(
+						heatParameterDefinition.getDefaultValue().equals(heatParameterDefinition.getCurrentValue()));
+			} else {
+				AssertJUnit.assertNull("verification failed", heatParameterDefinition.getCurrentValue());
+			}
+		}
+
+		// create MAP from received JSON
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	@Test
+	public void updateValueParamEmpty() throws Exception {
+
+		String updateValueParam = "";
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithValidParams);
+
+		// upload HEAT file and save JSON response
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+		// System.out.println(resourceGetResponse.getResponse().toString());
+		String atifactUniqueId = ResponseParser
+				.getValueFromJsonResponse(addInformationalArtifactToResource.getResponse(), "uniqueId");
+
+		ArtifactReqDetails artifacJavaObject = ResponseParser
+				.convertArtifactReqDetailsToJavaObject(addInformationalArtifactToResource.getResponse());
+		List<HeatParameterDefinition> heatParameters2 = artifacJavaObject.getHeatParameters();
+
+		for (HeatParameterDefinition heatParameterDefinition : heatParameters2) {
+			heatParameterDefinition.setCurrentValue(updateValueParam);
+		}
+		artifacJavaObject.setHeatParameters(heatParameters2);
+		artifacJavaObject.setPayloadData(null);
+
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateDeploymentArtifactToResource(
+				artifacJavaObject, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		// verify change in update response
+
+		ArtifactDefinition ArtifactDefinitionRespJavaObject = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(updateInformationalArtifactToResource.getResponse());
+		List<HeatParameterDataDefinition> heatParameters = ArtifactDefinitionRespJavaObject.getHeatParameters();
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			String verify = updateValueParam;
+			AssertJUnit.assertTrue("verification failed", verify.equals(heatParameterDefinition.getCurrentValue()));
+		}
+
+		// verify change in getResource
+
+		resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+		deploymentArtifacts.get(heatArtifactDetails.getArtifactName());
+		for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+			String verify = updateValueParam;
+			AssertJUnit.assertTrue("verification failed", verify.equals(heatParameterDefinition.getCurrentValue()));
+		}
+
+		// create MAP from received JSON
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+	@Test
+	public void onlyValueParamPermited() throws Exception {
+
+		Map<String, String> filePayload = selectFileToUpload(pathToFile, heatWithValidParams);
+
+		// upload HEAT file and save JSON response
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatArtifactDetails.setPayload(filePayload.get(encodedPayload));
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+		// System.out.println(resourceGetResponse.getResponse().toString());
+		String atifactUniqueId = ResponseParser
+				.getValueFromJsonResponse(addInformationalArtifactToResource.getResponse(), "uniqueId");
+
+		ArtifactReqDetails artifacJavaObject = ResponseParser
+				.convertArtifactReqDetailsToJavaObject(addInformationalArtifactToResource.getResponse());
+		List<HeatParameterDefinition> heatParameters2 = artifacJavaObject.getHeatParameters();
+
+		for (HeatParameterDefinition heatParameterDefinition : heatParameters2) {
+			heatParameterDefinition.setDefaultValue("changed");
+			heatParameterDefinition.setName("changed");
+			heatParameterDefinition.setDescription("changed");
+			heatParameterDefinition.setType("changed");
+			heatParameterDefinition.setCurrentValue("changed");
+		}
+		artifacJavaObject.setHeatParameters(heatParameters2);
+		artifacJavaObject.setPayloadData(null);
+
+		RestResponse updateInformationalArtifactToResource = ArtifactRestUtils.updateDeploymentArtifactToResource(
+				artifacJavaObject, sdncDesignerDetails, resourceDetails.getUniqueId());
+
+		resourceGetResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails);
+
+		// create MAP from received JSON
+
+		String section2extract = "heatParameters";
+		String createKeyMapBy = "name";
+		Map<String, Map<String, String>> mapOfActualParameters = jsonToMap(addInformationalArtifactToResource,
+				section2extract, createKeyMapBy);
+
+		// Prepare map to validate JS
+
+		Map<String, Map> paramters = createMapFromYaml(filePayload.get(decodedPayload));
+
+		// compare MAPs
+
+		ResourceValidationUtils.compareElements(mapOfActualParameters, paramters);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java
new file mode 100644
index 0000000..dfbf035
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java
@@ -0,0 +1,177 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.artifacts;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.HeatParameterDefinition;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.RespJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ArtifactValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+
+public class ValidateHeatArtFieldsTypes extends ComponentBaseTest {
+
+	protected User sdncDesignerDetails;
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+
+	private static final String heatExtension = "yaml";
+	private static final String yangXmlExtension = "xml";
+	private static final String muranoPkgExtension = "zip";
+	private final String folderName = "yamlFieldsValidation";
+
+	private final String uuidString = RespJsonKeysEnum.UUID.getRespJsonKeyName().toString();
+
+	public ValidateHeatArtFieldsTypes() {
+		super(name, ValidateHeatArtFieldsTypes.class.getName());
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	@Test
+	public void validateHeatArtFiledTypes() throws Exception {
+
+		// get relevant resource and service
+
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		resourceDetails = ElementFactory.getDefaultResource();
+
+		RestResponse response = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
+		AssertJUnit.assertTrue("create request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 201);
+
+		// add artifact to resource1
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		List<String> listOfArtifactFromFolder = ArtifactValidationUtils.getListOfArtifactFromFolder(folderName);
+		for (int i = 0; i < listOfArtifactFromFolder.size(); i++) {
+			heatArtifactDetails = ArtifactValidationUtils.replaceDefaultArtWithArtFromList(heatArtifactDetails,
+					heatExtension, folderName, i);
+			response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails,
+					resourceDetails.getUniqueId());
+
+			if (heatArtifactDetails.getArtifactName().contains("bool")) {
+				if (heatArtifactDetails.getArtifactName().contains("negative")) {
+					// validate negative response
+					List<String> variables = Arrays.asList("HEAT", "boolean", "city_name");
+					ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_VALUE.name(),
+							variables, response.getResponse());
+				}
+				if (heatArtifactDetails.getArtifactName().contains("positive")) {
+					AssertJUnit.assertTrue(
+							"add HEAT artifact to resource request returned status:" + response.getErrorCode()
+									+ " fileName: " + heatArtifactDetails.getArtifactName(),
+							response.getErrorCode() == 200);
+					ArtifactDefinition artifactDefinitionJavaObject = ResponseParser
+							.convertArtifactDefinitionResponseToJavaObject(response.getResponse());
+					List<HeatParameterDataDefinition> heatParameters = artifactDefinitionJavaObject.getHeatParameters();
+					String currentValue = null;
+					for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
+						if (heatParameterDefinition.getName().equals("city_name")) {
+							currentValue = heatParameterDefinition.getCurrentValue();
+						}
+					}
+					if (heatArtifactDetails.getArtifactName().contains("true")) {
+						AssertJUnit.assertTrue(currentValue.equals("true"));
+					}
+					if (heatArtifactDetails.getArtifactName().contains("false")) {
+						AssertJUnit.assertTrue(currentValue.equals("false"));
+					}
+					RestResponse deleteInformationalArtifactFromResource = ArtifactRestUtils
+							.deleteInformationalArtifactFromResource(resourceDetails.getUniqueId(), heatArtifactDetails,
+									sdncDesignerDetails);
+					AssertJUnit.assertTrue(
+							"delete HEAT artifact from resource request returned status:"
+									+ deleteInformationalArtifactFromResource.getErrorCode(),
+							deleteInformationalArtifactFromResource.getErrorCode() == 200);
+				}
+
+			} else if (heatArtifactDetails.getArtifactName().contains("number")) {
+				if (heatArtifactDetails.getArtifactName().contains("negative")) {
+					// validate negative response
+					List<String> variables = Arrays.asList("HEAT", "number", "city_name");
+					ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_VALUE.name(),
+							variables, response.getResponse());
+				}
+				if (heatArtifactDetails.getArtifactName().contains("positive")) {
+					AssertJUnit.assertTrue(
+							"add HEAT artifact to resource request returned status:" + response.getErrorCode()
+									+ " fileName: " + heatArtifactDetails.getArtifactName(),
+							response.getErrorCode() == 200);
+				}
+
+			} else if (heatArtifactDetails.getArtifactName().contains("string")) {
+				if (heatArtifactDetails.getArtifactName().contains("negative")) {
+					// validate negative response
+					List<String> variables = Arrays.asList("HEAT", "string", "city_name");
+					ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_VALUE.name(),
+							variables, response.getResponse());
+				}
+				if (heatArtifactDetails.getArtifactName().contains("positive")) {
+					AssertJUnit.assertTrue(
+							"add HEAT artifact to resource request returned status:" + response.getErrorCode()
+									+ " fileName: " + heatArtifactDetails.getArtifactName(),
+							response.getErrorCode() == 200);
+				}
+
+			}
+
+			else if (heatArtifactDetails.getArtifactName().contains("unsupported")) {
+
+				// validate negative response
+				List<String> variables = Arrays.asList("HEAT", "number123");
+				ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_TYPE.name(),
+						variables, response.getResponse());
+
+			}
+
+			else {
+				AssertJUnit.assertTrue(
+						"add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+						response.getErrorCode() == 200);
+			}
+		}
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java
new file mode 100644
index 0000000..b1d04ba
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.attribute;
+
+import static org.junit.Assert.assertEquals;
+import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.swallowException;
+
+import java.io.File;
+import java.util.function.Function;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+public class ComponentInstanceAttributeTest extends ComponentBaseTest {
+
+	public static Gson gson = new GsonBuilder().setPrettyPrinting().create();
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ComponentInstanceAttributeTest() {
+		super(name, ComponentInstanceAttributeTest.class.getName());
+	}
+
+	@Test
+	public void testUpdateAttributeOnResourceInstance() {
+		// Prepare VF with vfc instance with Attributes
+		String testResourcesPath = config.getResourceConfigDir() + File.separator + "importToscaResourceByCreateUrl";
+		final Resource vfcWithAttributes = AtomicOperationUtils
+				.importResource(testResourcesPath, "CPWithAttributes.yml").left().value();
+		swallowException(() -> AtomicOperationUtils.changeComponentState(vfcWithAttributes, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CHECKIN, false));
+		Resource vf = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, false)
+				.left().value();
+		ComponentInstance vfcInstance = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfcWithAttributes, vf).left().value();
+
+		// util method to get the specific attribute from the vf
+		Function<Resource, ComponentInstanceProperty> attributeGetter = resourceVf -> resourceVf
+				.getComponentInstancesAttributes().values().iterator().next().stream()
+				.filter(att -> att.getName().equals("private_address")).findAny().get();
+		// update attribute on vfc instance
+		final Resource vfWithInsatncePreUpdate = swallowException(
+				() -> (Resource) AtomicOperationUtils.getCompoenntObject(vf, UserRoleEnum.DESIGNER));
+		ComponentInstanceProperty attributeOfRI = attributeGetter.apply(vfWithInsatncePreUpdate);
+		final String newAttValue = "NewValue";
+		attributeOfRI.setValue(newAttValue);
+		String body = gson.toJson(attributeOfRI);
+		String url = String.format(Urls.UPDATE_ATTRIBUTE_ON_RESOURCE_INSTANCE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(ComponentTypeEnum.RESOURCE),
+				vf.getUniqueId(), vfcInstance.getUniqueId());
+		swallowException(() -> BaseRestUtils.sendPost(url, body, UserRoleEnum.DESIGNER.getUserId(),
+				BaseRestUtils.acceptHeaderData));
+		// Retrieve updated vf and verify attribute was updated
+		final Resource vfWithInsatncePostUpdate = swallowException(
+				() -> (Resource) AtomicOperationUtils.getCompoenntObject(vf, UserRoleEnum.DESIGNER));
+		ComponentInstanceProperty updatedAttribute = attributeGetter.apply(vfWithInsatncePostUpdate);
+		assertEquals(updatedAttribute.getValue(), newAttValue);
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java
new file mode 100644
index 0000000..9938266
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java
@@ -0,0 +1,236 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.category;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class CatalogDataApiTest extends ComponentBaseTest {
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+	@Rule
+	public static TestName name = new TestName();
+	protected User user;
+	protected RestResponse res1;
+	protected RestResponse res2;
+	protected RestResponse svc1;
+	protected ResourceReqDetails resourceDetails1;
+	protected ResourceReqDetails resourceDetails2;
+	protected ServiceReqDetails svcDetails1;
+
+	public CatalogDataApiTest() {
+		super(name, CatalogDataApiTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void setUp() throws Exception {
+		user = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		resourceDetails1 = buildResourceDetails(user, "TestResource1");
+		resourceDetails2 = buildResourceDetails(user, "TestResource2");
+		svcDetails1 = buildServiceDetails("TestService1");
+
+		res1 = createResource(user, resourceDetails1);
+		AssertJUnit.assertEquals("create resorce failed", 201, res1.getErrorCode().intValue());
+		resourceDetails1.setUniqueId(ResponseParser.getUniqueIdFromResponse(res1));
+		resourceDetails2.setVersion(ResponseParser.getVersionFromResponse(res1));
+
+		res2 = createResource(user, resourceDetails2);
+		AssertJUnit.assertEquals("create resorce failed", 201, res2.getErrorCode().intValue());
+		resourceDetails2.setUniqueId(ResponseParser.getUniqueIdFromResponse(res2));
+		resourceDetails2.setVersion(ResponseParser.getVersionFromResponse(res2));
+
+		svc1 = createService(user, svcDetails1);
+		AssertJUnit.assertEquals("create resorce failed", 201, svc1.getErrorCode().intValue());
+		svcDetails1.setUniqueId(ResponseParser.convertServiceResponseToJavaObject(svc1.getResponse()).getUniqueId());
+		svcDetails1.setVersion(ResponseParser.convertServiceResponseToJavaObject(svc1.getResponse()).getVersion());
+	}
+
+	@AfterMethod
+	public void tearDown() throws Exception {
+		deleteResource(resourceDetails1.getUniqueId(), user.getUserId());
+		deleteResource(resourceDetails2.getUniqueId(), user.getUserId());
+		deleteService(svcDetails1.getUniqueId(), user);
+	}
+
+	// Keep 1
+	@Test
+	public void getCatalogData() throws Exception {
+
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails1, user, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertEquals("check in operation failed", 200, checkInResponse.getErrorCode().intValue());
+
+		RestResponse res = CatalogRestUtils.getCatalog(user.getUserId());
+		String json = res.getResponse();
+		JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
+		JSONArray resources = (JSONArray) jsonResp.get("resources");
+		JSONArray services = (JSONArray) jsonResp.get("services");
+
+		// Verify all the expected resources received.
+		AssertJUnit.assertTrue("check resource1 is in response",
+				isComponentInArray(resourceDetails1.getUniqueId(), resources));
+		AssertJUnit.assertTrue("check resource2 is in response",
+				isComponentInArray(resourceDetails2.getUniqueId(), resources));
+		AssertJUnit.assertTrue("check service1 is in response",
+				isComponentInArray(svcDetails1.getUniqueId(), services));
+
+	}
+
+	protected void deleteResource(String resourceUniqueId, String httpCspUserId) throws Exception {
+		RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceUniqueId, httpCspUserId);
+
+	}
+
+	protected RestResponse createResource(User user, ResourceReqDetails resourceDetails) throws Exception {
+		deleteResource(resourceDetails.getName(), user.getUserId());
+		return ResourceRestUtils.createResource(resourceDetails, user);
+	}
+
+	protected ResourceReqDetails buildResourceDetails(User user, String resourceName) {
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.0";
+		String contactId = user.getUserId();
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(),
+				ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
+		return resourceDetails;
+	}
+
+	protected boolean isComponentInArray(String id, JSONArray component) {
+		for (int i = 0; i < component.size(); i++) {
+			JSONObject jobject = (JSONObject) component.get(i);
+			if (jobject.get("uniqueId").toString().equals(id.toLowerCase())) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	protected RestResponse createService(User user, ServiceReqDetails svcDetails) throws Exception {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = getHeadersMap(user);
+
+		Gson gson = new Gson();
+		String body = gson.toJson(svcDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort());
+		RestResponse res = http.httpSendPost(url, body, headersMap);
+		// System.out.println("Create service was finished with response:
+		// "+res.getErrorCode());
+		return res;
+	}
+
+	protected Map<String, String> getHeadersMap(User user) {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put("USER_ID", user.getUserId());
+		return headersMap;
+	}
+
+	protected ServiceReqDetails buildServiceDetails(String serviceName) {
+		String description = "description";
+		ArrayList<String> serviceTags = new ArrayList<String>();
+		serviceTags.add("tag1");
+		serviceTags.add(serviceName);
+		String category = ServiceCategoriesEnum.MOBILITY.getValue();
+		String vendorName = "Oracle";
+		String vendorRelease = "0.1";
+		String contactId = "al1976";
+		String icon = "myIcon";
+
+		ServiceReqDetails svcdetails = new ServiceReqDetails(serviceName, category, serviceTags, description,
+				contactId, icon);
+		return svcdetails;
+	}
+
+	public RestResponse deleteService(String serviceId, User user) throws Exception {
+		HttpRequest httpRequest = new HttpRequest();
+		String url = String.format(Urls.DELETE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				serviceId);
+
+		Map<String, String> headersMap = getHeadersMap(user);
+		RestResponse res = httpRequest.httpSendDelete(url, headersMap);
+		// System.out.println("Delete service was finished with response:
+		// "+res.getErrorCode());
+		return res;
+	}
+
+	public class NewObject {
+		private String _name;
+
+		public String getName() {
+			return _name;
+		}
+
+		public void setName(String name) {
+			this._name = name;
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java
new file mode 100644
index 0000000..d68f3f5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.category;
+
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+
+public abstract class CategoriesBaseTest extends ComponentBaseTest {
+
+	public CategoriesBaseTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	protected static final String AUDIT_SERVICE_TYPE = "Service";
+	protected static final String AUDIT_RESOURCE_TYPE = "Resource";
+	protected static final String AUDIT_PRODUCT_TYPE = "Product";
+	protected static final String GET_CATEGORY_HIERARCHY = "GetCategoryHierarchy";
+	protected static User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	protected static User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	protected static User sdncDesignerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	protected static User sdncTesterUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+	protected static User sdncGovernorUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+	protected static User sdncOpsUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+	protected static User sdncProductManagerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+	protected static User sdncProductStrategistUserDetails = ElementFactory
+			.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java
new file mode 100644
index 0000000..3b85c05
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesTests.java
@@ -0,0 +1,2303 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.category;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.PRODUCT_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.RESOURCE_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.SERVICE_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_ALREADY_EXISTS;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_CREATED;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_MISSING_INFORMATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.text.WordUtils;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
+import org.json.JSONArray;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.CategoryValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.SkipException;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class CategoriesTests extends CategoriesBaseTest {
+
+	private static final String GET_CATEGORY_HIERARCHY = "GetCategoryHierarchy";
+	protected static final String ADD_CATEGORY = "AddCategory";
+	protected static final String DELETE_CATEGORY = "DeleteCategory";
+
+	public CategoriesTests() {
+		super(name, CategoriesTests.class.getName());
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+	private CategoryDefinition categoryDefinition;
+	private List<CategoryDefinition> categoryList;
+	private List<SubCategoryDefinition> subCategoryList;
+	private Map<String, List<String>> subCategoriesToDeleteMap;
+
+	@BeforeMethod
+	public void init() throws Exception {
+		subCategoriesToDeleteMap = new HashMap<String, List<String>>();
+		DbUtils.deleteFromEsDbByPattern("_all");
+
+		categoryDefinition = new CategoryDefinition();
+		categoryDefinition.setName("Abcd");
+		categoryList = defineCategories();
+		subCategoryList = defineSubCategories(categoryList.size());
+	}
+
+	// pass
+	@Test
+	public void createServiceCategorySuccessFlow() throws Exception {
+		// Add New category
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+		// get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition); // also
+																											// set
+																											// catalog
+																											// uniqeId
+
+	}
+
+	// pass
+	@Test
+	public void createResourceCategorySuccessFlow() throws Exception {
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get Category
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	// pass
+	@Test
+	public void createProductCategorySuccessFlow() throws Exception {
+		// Add Category by Product-strategist
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition,
+				sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+
+		// Get Category
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void CategoryNameValidation_FirstWordStartWithAlphaNumeric_01() throws Exception { // category
+																								// for
+																								// service
+		categoryDefinition.setName("Category14AadE  &&&---+++.'''###=:@@@____");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category14AadE &-+.'#=:@_");
+		categoryDefinition.setNormalizedName("category14aade &-+.'#=:@_");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_FirstWordStartWithAlphaNumeric_02() throws Exception { // category
+																								// for
+																								// resource
+		categoryDefinition.setName("Category14AadE  &&&---+++.'''###=:@@@____");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category14AadE &-+.'#=:@_");
+		categoryDefinition.setNormalizedName("category14aade &-+.'#=:@_");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_FirstWordStartWithAlphaNumeric_03() throws Exception { // category
+																								// for
+																								// resource
+		categoryDefinition.setName("Category14AadE  &&&---+++.'''###=:@@@____");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition,
+				sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category14AadE &-+.'#=:@_");
+		categoryDefinition.setNormalizedName("category14aade &-+.'#=:@_");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	// pass
+	@Test
+	public void createServiceCategoryByNonAdminUser() throws Exception {
+		// Add New category
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition,
+				sdncProductStrategistUserDetails, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_RESTRICTED_OPERATION,
+				createCategotyRest.getErrorCode().intValue());
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.RESTRICTED_OPERATION, STATUS_CODE_RESTRICTED_OPERATION, AUDIT_SERVICE_TYPE);
+	}
+
+	// pass
+	@Test
+	public void createResourceCategoryByNonAdminUser() throws Exception {
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition,
+				sdncProductStrategistUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_RESTRICTED_OPERATION,
+				createCategotyRest.getErrorCode().intValue());
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.RESTRICTED_OPERATION, STATUS_CODE_RESTRICTED_OPERATION, AUDIT_RESOURCE_TYPE);
+	}
+
+	// pass
+	@Test
+	public void createProductCategoryByNonProductStrategistUser() throws Exception {
+		// Add New product category not by Product-Strategist
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_RESTRICTED_OPERATION,
+				createCategotyRest.getErrorCode().intValue());
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				ActionStatus.RESTRICTED_OPERATION, STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
+
+	}
+
+	// pass
+	@Test
+	public void addCategoryByNonExistingUser() throws Exception {
+		User sdncAdminUserDetailsNonExisting = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncAdminUserDetailsNonExisting.setUserId("bt555h");
+		// Add New category
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition,
+				sdncAdminUserDetailsNonExisting, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_RESTRICTED_OPERATION,
+				createCategotyRest.getErrorCode().intValue());
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_CATEGORY);
+		expectedCatrgoryAuditJavaObject.setModifier("(" + sdncAdminUserDetailsNonExisting.getUserId() + ")");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDefinition.getName());
+		expectedCatrgoryAuditJavaObject.setSubCategoryName("");
+		expectedCatrgoryAuditJavaObject.setGroupingName("");
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_SERVICE_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_RESTRICTED_OPERATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_CATEGORY);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_01() throws Exception {
+		categoryDefinition.setName("1234AbcdE&");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde&"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_02() throws Exception {
+		categoryDefinition.setName("1234AbcdE-");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde-"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_03() throws Exception {
+		categoryDefinition.setName("1234AbcdE+");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde+"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_04() throws Exception {
+		categoryDefinition.setName("1234AbcdE.");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde."); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_05() throws Exception {
+		categoryDefinition.setName("1234AbcdE'");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde'");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_06() throws Exception {
+		categoryDefinition.setName("1234AbcdE=");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde="); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_07() throws Exception {
+		categoryDefinition.setName("1234AbcdE:");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde:"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_08() throws Exception {
+		categoryDefinition.setName("1234AbcdE@");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde@"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_09() throws Exception {
+		categoryDefinition.setName("1234AbcdE_");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde_"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_10() throws Exception {
+		categoryDefinition.setName("1234AbcdE#");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde#"); // normalization
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_11() throws Exception {
+		categoryDefinition.setName("1234AbcdE d");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde d"); // normalization
+		categoryDefinition.setName("1234AbcdE D");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void addServiceCategoryAllowedcharacters_12() throws Exception {
+		categoryDefinition.setName("1234AbcdE   &_=+.-'#:@ d");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("1234abcde &_=+.-'#:@ d"); // normalization
+		categoryDefinition.setName("1234AbcdE &_=+.-'#:@ D");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveSpaceFromBeginning() throws Exception {
+		categoryDefinition.setName("  Category01");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("category01"); // normalization
+		categoryDefinition.setName("Category01");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveSpaceFromEnd() throws Exception {
+		categoryDefinition.setName("Category01    ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("category01"); // normalization
+		categoryDefinition.setName("Category01");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraSpace() throws Exception {
+		categoryDefinition.setName("Category    02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("category 02"); // normalization
+		categoryDefinition.setName("Category 02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraAmpersand() throws Exception {
+		categoryDefinition.setName("Category&& &02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("category& &02"); // normalization
+		categoryDefinition.setName("Category& &02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraDash() throws Exception {
+		categoryDefinition.setName("CategorY-- --02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("CategorY- -02");
+		categoryDefinition.setNormalizedName("category- -02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraPlus() throws Exception {
+		categoryDefinition.setName("CateGory++++ +02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("CateGory+ +02");
+		categoryDefinition.setNormalizedName("category+ +02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraPeriod() throws Exception {
+		categoryDefinition.setName("Category.... .02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category. .02");
+		categoryDefinition.setNormalizedName("category. .02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraApostrophe() throws Exception {
+		categoryDefinition.setName("CaTegory''' '02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("CaTegory' '02");
+		categoryDefinition.setNormalizedName("category' '02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraHashtag() throws Exception {
+		categoryDefinition.setName("Category### #02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category# #02");
+		categoryDefinition.setNormalizedName("category# #02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtrEequal() throws Exception {
+		categoryDefinition.setName("Category=== =02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category= =02");
+		categoryDefinition.setNormalizedName("category= =02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtrColon() throws Exception {
+		categoryDefinition.setName("Category::: :02");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category: :02");
+		categoryDefinition.setNormalizedName("category: :02");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtrAt() throws Exception {
+		categoryDefinition.setName("Category@@@ @a2");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category@ @a2");
+		categoryDefinition.setNormalizedName("category@ @a2");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_RemoveExtraUnderscore() throws Exception {
+		categoryDefinition.setName("Category___ _22");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Category_ _22");
+		categoryDefinition.setNormalizedName("category_ _22");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_FirstWordStartWithNumber() throws Exception {
+		categoryDefinition.setName("1Category one");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("1Category One");
+		categoryDefinition.setNormalizedName("1category one");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_FirstWordStartWithNonAlphaNumeric() throws Exception { // The
+																								// first
+																								// word
+																								// must
+																								// start
+																								// with
+																								// an
+																								// alpha-numeric
+																								// character
+																								// [a-Z
+																								// A..Z,
+																								// 0..9]
+		char invalidChars[] = { '&', '-', '+', '.', '\'', '#', '=', ':', '@', '_' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			categoryDefinition.setName(invalidChars[i] + "AbcD123");
+			categoryDefinition.setNormalizedName((invalidChars[i] + "AbcD123").toLowerCase());
+			RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition,
+					sdncAdminUserDetails1, SERVICE_COMPONENT_TYPE);
+			assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+					createCategotyRest.getErrorCode().intValue());
+
+			// get service category and validate that category was not added
+			RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+					SERVICE_COMPONENT_TYPE);
+			assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+					getAllCategoriesRest.getErrorCode().intValue());
+			CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+			// Audit validation
+			AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails1,
+					ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE,
+					"Service", "category");
+
+		}
+	}
+
+	@Test
+	public void addServiceCategoryAlreadyExist_uniqueness() throws Exception { // Verify
+																				// category
+																				// name
+																				// duplication
+																				// ("uniqueness")
+																				// as
+																				// non-case-sensitive,
+																				// so
+																				// we
+																				// don’t
+																				// create
+																				// duplicate
+																				// names
+																				// with
+																				// upper/lower
+																				// case
+																				// inconsistency.
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition); // also
+																											// set
+																											// catalog
+																											// uniqeId
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+		// Create same category name again
+		DbUtils.deleteFromEsDbByPattern("_all");
+		CategoryDefinition categoryDataDefinition2 = new CategoryDefinition();
+		categoryDataDefinition2.setName(categoryDefinition.getName());
+		RestResponse addDuplicateCategoryRest = CategoryRestUtils.createCategory(categoryDataDefinition2,
+				sdncAdminUserDetails, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_ALREADY_EXISTS,
+				addDuplicateCategoryRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDataDefinition2, sdncAdminUserDetails,
+				ActionStatus.COMPONENT_CATEGORY_ALREADY_EXISTS, STATUS_CODE_ALREADY_EXISTS, AUDIT_SERVICE_TYPE,
+				"Service", categoryDefinition.getName());
+		// Get Category and verify that category was created is not deleted
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+
+	}
+
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_01() throws Exception {
+		categoryDefinition.setName("At and T");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("At & T");
+		categoryDefinition.setNormalizedName("at & t");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_02() throws Exception {
+		categoryDefinition.setName("At and t");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("At & T");
+		categoryDefinition.setNormalizedName("at & t");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_03() throws Exception {
+		categoryDefinition.setName("Atand T");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("atand t");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_04() throws Exception {
+		categoryDefinition.setName("At andT");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("at andt");
+		categoryDefinition.setName("At AndT");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_05() throws Exception {
+		categoryDefinition.setName(" and AttT");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("and attt");
+		categoryDefinition.setName("And AttT");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_06() throws Exception {
+		categoryDefinition.setName("AttT and ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("attt and");
+		categoryDefinition.setName("AttT And");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	// Bug
+	@Test
+	public void categoryNameValidation_ReplaceAndWithAmpersand_07() throws Exception {
+		categoryDefinition.setName(" and a");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("and a");
+		categoryDefinition.setName("And a");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationMaxLength() throws Exception {
+		categoryDefinition.setName("AsdfghjQ234567890@#.&:+-_");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("asdfghjq234567890@#.&:+-_");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+
+	}
+
+	@Test
+	public void categoryNameValidationMaxLengthAfterNormalization() throws Exception {
+		categoryDefinition.setName("  A jQ234 @@@___ +++ At and T and and ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("A JQ234 @_ + At & T & And");
+		categoryDefinition.setNormalizedName("a jq234 @_ + at & t & and");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+
+	}
+
+	@Test
+	public void categoryNameValidationExceedMaxLengthAfterNormalization() throws Exception {
+		categoryDefinition.setName("  AbdfghBCVa jQ234 @@___ +++ At and T   ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("abdfghbcva jq234 @_ + at&t");
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE,
+				"Service", "category");
+	}
+
+	@Test
+	public void categoryNameValidationMinLengthAfterNormalization() throws Exception { // MinLengthAfterNormalization
+																						// =
+																						// 4
+																						// characters
+		categoryDefinition.setName("  At and  T   ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("At & T");
+		categoryDefinition.setNormalizedName("at & t");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationLessThanMinLengthAfterNormalization() throws Exception {
+		categoryDefinition.setName("  A&&&&&&&&&&&&&&&&&T   ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("a&t");
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE,
+				"Service", "category");
+	}
+
+	@Test
+	public void categoryNameValidationIsNull() throws Exception {
+		categoryDefinition.setName(null);
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+				createCategotyRest.getErrorCode().intValue());
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE,
+				"Service", "category");
+	}
+
+	@Test
+	public void categoryNameValidationIsEmpty() throws Exception {
+		categoryDefinition.setName("");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setNormalizedName("");
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE,
+				"Service", "category");
+	}
+
+	@Test
+	public void categoryNameValidationInvalidCharacters() throws Exception {
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
+				'|', '\\', ',' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			// DbUtils.cleanAllAudits();
+			categoryDefinition.setName("AbcD123" + invalidChars[i]);
+			RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+					SERVICE_COMPONENT_TYPE);
+			assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+					createCategotyRest.getErrorCode().intValue());
+			categoryDefinition.setNormalizedName("");
+			// get service category and validate that category was not added
+			RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+					SERVICE_COMPONENT_TYPE);
+			assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+					getAllCategoriesRest.getErrorCode().intValue());
+			CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+			// Audit validation
+			AuditValidationUtils.categoryAuditFailure(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+					ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE,
+					"Service", "category");
+		}
+	}
+
+	@Test
+	public void categoryNameValidationSameNameDifferentResourceType() throws Exception { // same
+																							// Catalog
+																							// Name
+																							// for
+																							// service/resource/product
+																							// is
+																							// allowed
+		String name = ("Abcd");
+		CategoryDefinition categoryDataDefinition1 = new CategoryDefinition();
+		CategoryDefinition categoryDataDefinition2 = new CategoryDefinition();
+		CategoryDefinition categoryDataDefinition3 = new CategoryDefinition();
+		categoryDataDefinition1.setName(name);
+		categoryDataDefinition2.setName(name);
+		categoryDataDefinition3.setName(name);
+		// CREATE CATEGORY FOR SERVICE
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDataDefinition1,
+				sdncAdminUserDetails, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDataDefinition1.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDataDefinition1);
+		// get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDataDefinition1); // also
+																													// set
+																													// catalog
+																													// uniqeId
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDataDefinition1, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+		// CREATE CATEGORY FOR RESOURCE_COMPONENT_TYPE
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createCategotyRest = CategoryRestUtils.createCategory(categoryDataDefinition2, sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDataDefinition2.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDataDefinition2);
+		// Get Category
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDataDefinition2);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDataDefinition2, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+		// CREATE CATEGORY FOR PRODUCT
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse addCategotyRest = CategoryRestUtils.createCategory(categoryDataDefinition3,
+				sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				addCategotyRest.getErrorCode().intValue());
+		categoryDataDefinition3.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateCategoryResponse(addCategotyRest, categoryDataDefinition3);
+
+		// Get Category
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDataDefinition3);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationFirstLetterOfKeyWordsCapitalized() throws Exception { // First
+																							// letter
+																							// of
+																							// key
+																							// words
+																							// are
+																							// capitalized
+		categoryDefinition.setName("beNNy shaY michEl");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("BeNNy ShaY MichEl");
+		categoryDefinition.setNormalizedName("benny shay michel");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_01() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" bank OF america  ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Bank of America");
+		categoryDefinition.setNormalizedName("bank of america");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_02() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName("THE america bank   ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("THE America Bank");
+		categoryDefinition.setNormalizedName("the america bank");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_03() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName("   A bank OF america  ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("A Bank of America");
+		categoryDefinition.setNormalizedName("a bank of america");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_04() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName("  bank  america is A big ban  ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Bank America Is a Big Ban");
+		categoryDefinition.setNormalizedName("bank america is a big ban");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_05() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" aN apple comPany inC ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("AN Apple ComPany InC");
+		categoryDefinition.setNormalizedName("an apple company inc");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_06() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" eat AN apple ANAN");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Eat an Apple ANAN");
+		categoryDefinition.setNormalizedName("eat an apple anan");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_07() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" united states OF americA ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("United States of AmericA");
+		categoryDefinition.setNormalizedName("united states of america");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	// need to re-check
+	@Test
+	public void categoryNameValidationConjunctions_08() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" oF united states OF amer ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("OF United States of Amer");
+		categoryDefinition.setNormalizedName("of united states of amer");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_09() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" to Apple TO at&T TOO ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("To Apple to At&T TOO");
+		categoryDefinition.setNormalizedName("to apple to at&t too");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_10() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" eat apple AS you liiikeas ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Eat Apple as You Liiikeas");
+		categoryDefinition.setNormalizedName("eat apple as you liiikeas");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_11() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" as you may want ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("As You May Want");
+		categoryDefinition.setNormalizedName("as you may want");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void categoryNameValidationConjunctions_12() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName(" the bank OF america ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("The Bank of America");
+		categoryDefinition.setNormalizedName("the bank of america");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	// need to recheck
+	@Test
+	public void categoryNameValidationConjunctions_13() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName("  To tel-toto ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("To Tel-toto");
+		categoryDefinition.setNormalizedName("to tel-toto");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	// recheck
+	@Test
+	public void categoryNameValidationConjunctions_14() throws Exception { // Normalize
+																			// the
+																			// category
+																			// name
+																			// conjunctions
+																			// ('of',
+																			// 'to',
+																			// 'for',
+																			// 'as',
+																			// 'a',
+																			// 'an'
+																			// ,
+																			// 'the')
+																			// are
+																			// lower
+																			// case.
+		categoryDefinition.setName("   tel-aviv To   la ");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Category", STATUS_CODE_CREATED,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Tel-aviv to La");
+		categoryDefinition.setNormalizedName("tel-aviv to la");
+		CategoryValidationUtils.validateCreateCategoryResponse(createCategotyRest, categoryDefinition);
+		// Get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		AuditValidationUtils.categoryAuditSuccess(ADD_CATEGORY, categoryDefinition, sdncAdminUserDetails,
+				STATUS_CODE_CREATED, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void createServiceCategoryHttpCspUserIdIsEmpty() throws Exception {
+		User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncAdminUserDetails1.setUserId("");
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Abcd");
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_CATEGORY);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDefinition.getName());
+		expectedCatrgoryAuditJavaObject.setSubCategoryName("");
+		expectedCatrgoryAuditJavaObject.setGroupingName("");
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_SERVICE_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_CATEGORY);
+	}
+
+	@Test
+	public void createServiceCategorHttpCspUserIdIsNull() throws Exception {
+		User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncAdminUserDetails1.setUserId(null);
+		RestResponse createCategotyRest = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails1,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createCategotyRest.getErrorCode().intValue());
+		categoryDefinition.setName("Abcd");
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_CATEGORY);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDefinition.getName());
+		expectedCatrgoryAuditJavaObject.setSubCategoryName("");
+		expectedCatrgoryAuditJavaObject.setGroupingName("");
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_SERVICE_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_CATEGORY);
+	}
+
+	@Test
+	public void createSrvcCategoryHttpCspUserIdHeaderIsMissing() throws Exception {
+		RestResponse createConsumerRest = CategoryRestUtils
+				.createServiceCategoryHttpCspAtuUidIsMissing(categoryDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createConsumerRest.getErrorCode().intValue());
+		categoryDefinition.setName("Abcd");
+		// get service category and validate that category was not added
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyCategoryNotExistsInGetResponse(getAllCategoriesRest, categoryDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_CATEGORY);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDefinition.getName());
+		expectedCatrgoryAuditJavaObject.setSubCategoryName("");
+		expectedCatrgoryAuditJavaObject.setGroupingName("");
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_SERVICE_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_CATEGORY);
+	}
+
+	@Test
+	public void getServiceCategoryHierarchySuccessFlow() throws Exception {
+
+		int numOfCategories = 3;
+		List<CategoryDefinition> categories = new ArrayList<CategoryDefinition>();
+		RestResponse restResponse;
+		CategoryDefinition category;
+		String categoryName = categoryDefinition.getName();
+		for (int i = 0; i < numOfCategories; i++) {
+			categoryDefinition.setName(categoryName + i);
+			restResponse = CategoryRestUtils.createCategory(categoryDefinition, sdncAdminUserDetails,
+					SERVICE_COMPONENT_TYPE);
+			category = ResponseParser.parseToObject(restResponse.getResponse(), CategoryDefinition.class);
+			categories.add(category);
+		}
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+
+		AuditValidationUtils.GetCategoryHierarchyAuditSuccess(GET_CATEGORY_HIERARCHY, AUDIT_SERVICE_TYPE,
+				sdncAdminUserDetails, STATUS_CODE_SUCCESS);
+		for (CategoryDefinition categoryCurr : categories) {
+			CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryCurr);
+		}
+	}
+
+	///////////////////////////////// US570520 /////////////////////////////////
+	private List<CategoryDefinition> defineCategories() throws Exception {
+		String firstCategory = "FirstCategory";
+		String secondCategory = "secondCategory";
+		String thirdCategory = "ThirdCategory";
+		String forthCategory = "forthCategory";
+		CategoryDefinition category1 = new CategoryDefinition(categoryDefinition);
+		category1.setName(firstCategory);
+		CategoryDefinition category2 = new CategoryDefinition(categoryDefinition);
+		category2.setName(secondCategory);
+		CategoryDefinition category3 = new CategoryDefinition(categoryDefinition);
+		category3.setName(thirdCategory);
+		CategoryDefinition category4 = new CategoryDefinition(categoryDefinition);
+		category4.setName(forthCategory);
+		ArrayList<CategoryDefinition> categoryList = new ArrayList<CategoryDefinition>();
+		categoryList.add(category1);
+		categoryList.add(category2);
+		categoryList.add(category3);
+		categoryList.add(category4);
+		return categoryList;
+	}
+
+	@Test
+	public void getAllResourceCategoriesHirarchy() throws Exception {
+		createAndValidateCategoriesExist(RESOURCE_COMPONENT_TYPE, categoryList);
+
+		for (int i = 0; i < categoryList.size(); i++) {
+			List<String> subCategorieUniqueIdList = new ArrayList<String>();
+			for (int j = 0; j < subCategoryList.size(); j++) {
+				RestResponse createSubCategory = CategoryRestUtils.createSubCategory(subCategoryList.get(j),
+						categoryList.get(i), sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+				if (createSubCategory.getErrorCode().intValue() == STATUS_CODE_CREATED) {
+					String subCategoryUniqeId = ResponseParser.getUniqueIdFromResponse(createSubCategory);
+					subCategorieUniqueIdList.add(subCategoryUniqeId);
+					subCategoriesToDeleteMap.put(categoryList.get(i).getUniqueId(), subCategorieUniqueIdList);
+				}
+			}
+		}
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+
+		for (int i = 0; i < categoryList.size(); i++) {
+			for (int j = 0; j < subCategoryList.size(); j++) {
+				CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+						categoryList.get(i).getUniqueId(), subCategoryList.get(j));
+			}
+		}
+
+		checkAuditSuccess(RESOURCE_COMPONENT_TYPE);
+	}
+
+	private List<SubCategoryDefinition> defineSubCategories(int catListSize) {
+		List<SubCategoryDefinition> subCatList = new ArrayList<SubCategoryDefinition>();
+		for (int j = 1; j <= catListSize; j++) {
+			SubCategoryDefinition subCategory = new SubCategoryDefinition();
+			subCategory.setName("SubCategory" + String.valueOf(j));
+			subCatList.add(subCategory);
+		}
+		return subCatList;
+	}
+
+	private void createAndValidateCategoriesExist(String comp, List<CategoryDefinition> categoryList) throws Exception {
+		createCategories(comp, categoryList);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, comp);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		verifyCategoriesExist(categoryList, getAllCategoriesRest);
+	}
+
+	private void verifyCategoriesExist(List<CategoryDefinition> categoryList, RestResponse getAllCategoriesRest) {
+		for (int i = 0; i < categoryList.size(); i++) {
+			categoryList.get(i).setName(WordUtils.capitalize(categoryList.get(i).getName()));
+			CategoryValidationUtils.verifyCategoryExistInGetResponse(getAllCategoriesRest, categoryList.get(i));
+		}
+	}
+
+	private void createCategories(String comp, List<CategoryDefinition> categoryList) throws Exception {
+		for (int i = 0; i < categoryList.size(); i++) {
+			CategoryRestUtils.createCategory(categoryList.get(i), sdncAdminUserDetails, comp);
+		}
+	}
+
+	@Test
+	public void getAllServiceCategoriesHirarchy() throws Exception {
+		// deleteCategories(categoryList, SERVICE_COMPONENT_TYPE);
+		createAndValidateCategoriesExist(SERVICE_COMPONENT_TYPE, categoryList);
+		checkAuditSuccess(SERVICE_COMPONENT_TYPE);
+		// deleteCategories(categoryList, SERVICE_COMPONENT_TYPE);
+	}
+
+	@Test
+	public void getAllResourceCategories_noAttUserHeader() throws Exception {
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(new User(), RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", 403, getAllCategoriesRest.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), new ArrayList<String>(),
+				getAllCategoriesRest.getResponse());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(GET_CATEGORY_HIERARCHY);
+		expectedCatrgoryAuditJavaObject.setModifierName("");
+		expectedCatrgoryAuditJavaObject.setModifierUid("");
+		expectedCatrgoryAuditJavaObject.setDetails(RESOURCE_COMPONENT_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateGetCategoryHirarchy(expectedCatrgoryAuditJavaObject, GET_CATEGORY_HIERARCHY);
+	}
+
+	@Test
+	public void getAllResourceCategories_userNotProvisioned() throws Exception {
+		User notProvisionedUser = new User();
+		notProvisionedUser.setUserId("aa0001");
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(notProvisionedUser,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", 409, getAllCategoriesRest.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				getAllCategoriesRest.getResponse());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(GET_CATEGORY_HIERARCHY);
+		expectedCatrgoryAuditJavaObject.setModifierName("");
+		expectedCatrgoryAuditJavaObject.setModifierUid(notProvisionedUser.getUserId());
+		expectedCatrgoryAuditJavaObject.setDetails(RESOURCE_COMPONENT_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_RESTRICTED_OPERATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateGetCategoryHirarchy(expectedCatrgoryAuditJavaObject, GET_CATEGORY_HIERARCHY);
+	}
+
+	@Test
+	public void getAllResourceCategories_unsupportedComponent() throws Exception {
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, "comp");
+		assertEquals("Check response code after get all categories hirarchy", 400,
+				getAllCategoriesRest.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.UNSUPPORTED_ERROR.name(),
+				new ArrayList<String>(Arrays.asList("component type")), getAllCategoriesRest.getResponse());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.UNSUPPORTED_ERROR.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(GET_CATEGORY_HIERARCHY);
+		expectedCatrgoryAuditJavaObject.setModifierUid(sdncAdminUserDetails.getUserId());
+		expectedCatrgoryAuditJavaObject.setModifierName(sdncAdminUserDetails.getFullName());
+		expectedCatrgoryAuditJavaObject.setDetails("comp");
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_INVALID_CONTENT));
+		expectedCatrgoryAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo,
+				new ArrayList<String>(Arrays.asList("component type"))));
+		AuditValidationUtils.validateGetCategoryHirarchy(expectedCatrgoryAuditJavaObject, GET_CATEGORY_HIERARCHY);
+	}
+
+	@Test(enabled = false)
+	public void getAllResourceCategories_emptyList() throws Exception {
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		JSONArray jArr = new JSONArray(getAllCategoriesRest.getResponse());
+		assertTrue(jArr.length() == 0);
+
+		checkAuditSuccess(RESOURCE_COMPONENT_TYPE);
+	}
+
+	private void checkAuditSuccess(String componentType) throws Exception {
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(GET_CATEGORY_HIERARCHY);
+		expectedCatrgoryAuditJavaObject.setModifierName(sdncAdminUserDetails.getFullName());
+		expectedCatrgoryAuditJavaObject.setModifierUid(sdncAdminUserDetails.getUserId());
+		expectedCatrgoryAuditJavaObject.setDetails(componentType);
+		expectedCatrgoryAuditJavaObject.setStatus("200");
+		expectedCatrgoryAuditJavaObject.setDesc("OK");
+		AuditValidationUtils.validateGetCategoryHirarchy(expectedCatrgoryAuditJavaObject, GET_CATEGORY_HIERARCHY);
+	}
+
+	@Test(enabled = false)
+	public void getAllServiceCategories_emptyList() throws Exception {
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		JSONArray jArr = new JSONArray(getAllCategoriesRest.getResponse());
+		assertTrue(jArr.length() == 0);
+
+		checkAuditSuccess(SERVICE_COMPONENT_TYPE);
+	}
+
+	@Test(enabled = false)
+	public void getAllProductCategories_emptyList() throws Exception {
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get Category", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		JSONArray jArr = new JSONArray(getAllCategoriesRest.getResponse());
+		assertTrue(jArr.length() == 0);
+
+		checkAuditSuccess(PRODUCT_COMPONENT_TYPE);
+	}
+
+	// @Test
+	// public void getAllResourceCategories_generalError() throws Exception
+	// {
+	// User user = new User();
+	// RestResponse getAllCategoriesRest =
+	// CategoryRestUtils.getAllCategories(user, SERVICE_COMPONENT_TYPE);
+	// assertEquals("Check response code after get Category", 500,
+	// getAllCategoriesRest.getErrorCode().intValue());
+	// Utils.checkBodyResponseOnError(ActionStatus.GENERAL_ERROR.name(), new
+	// ArrayList<String>(), getAllCategoriesRest.getResponse());
+	// }
+
+	//////////////////////////////////////////////////////////////////////////////
+
+	@Test
+	public void importCategories() throws Exception {
+
+		String importResourceDir = config.getImportTypesConfigDir() + File.separator + "categoryTypesTest.zip";
+
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+		mpBuilder.addPart("categoriesZip", new FileBody(new File(importResourceDir)));
+
+		RestResponse importResult = CategoryRestUtils.importCategories(mpBuilder, sdncAdminUserDetails.getUserId());
+		assertEquals("Check response code after Import", BaseRestUtils.STATUS_CODE_CREATED,
+				importResult.getErrorCode().intValue());
+
+		Map<String, Object> map = ResponseParser.parseToObjectUsingMapper(importResult.getResponse(), Map.class);
+		assertEquals("Check  entries count", 2, map.size());
+
+		List<Map<String, Object>> resources = (List<Map<String, Object>>) map.get("resources");
+		assertEquals("Check resource category  entries count", 1, resources.size());
+
+		List<Map<String, Object>> services = (List<Map<String, Object>>) map.get("services");
+		assertEquals("Check resource category  entries count", 2, services.size());
+
+		RestResponse allCategories = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, "resources");
+		List<CategoryDefinition> resourceCategories = ResponseParser.parseCategories(allCategories);
+		for (Map<String, Object> resource : resources) {
+			boolean exist = false;
+
+			for (CategoryDefinition categ : resourceCategories) {
+				if (categ.getName().equals(resource.get("name"))) {
+					exist = true;
+					break;
+				}
+			}
+			assertTrue("Check existance resource category  " + resource.get("name"), exist);
+		}
+
+		allCategories = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, "services");
+		List<CategoryDefinition> servicesCategories = ResponseParser.parseCategories(allCategories);
+		for (Map<String, Object> service : services) {
+			boolean exist = false;
+
+			for (CategoryDefinition categ : servicesCategories) {
+				if (categ.getName().equals(service.get("name"))) {
+					exist = true;
+					break;
+				}
+			}
+			assertTrue("Check existance service category  " + service.get("name"), exist);
+		}
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java
new file mode 100644
index 0000000..2f48f4f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/ElementsApiTest.java
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.category;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.testng.annotations.Test;
+
+public class ElementsApiTest extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ElementsApiTest() {
+		super(name, ElementsApiTest.class.getName());
+	}
+
+	// public LCSbaseTest(TestName testName, String className) {
+	// super(testName, className);
+	// }
+
+	// public ElementsApiTest(TestName name, String name2) {
+	//// super(name, name2);
+	// // TODO Auto-generated constructor stub
+	// }
+
+	// Expected 200 Keep
+	@Test
+	public void getAllPropertyScopesSuccess() throws Exception {
+		RestResponse response = ResourceRestUtils.getAllPropertyScopesTowardsCatalogBe();
+		String action = "Get All Property Scopes";
+		int expectedCode = 200;
+		verifyErrorCode(response, action, expectedCode);
+	}
+
+	// Expected 200 Keep
+	@Test
+	public void getAllArtifactTypes() throws Exception {
+		RestResponse response = ResourceRestUtils.getAllArtifactTypesTowardsCatalogBe();
+		String action = "Get All Artifact Types";
+		int expectedCode = 200;
+		verifyErrorCode(response, action, expectedCode);
+	}
+
+	// Expected 200 Keep
+	@Test
+	public void getConfiguration() throws Exception {
+		RestResponse response = ResourceRestUtils.getConfigurationTowardsCatalogBe();
+		String action = "Get All Artifact Types";
+		int expectedCode = 200;
+
+		String json = response.getResponse();
+		JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
+
+		HashMap<String, Object> artifacts = (HashMap<String, Object>) jsonResp.get("artifacts");
+		Long defaultHeatTimeout = (Long) jsonResp.get("defaultHeatTimeout");
+
+		if (defaultHeatTimeout == null) {
+			response.setErrorCode(500);
+			verifyErrorCode(response, action, expectedCode);
+			return;
+		}
+
+		if (artifacts == null) {
+			response.setErrorCode(500);
+			verifyErrorCode(response, action, expectedCode);
+			return;
+		}
+
+		JSONObject deploymentResources = (JSONObject) artifacts.get("deployment");
+		JSONArray otherResources = (JSONArray) artifacts.get("other");
+		if (deploymentResources == null || otherResources == null) {
+			response.setErrorCode(500);
+			verifyErrorCode(response, action, expectedCode);
+			return;
+		}
+
+		JSONArray roles = (JSONArray) jsonResp.get("roles");
+		if (roles == null) {
+			response.setErrorCode(500);
+			verifyErrorCode(response, action, expectedCode);
+			return;
+		}
+
+	}
+
+	public void verifyErrorCode(RestResponse response, String action, int expectedCode) {
+		assertNotNull("check response object is not null after " + action, response);
+		assertNotNull("check error code exists in response after " + action, response.getErrorCode());
+		assertEquals("Check response code after  + action" + action, expectedCode, response.getErrorCode().intValue());
+	}
+
+	@Test(enabled = false)
+	public void getAllCategoriesSuccess() throws Exception {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		RestResponse response = CatalogRestUtils.getAllCategoriesTowardsCatalogBe();
+		String action = "Get All Categories";
+		int expectedCode = 200;
+		verifyErrorCode(response, action, expectedCode);
+	}
+
+	@Test(enabled = false)
+	public void getAllTagSuccess() throws Exception {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		RestResponse response = ResourceRestUtils.getAllTagsTowardsCatalogBe();
+		String action = "Get All Categories";
+		int expectedCode = 200;
+		verifyErrorCode(response, action, expectedCode);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java
new file mode 100644
index 0000000..f6b6113
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java
@@ -0,0 +1,2007 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.category;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.PRODUCT_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.RESOURCE_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.SERVICE_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_ALREADY_EXISTS;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_CREATED;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_MISSING_INFORMATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_NOT_FOUND;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.CategoryValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.SkipException;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class GroupingTest extends CategoriesBaseTest {
+
+	protected static final String ADD_GROUPING = "AddGrouping";
+	protected static final String CATEGORY = "category";
+	protected static final String SUB_CATEGORY = "sub-category";
+	protected static final String GROUPING = "grouping";
+
+	public GroupingTest() {
+		super(name, GroupingTest.class.getName());
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	private CategoryDefinition productCategoryDefinition;
+	private CategoryDefinition productCategoryDefinition2;
+
+	private SubCategoryDefinition productSubCategoryDefinition;
+	private SubCategoryDefinition productSubCategoryDefinition2;
+	private SubCategoryDefinition productSubCategoryDefinition3;
+
+	private GroupingDefinition productGroupingDefinition;
+	private GroupingDefinition productGroupingDefinition2;
+	private GroupingDefinition productGroupingDefinition3;
+
+	@BeforeMethod
+	public void init() throws Exception {
+
+		// Category setup
+		productCategoryDefinition = new CategoryDefinition();
+		productCategoryDefinition.setName("Category1");
+		productCategoryDefinition2 = new CategoryDefinition();
+		productCategoryDefinition2.setName("Category2");
+
+		// Subcategory setup
+		productSubCategoryDefinition = new SubCategoryDefinition();
+		productSubCategoryDefinition.setName("SubCategory1");
+
+		productSubCategoryDefinition2 = new SubCategoryDefinition();
+		productSubCategoryDefinition2.setName("SubCategory2");
+
+		productSubCategoryDefinition3 = new SubCategoryDefinition();
+		productSubCategoryDefinition3.setName("SubCategory1");
+
+		// Group setup
+		productGroupingDefinition = new GroupingDefinition();
+		productGroupingDefinition.setName("Grouping1");
+
+		productGroupingDefinition2 = new GroupingDefinition();
+		productGroupingDefinition2.setName("Grouping2");
+
+		productGroupingDefinition3 = new GroupingDefinition();
+		productGroupingDefinition3.setName("Grouping1");
+
+		// Init product category
+		RestResponse createCategory = CategoryRestUtils.createCategory(productCategoryDefinition,
+				sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		CategoryDefinition category = ResponseParser.parseToObject(createCategory.getResponse(),
+				CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productCategoryDefinition.getName(),
+				category.getName());
+		productCategoryDefinition = category;
+
+		// Init product category1
+		createCategory = CategoryRestUtils.createCategory(productCategoryDefinition2, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productCategoryDefinition2.getName(),
+				category.getName());
+		productCategoryDefinition2 = category;
+
+		// Init product productSubCategoryDefinition to
+		// productCategoryDefinition
+		RestResponse createSubCategory = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createSubCategory.getErrorCode().intValue());
+		SubCategoryDefinition subCategory = ResponseParser.parseToObject(createSubCategory.getResponse(),
+				SubCategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productSubCategoryDefinition.getName(),
+				subCategory.getName());
+		productSubCategoryDefinition = subCategory;
+		productCategoryDefinition.addSubCategory(productSubCategoryDefinition);
+
+		// Init product productSubCategoryDefinition1 to
+		// productCategoryDefinition
+		createSubCategory = CategoryRestUtils.createSubCategory(productSubCategoryDefinition2,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createSubCategory.getErrorCode().intValue());
+		subCategory = ResponseParser.parseToObject(createSubCategory.getResponse(), SubCategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productSubCategoryDefinition2.getName(),
+				subCategory.getName());
+		productSubCategoryDefinition2 = subCategory;
+		productCategoryDefinition.addSubCategory(productSubCategoryDefinition2);
+
+		// Init product productSubCategoryDefinition3 to
+		// productCategoryDefinition2
+		createSubCategory = CategoryRestUtils.createSubCategory(productSubCategoryDefinition3,
+				productCategoryDefinition2, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createSubCategory.getErrorCode().intValue());
+		subCategory = ResponseParser.parseToObject(createSubCategory.getResponse(), SubCategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productSubCategoryDefinition3.getName(),
+				subCategory.getName());
+		productSubCategoryDefinition3 = subCategory;
+		productCategoryDefinition2.addSubCategory(productSubCategoryDefinition3);
+	}
+
+	@Test
+	public void createProductGroupCategorySuccess() throws Exception {
+		createGroupingSuccess(productGroupingDefinition, productSubCategoryDefinition, productCategoryDefinition,
+				sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE, AUDIT_PRODUCT_TYPE);
+	}
+
+	private void createGroupingSuccess(GroupingDefinition groupingDefinition,
+			SubCategoryDefinition subCategoryDefinition, CategoryDefinition categoryDefinition,
+			User sdncProductStrategistUserDetails, String productComponentType, String auditType) throws Exception {
+
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(groupingDefinition, subCategoryDefinition,
+				categoryDefinition, sdncProductStrategistUserDetails, productComponentType);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("grouping1");
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				productComponentType);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest, categoryDefinition.getUniqueId(),
+				subCategoryDefinition.getUniqueId(), groupingDefinition);
+
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, categoryDefinition, subCategoryDefinition,
+				groupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, auditType);
+	}
+
+	//// Benny
+
+	@Test
+	public void createProductGroupByProductStrategist() throws Exception {
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("grouping1");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void createProductGroupAlreadyExistInSameCategorySubCategory() throws Exception {
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("grouping1");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+		// Create Same Group already exist on same Category/SubCategory
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition, productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_ALREADY_EXISTS,
+				createGroupingRest.getErrorCode().intValue());
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_GROUPING_EXISTS_FOR_SUB_CATEGORY, STATUS_CODE_ALREADY_EXISTS, AUDIT_PRODUCT_TYPE,
+				AUDIT_PRODUCT_TYPE, productGroupingDefinition.getName(), productSubCategoryDefinition.getName());
+	}
+
+	@Test
+	public void createProductGroupUnderSameCategoryButDifferentSubCategory() throws Exception {
+		// Setting : Category-A, Sub-category-B , group : aBcd (display-Name :
+		// ABcd, normalized: abcd)  [A, B, ABcd]
+		// Action : Category-A, Sub-category-C, group : abcD (display-Name :
+		// ABcd, normalized: abcd)  [A, C, ABcd]
+		productGroupingDefinition.setName("ABCd");
+		productGroupingDefinition2.setName("abcD");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition2,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition2.setName("ABCd");
+		productGroupingDefinition2.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition,
+				productSubCategoryDefinition2, productGroupingDefinition2, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition2.getUniqueId(),
+				productGroupingDefinition2);
+	}
+
+	@Test
+	public void createProductGroupUnderSameSubCategoryButDifferentCategory() throws Exception {
+		// Setting : Category-A, Sub-category-B , group : aBcd (display-Name :
+		// ABcd, normalized: abcd)  [A, B, ABcd]
+		// : Category-A, Sub-category-C, group : abcD (display-Name : ABcd,
+		// normalized: abcd)  [A, C, ABcd]
+		// : Category-K, Sub-category-B, group : abcD (display-Name : ABcd,
+		// normalized: abcd)  [K, B, ABcd]
+		productGroupingDefinition.setName("ABCd");
+		productGroupingDefinition2.setName("abcD");
+		productGroupingDefinition3.setName("aBCd");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition2,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition2.setName("ABCd");
+		productGroupingDefinition2.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition,
+				productSubCategoryDefinition2, productGroupingDefinition2, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition3, productSubCategoryDefinition3,
+				productCategoryDefinition2, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition3.setName("ABCd");
+		productGroupingDefinition3.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition3);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition2,
+				productSubCategoryDefinition3, productGroupingDefinition3, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition2.getUniqueId(),
+				productGroupingDefinition2);
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition2.getUniqueId(), productSubCategoryDefinition3.getUniqueId(),
+				productGroupingDefinition3);
+
+	}
+
+	@Test
+	public void createProductGroupsOnSameCategorySubCategory() throws Exception {
+		// Setting : Category-A, Sub-category-B , group : ABcd (display-Name :
+		// ABcd, normalized: abcd) [A ,B, ABcd]
+		// Action : Category-A, Sub-category-B, group : ZXcv (display-Name :
+		// ZXcv, normalized: zxcv) [A, B, ZXcv]
+		productGroupingDefinition.setName("ABcd");
+		productGroupingDefinition2.setName("ZXcv");
+		productGroupingDefinition2.setNormalizedName("zxcv");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition2, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition2);
+	}
+
+	@Test
+	public void createProductGroupUnderDifferentCategory() throws Exception {
+		// Setting : Category-A, Sub-category-B , group : aBcd (display-Name :
+		// ABcd, normalized: abcd) [A ,B, ABcd]
+		// Action : Category-K, Sub-category-B, group : abcD (display-Name :
+		// ABcd, normalized: abcd) [K, B, ABcd]
+		// productGroupingDefinition.setName("ABCd");
+		productGroupingDefinition.setName("ABcD");
+		productGroupingDefinition2.setName("abcD");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("abcd");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition3,
+				productCategoryDefinition2, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition2.setNormalizedName("abcd");
+		productGroupingDefinition2.setName("ABcD");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition2,
+				productSubCategoryDefinition3, productGroupingDefinition2, sdncProductStrategistUserDetails,
+				STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition2.getUniqueId(), productSubCategoryDefinition3.getUniqueId(),
+				productGroupingDefinition2);
+	}
+
+	///////////
+	@Test
+	public void createProductGroupByNonProductStrategist() throws Exception {
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_RESTRICTED_OPERATION,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncAdminUserDetails, ActionStatus.RESTRICTED_OPERATION,
+				STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
+	}
+
+	// @Ignore("DE176245")
+	@Test
+	public void createProductGroupForNonExistingComponentType() throws Exception {
+		String nonSupportedComponentType = "NonExistingComponentType"; // instead
+																		// resource/product
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				nonSupportedComponentType);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, nonSupportedComponentType);
+	}
+
+	// @Ignore("DE176245")
+	@Test
+	public void createResourceGroup() throws Exception {
+		// Resource doesn't have group
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE);
+	}
+
+	// @Ignore("DE176245")
+	@Test
+	public void createServiceGroup() throws Exception {
+		// Service doesn't have group
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void createProductGroupForNonExistingCategory() throws Exception {
+
+		CategoryDefinition productCategoryDefinition100 = new CategoryDefinition();
+		productCategoryDefinition100.setName("category.nonexistingCategory");
+		productCategoryDefinition100.setUniqueId("category.nonexistingCategory");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition100, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_NOT_FOUND,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition100,
+				productSubCategoryDefinition, productGroupingDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_CATEGORY_NOT_FOUND, STATUS_CODE_NOT_FOUND, AUDIT_PRODUCT_TYPE,
+				PRODUCT_COMPONENT_TYPE, CATEGORY, "");
+	}
+
+	@Test
+	public void createProductGroupForNonExistingSunCategory() throws Exception {
+		throw new SkipException(
+				"Skipping - failed in audit validation expected \"products\" actual result was \"product\" ");
+		// SubCategoryDefinition productSubCategoryDefinition100 = new
+		// SubCategoryDefinition();
+		// productSubCategoryDefinition100.setUniqueId("category.nonexistingSubCategory");
+		// RestResponse createGroupingRest =
+		// CategoryRestUtils.createGrouping(productGroupingDefinition,
+		// productSubCategoryDefinition100, productCategoryDefinition,
+		// sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		// assertEquals("Check response code after create Sub category",
+		// STATUS_CODE_NOT_FOUND, createGroupingRest.getErrorCode().intValue());
+		// RestResponse getAllCategoriesRest =
+		// CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+		// PRODUCT_COMPONENT_TYPE);
+		// assertEquals("Check response code after get all categories ",
+		// STATUS_CODE_SUCCESS, getAllCategoriesRest.getErrorCode().intValue());
+		// CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+		// productCategoryDefinition.getUniqueId(),
+		// productSubCategoryDefinition.getUniqueId(),
+		// productGroupingDefinition);
+		// //Audit validation
+		// productSubCategoryDefinition100.setName(productSubCategoryDefinition100.getUniqueId());
+		// AuditValidationUtils.groupingAuditFailure(ADD_GROUPING ,
+		// productCategoryDefinition, productSubCategoryDefinition100,
+		// productGroupingDefinition, sdncProductStrategistUserDetails,
+		// ActionStatus.COMPONENT_CATEGORY_NOT_FOUND,
+		// STATUS_CODE_NOT_FOUND,AUDIT_PRODUCT_TYPE, PRODUCT_COMPONENT_TYPE,
+		// SUB_CATEGORY, "");
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_01() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE-");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde-");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_02() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE+");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde+");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_03() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE&");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde&");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_04() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE-");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde-");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_05() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE+");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde+");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_06() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE.");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde.");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_07() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE'");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde'");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_08() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE=");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde=");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_09() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE:");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde:");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_10() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE@");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde@");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_11() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE_");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde_");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_12() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE#");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("1234abcde#");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void ProductGroupAllowedcharacters_13() throws Exception {
+		productGroupingDefinition.setName("1234AbcdE d");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("1234AbcdE D");
+		productGroupingDefinition.setNormalizedName("1234abcde d");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveSpaceFromBeginning() throws Exception {
+		productGroupingDefinition.setName("  Category01");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("category01");
+		productGroupingDefinition.setName("Category01");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveSpaceFromEnd() throws Exception {
+		productGroupingDefinition.setName("Category01    ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("category01");
+		productGroupingDefinition.setName("Category01");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraSpace() throws Exception {
+		productGroupingDefinition.setName("Category    02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("category 02");
+		productGroupingDefinition.setName("Category 02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraAmpersand() throws Exception {
+		productGroupingDefinition.setName("Category&& &02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("category& &02");
+		productGroupingDefinition.setName("Category& &02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraDash() throws Exception {
+		productGroupingDefinition.setName("CategorY-- --02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("category- -02");
+		productGroupingDefinition.setName("CategorY- -02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraPlus() throws Exception {
+		productGroupingDefinition.setName("CateGory++++ +02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("CateGory+ +02");
+		productGroupingDefinition.setNormalizedName("category+ +02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraPeriod() throws Exception {
+		productGroupingDefinition.setName("Category.... .02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Category. .02");
+		productGroupingDefinition.setNormalizedName("category. .02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraApostrophe() throws Exception {
+		productGroupingDefinition.setName("CaTegory''' '02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("CaTegory' '02");
+		productGroupingDefinition.setNormalizedName("category' '02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraHashtag() throws Exception {
+		productGroupingDefinition.setName("Category### #02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Category# #02");
+		productGroupingDefinition.setNormalizedName("category# #02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtrEequal() throws Exception {
+		productGroupingDefinition.setName("Category=== =02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Category= =02");
+		productGroupingDefinition.setNormalizedName("category= =02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtrColon() throws Exception {
+		productGroupingDefinition.setName("Category::: :02");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Category: :02");
+		productGroupingDefinition.setNormalizedName("category: :02");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtrAt() throws Exception {
+		productGroupingDefinition.setName("Category@@@ @a2");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Category@ @a2");
+		productGroupingDefinition.setNormalizedName("category@ @a2");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_RemoveExtraUnderscore() throws Exception {
+		productGroupingDefinition.setName("Category___ _22");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Category_ _22");
+		productGroupingDefinition.setNormalizedName("category_ _22");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_FirstWordStartWithNumber() throws Exception {
+		productGroupingDefinition.setName("1Category one");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("1Category One");
+		productGroupingDefinition.setNormalizedName("1category one");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_FirstWordStartWithNonAlphaNumeric() throws Exception { // The
+																							// first
+																							// word
+																							// must
+																							// start
+																							// with
+																							// an
+																							// alpha-numeric
+																							// character
+																							// [a-Z
+																							// A..Z,
+																							// 0..9]
+		char invalidChars[] = { '&', '-', '+', '.', '\'', '#', '=', ':', '@', '_' };
+		RestResponse createGroupingRest;
+		RestResponse getAllCategoriesRest;
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			productGroupingDefinition.setName(invalidChars[i] + "AbcD123");
+			productGroupingDefinition.setNormalizedName((invalidChars[i] + "AbcD123").toLowerCase());
+			createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+					productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+					PRODUCT_COMPONENT_TYPE);
+			assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+					createGroupingRest.getErrorCode().intValue());
+
+			getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+			assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+					getAllCategoriesRest.getErrorCode().intValue());
+			CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+					productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+					productGroupingDefinition);
+		}
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_01() throws Exception {
+		productGroupingDefinition.setName("At and T");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("At & T");
+		productGroupingDefinition.setNormalizedName("at & t");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_02() throws Exception {
+		productGroupingDefinition.setName("At and t");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("At & T");
+		productGroupingDefinition.setNormalizedName("at & t");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_03() throws Exception {
+		productGroupingDefinition.setName("Atand T");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("atand t");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_04() throws Exception {
+		productGroupingDefinition.setName("At andT");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("at andt");
+		productGroupingDefinition.setName("At AndT");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_05() throws Exception {
+		productGroupingDefinition.setName(" and AttT");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("and attt");
+		productGroupingDefinition.setName("And AttT");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_06() throws Exception {
+		productGroupingDefinition.setName("AttT and ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("attt and");
+		productGroupingDefinition.setName("AttT And");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidation_ReplaceAndWithAmpersand_07() throws Exception {
+		productGroupingDefinition.setName(" and a");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("and a");
+		productGroupingDefinition.setName("And a");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationMaxLength() throws Exception {
+		productGroupingDefinition.setName("AsdfghjQ234567890@#.&:+-_");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("asdfghjq234567890@#.&:+-_");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationMaxLengthAfterNormalization() throws Exception {
+		productGroupingDefinition.setName("  A jQ234 @@@___ +++ At and T and and ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("a jq234 @_ + at & t & and");
+		productGroupingDefinition.setName("A JQ234 @_ + At & T & And");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationExceedMaxLengthAfterNormalization() throws Exception {
+		productGroupingDefinition.setName("  AbdfghBCVa jQ234 @@___ +++ At and T   ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("abdfghbcva jq234 @_ + at&t");
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
+				AUDIT_PRODUCT_TYPE, GROUPING);
+	}
+
+	@Test
+	public void groupNameValidationMinLengthAfterNormalization() throws Exception {
+		productGroupingDefinition.setName("  At&&&&&&&&&&&&t   ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("at&t");
+		productGroupingDefinition.setName("At&t");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationLessThanMinLengthAfterNormalization() throws Exception {
+		productGroupingDefinition.setName("  A&&&&&&&&&&&&T   ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("a&t");
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
+				AUDIT_PRODUCT_TYPE, GROUPING);
+	}
+
+	@Test
+	public void groupNameValidationIsEmpty() throws Exception {
+		productGroupingDefinition.setName("");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("");
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
+				AUDIT_PRODUCT_TYPE, GROUPING);
+	}
+
+	@Test
+	public void groupNameValidationInvalidCharacters() throws Exception {
+		RestResponse createGroupingRest;
+		RestResponse getAllCategoriesRest;
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
+				'|', '\\', ',' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			productGroupingDefinition.setName("AbcD123" + invalidChars[i]);
+			createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+					productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+					PRODUCT_COMPONENT_TYPE);
+			assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
+					createGroupingRest.getErrorCode().intValue());
+			productGroupingDefinition.setNormalizedName("");
+			getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+			assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+					getAllCategoriesRest.getErrorCode().intValue());
+			CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+					productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+					productGroupingDefinition);
+			// Audit validation
+			AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition,
+					productSubCategoryDefinition, productGroupingDefinition, sdncProductStrategistUserDetails,
+					ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
+					AUDIT_PRODUCT_TYPE, GROUPING);
+		}
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_01() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" bank OF america  ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setNormalizedName("bank of america");
+		productGroupingDefinition.setName("Bank of America");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_02() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName("THE america bank   ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("THE America Bank");
+		productGroupingDefinition.setNormalizedName("the america bank");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_03() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName("   A bank OF america  ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("A Bank of America");
+		productGroupingDefinition.setNormalizedName("a bank of america");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_04() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName("  bank  america is A big ban  ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Bank America Is a Big Ban");
+		productGroupingDefinition.setNormalizedName("bank america is a big ban");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_05() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" aN apple comPany inC ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("AN Apple ComPany InC");
+		productGroupingDefinition.setNormalizedName("an apple company inc");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_06() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" eat AN apple ANAN");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Eat an Apple ANAN");
+		productGroupingDefinition.setNormalizedName("eat an apple anan");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_07() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" united states OF americA ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("United States of AmericA");
+		productGroupingDefinition.setNormalizedName("united states of america");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_08() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" oF united states OF amer ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("OF United States of Amer");
+		productGroupingDefinition.setNormalizedName("of united states of amer");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_09() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" to Apple TO at&T TOO ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("To Apple to At&T TOO");
+		productGroupingDefinition.setNormalizedName("to apple to at&t too");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_10() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" eat apple AS you liiikeas ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Eat Apple as You Liiikeas");
+		productGroupingDefinition.setNormalizedName("eat apple as you liiikeas");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_11() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" as you may want ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("As You May Want");
+		productGroupingDefinition.setNormalizedName("as you may want");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_12() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName(" the bank OF america ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("The Bank of America");
+		productGroupingDefinition.setNormalizedName("the bank of america");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_13() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName("  To tel-toto ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("To Tel-toto");
+		productGroupingDefinition.setNormalizedName("to tel-toto");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void groupNameValidationConjunctions_14() throws Exception {
+		// Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
+		// 'a', 'an' , 'the') are lower case.
+		productGroupingDefinition.setName("   tel-aviv To   la ");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
+				createGroupingRest.getErrorCode().intValue());
+		productGroupingDefinition.setName("Tel-aviv to La");
+		productGroupingDefinition.setNormalizedName("tel-aviv to la");
+		CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
+				productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void createProductGroupHttpCspUserIdIsEmpty() throws Exception {
+		User sdncPS = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+		sdncPS.setUserId("");
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncPS, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_GROUPING);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(productCategoryDefinition.getUniqueId());
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(productSubCategoryDefinition.getUniqueId());
+		expectedCatrgoryAuditJavaObject.setGroupingName(productGroupingDefinition.getName());
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_PRODUCT_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_GROUPING);
+	}
+
+	@Test
+	public void createProductGroupHttpCspUserIdIsNull() throws Exception {
+		User sdncPS = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+		sdncPS.setUserId(null);
+		RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
+				productSubCategoryDefinition, productCategoryDefinition, sdncPS, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createGroupingRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
+				productGroupingDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_GROUPING);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(productCategoryDefinition.getUniqueId());
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(productSubCategoryDefinition.getUniqueId());
+		expectedCatrgoryAuditJavaObject.setGroupingName(productGroupingDefinition.getName());
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_PRODUCT_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_GROUPING);
+	}
+
+	////////////////////////////////////////////////
+	///////////////////////////////////////////////
+	@Test
+	public void getProductCategoryHierarchySuccessFlow() throws Exception {
+		throw new SkipException(
+				"Skipping - failed in audit validation expected \"products\" actual result was \"product\" ");
+		// int numOfGrouping = 3;
+		// List<GroupingDefinition> groupingList = new ArrayList<>();
+		// RestResponse restResponse;
+		// GroupingDefinition grouping;
+		// String groupingName = productGroupingDefinition.getName();
+		// for (int i = 0; i < numOfGrouping; i++) {
+		// productGroupingDefinition.setName(groupingName+i);
+		// restResponse =
+		// CategoryRestUtils.createGrouping(productGroupingDefinition,
+		// productSubCategoryDefinition, productCategoryDefinition,
+		// sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		// grouping = ResponseParser.parseToObject(restResponse.getResponse(),
+		// GroupingDefinition.class);
+		// groupingList.add(grouping);
+		// }
+		// RestResponse getAllCategoriesRest =
+		// CategoryRestUtils.getAllCategories(sdncProductStrategistUserDetails,
+		// PRODUCT_COMPONENT_TYPE);
+		// assertEquals("Check response code after get all categories ",
+		// STATUS_CODE_SUCCESS, getAllCategoriesRest.getErrorCode().intValue());
+		// AuditValidationUtils.GetCategoryHierarchyAuditSuccess(GET_CATEGORY_HIERARCHY,
+		// AUDIT_PRODUCT_TYPE, sdncProductStrategistUserDetails,
+		// STATUS_CODE_SUCCESS);
+		//
+		// for (GroupingDefinition group : groupingList) {
+		// CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
+		// productCategoryDefinition.getUniqueId(),
+		// productSubCategoryDefinition.getUniqueId(), group);
+		// }
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java
new file mode 100644
index 0000000..dcc3172
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java
@@ -0,0 +1,1908 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.category;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.PRODUCT_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.RESOURCE_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.SERVICE_COMPONENT_TYPE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_ALREADY_EXISTS;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_CREATED;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_MISSING_INFORMATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_NOT_FOUND;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.CategoryValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class SubCategoriesTest extends ComponentBaseTest {
+
+	protected static final String ADD_SUB_CATEGORY = "AddSubCategory";
+	protected static final String CATEGORY = "category";
+	protected static final String SUB_CATEGORY = "sub-category";
+
+	protected static final String AUDIT_SERVICE_TYPE = "Service";
+	protected static final String AUDIT_RESOURCE_TYPE = "Resource";
+	protected static final String AUDIT_PRODUCT_TYPE = "Product";
+	protected static final String GET_CATEGORY_HIERARCHY = "GetCategoryHierarchy";
+	protected static User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	protected static User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	protected static User sdncDesignerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	protected static User sdncTesterUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+	protected static User sdncGovernorUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+	protected static User sdncOpsUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+	protected static User sdncProductManagerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+	protected static User sdncProductStrategistUserDetails = ElementFactory
+			.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+
+	public SubCategoriesTest() {
+		super(name, SubCategoriesTest.class.getName());
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	private CategoryDefinition resourceCategoryDefinition;
+	private CategoryDefinition resourceCategoryDefinition1;
+	private CategoryDefinition serviceCategoryDefinition;
+	private CategoryDefinition productCategoryDefinition;
+	private CategoryDefinition productCategoryDefinition1;
+	private CategoryDefinition resourceCategoryDefinition100;
+	private CategoryDefinition productCategoryDefinition200;
+
+	private SubCategoryDefinition resourceSubCategoryDefinition;
+	private SubCategoryDefinition resourceSubCategoryDefinition1;
+	private SubCategoryDefinition serviceSubCategoryDefinition;
+	private SubCategoryDefinition productSubCategoryDefinition;
+	private SubCategoryDefinition productSubCategoryDefinition1;
+
+	@BeforeMethod
+	public void init() throws Exception {
+
+		// Category setup
+		resourceCategoryDefinition = new CategoryDefinition();
+		resourceCategoryDefinition1 = new CategoryDefinition();
+		serviceCategoryDefinition = new CategoryDefinition();
+		productCategoryDefinition = new CategoryDefinition();
+		productCategoryDefinition1 = new CategoryDefinition();
+		resourceCategoryDefinition100 = new CategoryDefinition(); // for
+																	// negative
+																	// tests
+		productCategoryDefinition200 = new CategoryDefinition(); // for negative
+																	// tests
+
+		resourceCategoryDefinition.setName("Category1");
+		resourceCategoryDefinition1.setName("Category2");
+		serviceCategoryDefinition.setName("Category1");
+		productCategoryDefinition.setName("Category2");
+		productCategoryDefinition1.setName("Category3");
+		resourceCategoryDefinition100.setName("Category100");
+		productCategoryDefinition200.setName("Category100");
+
+		// Subcategory setup
+		resourceSubCategoryDefinition = new SubCategoryDefinition();
+		resourceSubCategoryDefinition1 = new SubCategoryDefinition();
+		serviceSubCategoryDefinition = new SubCategoryDefinition();
+		productSubCategoryDefinition = new SubCategoryDefinition();
+		productSubCategoryDefinition1 = new SubCategoryDefinition();
+
+		resourceSubCategoryDefinition.setName("Resource-subcat");
+		// Service sub - for negative testing since it's not allowed
+		serviceSubCategoryDefinition.setName("Service-subcat");
+		productSubCategoryDefinition.setName("Product-subcat");
+
+		// Init resource category
+		RestResponse createCategory = CategoryRestUtils.createCategory(resourceCategoryDefinition, sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		CategoryDefinition category = ResponseParser.parseToObject(createCategory.getResponse(),
+				CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", resourceCategoryDefinition.getName(),
+				category.getName());
+		resourceCategoryDefinition = category;
+
+		// Init resource category1
+		createCategory = CategoryRestUtils.createCategory(resourceCategoryDefinition1, sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", resourceCategoryDefinition1.getName(),
+				category.getName());
+		resourceCategoryDefinition1 = category;
+
+		// Init service category
+		createCategory = CategoryRestUtils.createCategory(serviceCategoryDefinition, sdncAdminUserDetails,
+				SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", serviceCategoryDefinition.getName(),
+				category.getName());
+		serviceCategoryDefinition = category;
+
+		// Init product category
+		createCategory = CategoryRestUtils.createCategory(productCategoryDefinition, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productCategoryDefinition.getName(),
+				category.getName());
+		productCategoryDefinition = category;
+
+		// Init product category1
+		createCategory = CategoryRestUtils.createCategory(productCategoryDefinition1, sdncProductStrategistUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create category", STATUS_CODE_CREATED,
+				createCategory.getErrorCode().intValue());
+		category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
+		assertEquals("Check category name after creating category ", productCategoryDefinition1.getName(),
+				category.getName());
+		productCategoryDefinition1 = category;
+
+	}
+
+	@Test
+	public void createResourceSubCategorySuccess() throws Exception {
+		createSubCategorySuccess(resourceCategoryDefinition, resourceSubCategoryDefinition, sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void createProductSubCategorySuccess() throws Exception {
+		createSubCategorySuccess(productCategoryDefinition, productSubCategoryDefinition,
+				sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void createProductSubCategoryTwoCategoriesCaseInsensitive() throws Exception {
+		String componentType = PRODUCT_COMPONENT_TYPE;
+		String auditType = AUDIT_PRODUCT_TYPE;
+		User user = sdncProductStrategistUserDetails;
+		// Create product sub Category2-->Product-subcat
+		createSubCategorySuccess(productCategoryDefinition, productSubCategoryDefinition, user, componentType,
+				auditType);
+		DbUtils.deleteFromEsDbByPattern("_all");
+
+		// Create product sub Category3-->PRoDUCT-SUBcat
+		// Should be created Category3-->Product-subcat
+		productSubCategoryDefinition1.setName("PRoDUCT-SUBcat");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition1,
+				productCategoryDefinition1, user, componentType);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(user, componentType);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		productSubCategoryDefinition1.setName(productSubCategoryDefinition.getName());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition1.getUniqueId(), productSubCategoryDefinition1);
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition1,
+				productSubCategoryDefinition1, user, STATUS_CODE_CREATED, auditType);
+	}
+
+	// Benny
+	@Test
+	public void createResourceSubCategoryAlreadyExistInDifferentResourceCategory() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		resourceSubCategoryDefinition1.setName("ResourcE-subCat");
+		createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition1,
+				resourceCategoryDefinition1, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition1.setName(resourceSubCategoryDefinition.getName());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition1.getUniqueId(), resourceSubCategoryDefinition1); // also
+																							// set
+																							// catalog
+																							// uniqeId
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition1,
+				resourceSubCategoryDefinition1, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void createProductSubCategoryAlreadyExistInDifferentProductCategory() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
+				AUDIT_PRODUCT_TYPE);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		productSubCategoryDefinition1.setName("PRoDUCT-SUBcat");
+		createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition1,
+				productCategoryDefinition1, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		productSubCategoryDefinition1.setName(productSubCategoryDefinition.getName());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition1.getUniqueId(), productSubCategoryDefinition1); // also
+																							// set
+																							// catalog
+																							// uniqeId
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition1,
+				productSubCategoryDefinition1, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
+				AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void createResourceSubCategoryAlreadyExistInCategory() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		resourceSubCategoryDefinition1.setName("ResourcE-subCat");
+		createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition1,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_ALREADY_EXISTS,
+				createSubCategoryRest.getErrorCode().intValue());
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition1, sdncAdminUserDetails,
+				ActionStatus.COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY, STATUS_CODE_ALREADY_EXISTS,
+				AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, resourceSubCategoryDefinition1.getName(),
+				resourceCategoryDefinition.getName());
+	}
+
+	@Test
+	public void createProductSubCategoryAlreadyExistInCategory() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
+				AUDIT_PRODUCT_TYPE);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		productSubCategoryDefinition1.setName("ProducT-subCat");
+		createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition1,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_ALREADY_EXISTS,
+				createSubCategoryRest.getErrorCode().intValue());
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition1, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY, STATUS_CODE_ALREADY_EXISTS, AUDIT_PRODUCT_TYPE,
+				AUDIT_PRODUCT_TYPE, productSubCategoryDefinition1.getName(), productCategoryDefinition.getName());
+	}
+
+	@Test
+	public void addSameNormalizedSubCategoryNameForRecourceAndProductCategory() throws Exception {
+		// add sub-categoty name "SubCaT" to resource category
+		// add sub-categoty name "SUbcAt" to product category
+		resourceSubCategoryDefinition.setName("SubCaT"); // normalized 'subcat'
+		productSubCategoryDefinition.setName("SUbcAt"); // normalized 'subcat'
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
+				AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void createResourceSubCategoryByNonAdminUser() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncTesterUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncTesterUserDetails, ActionStatus.RESTRICTED_OPERATION,
+				STATUS_CODE_RESTRICTED_OPERATION, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void createResourceSubCategoryByProducStrategistUser() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncProductStrategistUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncProductStrategistUserDetails, ActionStatus.RESTRICTED_OPERATION,
+				STATUS_CODE_RESTRICTED_OPERATION, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void createProductSubCategoryByNonProducStrategistUser() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncDesignerUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncDesignerUserDetails, ActionStatus.RESTRICTED_OPERATION,
+				STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
+	}
+
+	@Test
+	public void createProductSubCategoryByAdminUser() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.RESTRICTED_OPERATION,
+				STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
+	}
+
+	// @Ignore("DE176245")
+	@Test
+	public void createResourceSubCategoryForNonExistingComponentType() throws Exception {
+		String nonSupportedComponentType = "NonExistingComponentType"; // instead
+																		// resource/product
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, nonSupportedComponentType);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, nonSupportedComponentType);
+	}
+
+	// @Ignore("DE176245")
+	@Test
+	public void createProductSubCategoryForNonExistingComponentType() throws Exception {
+		String nonSupportedComponentType = "NonExistingComponentType"; // instead
+																		// resource/product
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, nonSupportedComponentType);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, nonSupportedComponentType);
+	}
+
+	@Test
+	public void createServiceSubCategoryByAdmin() throws Exception {
+		// Service doesn't have sub-category
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void createServiceSubCategoryByProductStrategist() throws Exception {
+		// Service doesn't have sub-category
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition, sdncProductStrategistUserDetails, SERVICE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation
+		productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
+				productSubCategoryDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE);
+	}
+
+	@Test
+	public void createResourceSubCategoryForNonExistingCategory() throws Exception {
+		resourceCategoryDefinition100.setUniqueId(resourceCategoryDefinition100.getName());
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition100, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_NOT_FOUND,
+				createSubCategoryRest.getErrorCode().intValue());
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition100,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_CATEGORY_NOT_FOUND,
+				STATUS_CODE_NOT_FOUND, AUDIT_RESOURCE_TYPE, RESOURCE_COMPONENT_TYPE, CATEGORY, "");
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition100.getUniqueId(), resourceSubCategoryDefinition);
+	}
+
+	@Test
+	public void createProductSubCategoryForNonExistingCategory() throws Exception {
+		productCategoryDefinition200.setUniqueId(productCategoryDefinition200.getName());
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
+				productCategoryDefinition200, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_NOT_FOUND,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				PRODUCT_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				productCategoryDefinition200.getUniqueId(), productSubCategoryDefinition);
+		// Audit validation // need to change ActionStatus
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition200,
+				productSubCategoryDefinition, sdncProductStrategistUserDetails,
+				ActionStatus.COMPONENT_CATEGORY_NOT_FOUND, STATUS_CODE_NOT_FOUND, AUDIT_PRODUCT_TYPE,
+				PRODUCT_COMPONENT_TYPE, CATEGORY, "");
+	}
+
+	// pass
+	@Test
+	public void subCategoryAllowedcharacters_01() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE-");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition); // also
+																							// set
+																							// catalog
+																							// uniqeId
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	// pass
+	@Test
+	public void subCategoryAllowedcharacters_02() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE+");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_03() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE&");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_04() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE.");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_05() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE'");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_06() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE=");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_07() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE:");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_08() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE@");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_09() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE_");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_10() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE#");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_11() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE d");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("1234AbcdE D");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryAllowedcharacters_12() throws Exception {
+		resourceSubCategoryDefinition.setName("1234AbcdE   &_=+.-'#:@ d");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("1234AbcdE &_=+.-'#:@ D");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveSpaceFromBeginning() throws Exception {
+		resourceSubCategoryDefinition.setName("  Category01");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category01");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveSpaceFromEnd() throws Exception {
+		resourceSubCategoryDefinition.setName("Category01    ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category01");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraSpace() throws Exception {
+		resourceSubCategoryDefinition.setName("Category    02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category 02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraAmpersand() throws Exception {
+		resourceSubCategoryDefinition.setName("Category&& &02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category& &02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraDash() throws Exception {
+		resourceSubCategoryDefinition.setName("CategorY-- --02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("CategorY- -02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraPlus() throws Exception {
+		resourceSubCategoryDefinition.setName("CateGory++++ +02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("CateGory+ +02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraPeriod() throws Exception {
+		resourceSubCategoryDefinition.setName("Category.... .02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category. .02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraApostrophe() throws Exception {
+		resourceSubCategoryDefinition.setName("CaTegory''' '02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("CaTegory' '02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraHashtag() throws Exception {
+		resourceSubCategoryDefinition.setName("Category### #02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category# #02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtrEequal() throws Exception {
+		resourceSubCategoryDefinition.setName("Category=== =02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category= =02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtrColon() throws Exception {
+		resourceSubCategoryDefinition.setName("Category::: :02");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category: :02");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtrAt() throws Exception {
+		resourceSubCategoryDefinition.setName("Category@@@ @a2");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category@ @a2");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryRemoveExtraUnderscore() throws Exception {
+		resourceSubCategoryDefinition.setName("Category___ _22");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Category_ _22");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryFirstWordStartWithNumber() throws Exception {
+		resourceSubCategoryDefinition.setName("1Category one");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("1Category One");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	// Bug
+	// Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
+	// CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = "&AbcD123" GROUPING_NAME
+	// = "" RESOURCE_TYPE = "Resource" STATUS = "400" DESC = "SVC4556: Error:
+	// Invalid Resource sub-category name format.">
+	// DESC=SVC4556: Error: InvalidResourcesub-categorynameformat.,
+	// @Ignore
+	@Test
+	public void subCategoryFirstWordStartWithNonAlphaNumeric() throws Exception {
+		// The first word must start with an alpha-numeric character [a-Z A..Z,
+		// 0..9]
+		char invalidChars[] = { '&', '-', '+', '.', '\'', '#', '=', ':', '@', '_' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			resourceSubCategoryDefinition.setName(invalidChars[i] + "AbcD123");
+			RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+					resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+			assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
+					createSubCategoryRest.getErrorCode().intValue());
+			RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+					RESOURCE_COMPONENT_TYPE);
+			assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+					getAllCategoriesRest.getErrorCode().intValue());
+			CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+					resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+			// Audit validation
+			AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+					resourceSubCategoryDefinition, sdncAdminUserDetails,
+					ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT,
+					AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
+
+		}
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_01() throws Exception {
+		resourceSubCategoryDefinition.setName("At and T");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("At & T");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_02() throws Exception {
+		resourceSubCategoryDefinition.setName("At and t");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("At & T");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_03() throws Exception {
+		resourceSubCategoryDefinition.setName("Atand T");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_04() throws Exception {
+		resourceSubCategoryDefinition.setName("At andT");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("At AndT");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_05() throws Exception {
+		resourceSubCategoryDefinition.setName(" and AttT");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("And AttT");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_06() throws Exception {
+		resourceSubCategoryDefinition.setName("AttT and ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("AttT And");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryReplaceAndWithAmpersand_07() throws Exception {
+		resourceSubCategoryDefinition.setName(" and a");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("And a");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationMaxLength() throws Exception {
+		resourceSubCategoryDefinition.setName("AsdfghjQ234567890@#.&:+-_");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationMaxLengthAfterNormalization() throws Exception {
+		resourceSubCategoryDefinition.setName("  A jQ234 @@@___ +++ At and T and and ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("A JQ234 @_ + At & T & And");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	// bug :
+	// Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
+	// CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = " AbdfghBCVa jQ234 @@___
+	// +++ At and T " GROUPING_NAME = "" RESOURCE_TYPE = "Resource" STATUS =
+	// "400" DESC = "SVC4555: Error: Invalid Resource sub-category name
+	// length.">
+	@Test
+	public void subCategoryNameValidationExceedMaxLengthAfterNormalization() throws Exception {
+		resourceSubCategoryDefinition.setName("  AbdfghBCVa jQ234 @@___ +++ At and T   ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
+	}
+
+	@Test
+	public void subCategoryNameValidationMinLengthAfterNormalization() throws Exception {
+		resourceSubCategoryDefinition.setName("  AT&&&&&&&&&T   ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("AT&T");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	// bug
+	// Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
+	// CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = " A and T " GROUPING_NAME
+	// = "" RESOURCE_TYPE = "Resource" STATUS = "400" DESC = "SVC4555: Error:
+	// Invalid Resource sub-category name length.">
+	@Test
+	public void subCategoryNameValidationLessThanMinLengthAfterNormalization() throws Exception {
+		resourceSubCategoryDefinition.setName("  A&&&T   ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
+	}
+
+	@Test
+	public void subCategoryNameIsEmpty() throws Exception {
+		resourceSubCategoryDefinition.setName("");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT,
+				STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
+	}
+
+	// bug
+	// Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
+	// CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = "AbcD123~" GROUPING_NAME
+	// = "" RESOURCE_TYPE = "Resource" STATUS = "400" DESC = "SVC4556: Error:
+	// Invalid Resource sub-category name format.">
+	@Test
+	public void subCategoryNameValidationInvalidCharacters() throws Exception {
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
+				'|', '\\', ',' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			resourceSubCategoryDefinition.setName("AbcD123" + invalidChars[i]);
+			RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+					resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+			assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
+					createSubCategoryRest.getErrorCode().intValue());
+			RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+					RESOURCE_COMPONENT_TYPE);
+			assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+					getAllCategoriesRest.getErrorCode().intValue());
+			CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+					resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+			// Audit validation
+			AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+					resourceSubCategoryDefinition, sdncAdminUserDetails,
+					ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT,
+					AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
+		}
+	}
+
+	@Test
+	public void subCategoryNameValidationFirstLetterOfKeyWordsCapitalized() throws Exception {
+		resourceSubCategoryDefinition.setName("beNNy shaY michEl");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("BeNNy ShaY MichEl");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_01() throws Exception {
+		resourceSubCategoryDefinition.setName(" bank OF america  ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Bank of America");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_02() throws Exception {
+		resourceSubCategoryDefinition.setName("THE america bank   ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("THE America Bank");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_03() throws Exception {
+		resourceSubCategoryDefinition.setName("   A bank OF america  ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("A Bank of America");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_04() throws Exception {
+		resourceSubCategoryDefinition.setName("  bank  america is A big ban  ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Bank America Is a Big Ban");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_05() throws Exception {
+		resourceSubCategoryDefinition.setName(" aN apple comPany inC ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("AN Apple ComPany InC");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_06() throws Exception {
+		resourceSubCategoryDefinition.setName(" eat AN apple ANAN");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Eat an Apple ANAN");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_07() throws Exception {
+		resourceSubCategoryDefinition.setName(" united states OF americA ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("United States of AmericA");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_08() throws Exception {
+		resourceSubCategoryDefinition.setName(" oF united states OF amer ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("OF United States of Amer");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_09() throws Exception {
+		resourceSubCategoryDefinition.setName(" to Apple TO at&T TOO ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("To Apple to At&T TOO");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_10() throws Exception {
+		resourceSubCategoryDefinition.setName(" eat apple AS you liiikeas ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Eat Apple as You Liiikeas");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_11() throws Exception {
+		resourceSubCategoryDefinition.setName(" as you may want ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("As You May Want");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_12() throws Exception {
+		resourceSubCategoryDefinition.setName(" the bank OF america ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("The Bank of America");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_13() throws Exception {
+		resourceSubCategoryDefinition.setName("  To tel-toto ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("To Tel-toto");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void subCategoryNameValidationConjunctions_14() throws Exception {
+		resourceSubCategoryDefinition.setName("   tel-aviv To   la ");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		resourceSubCategoryDefinition.setName("Tel-aviv to La");
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
+
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
+				resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
+	}
+
+	@Test
+	public void createSubCategoryHttpCspUserIdHeaderIsMissing() throws Exception {
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategoryHttpCspAtuUidIsMissing(
+				resourceSubCategoryDefinition, resourceCategoryDefinition, sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_MISSING_INFORMATION,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_SUB_CATEGORY);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(resourceCategoryDefinition.getUniqueId());
+		// String subCategoryName = (resourceSubCategoryDefinition != null ?
+		// resourceSubCategoryDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(resourceSubCategoryDefinition.getName());
+		// String groupingName = (groupingDefinition != null ?
+		// groupingDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setGroupingName("");
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_RESOURCE_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_SUB_CATEGORY);
+	}
+
+	@Test
+	public void createSubCategoryHttpCspUserIdIsEmpty() throws Exception {
+		User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncAdminUserDetails1.setUserId("");
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+				resourceCategoryDefinition, sdncAdminUserDetails1, RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_MISSING_INFORMATION,
+				createSubCategoryRest.getErrorCode().intValue());
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
+				resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(ADD_SUB_CATEGORY);
+		expectedCatrgoryAuditJavaObject.setModifier("");
+		expectedCatrgoryAuditJavaObject.setCategoryName(resourceCategoryDefinition.getUniqueId());
+		// String subCategoryName = (resourceSubCategoryDefinition != null ?
+		// resourceSubCategoryDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(resourceSubCategoryDefinition.getName());
+		// String groupingName = (groupingDefinition != null ?
+		// groupingDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setGroupingName("");
+		expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_RESOURCE_TYPE);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_SUB_CATEGORY);
+	}
+
+	////////////////////////////////////////////////////////////
+	private void createSubCategorySuccess(CategoryDefinition categoryDefinition,
+			SubCategoryDefinition subCategoryDefinition, User sdncAdminUserDetails, String componentType,
+			String auditType) throws Exception {
+
+		RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(subCategoryDefinition,
+				categoryDefinition, sdncAdminUserDetails, componentType);
+		assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
+				createSubCategoryRest.getErrorCode().intValue());
+		CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, subCategoryDefinition);
+		// Audit validation
+		AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, categoryDefinition, subCategoryDefinition,
+				sdncAdminUserDetails, STATUS_CODE_CREATED, auditType);
+		// get service category and validate that category added as defined
+		// (also set catalog uniqeId)
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, componentType);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+				categoryDefinition.getUniqueId(), subCategoryDefinition); // also
+																			// set
+																			// catalog
+																			// uniqeId
+	}
+
+	@Test
+	public void getResourceCategoryHierarchySuccessFlow() throws Exception {
+		int numOfSubCategories = 3;
+		List<SubCategoryDefinition> subCategories = new ArrayList();
+		RestResponse restResponse;
+		SubCategoryDefinition subCategory;
+		String subName = resourceSubCategoryDefinition.getName();
+		for (int i = 0; i < numOfSubCategories; i++) {
+			resourceSubCategoryDefinition.setName(subName + i);
+			restResponse = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
+					resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
+			subCategory = ResponseParser.parseToObject(restResponse.getResponse(), SubCategoryDefinition.class);
+			subCategories.add(subCategory);
+		}
+		RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
+				RESOURCE_COMPONENT_TYPE);
+		assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
+				getAllCategoriesRest.getErrorCode().intValue());
+		AuditValidationUtils.GetCategoryHierarchyAuditSuccess(GET_CATEGORY_HIERARCHY, AUDIT_RESOURCE_TYPE,
+				sdncAdminUserDetails, STATUS_CODE_SUCCESS);
+		for (SubCategoryDefinition sub : subCategories) {
+			CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
+					resourceCategoryDefinition.getUniqueId(), sub);
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java
new file mode 100644
index 0000000..8a5fe91
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.devCI;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
+import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
+import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
+import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+//import org.openecomp.sdc.toscaparser.api.Metadata;
+import org.openecomp.sdc.toscaparser.api.Capability;
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.common.JToscaException;
+import org.testng.annotations.Test;
+
+public class AndreyTest {
+
+	public static void main(String[] args) throws Exception {
+		ToscaDefinition toscaDefinition;
+		System.out.println("start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
+//        File path = new File("C:/Data/D2.0/TOSCA_Ex/Definitions/tosca_definition_version.yaml");
+//        File path = new File("C:/Data/D2.0/TOSCA_Ex/resource-Vl11Vl10-template.yml");
+        File path = new File("C:/Data/D2.0/TOSCA_Ex/service-Servicepxtc-template US822998.yml");
+        File csarPath = new File("C:/Data/D2.0/TOSCA_Ex/Nested.csar");
+
+        toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(path);
+        System.out.println("listTypeHeatMetaDefinition start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
+        List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(csarPath);
+        System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
+        System.out.println(listTypeHeatMetaDefinition);
+        for(TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition){
+        	for(GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition.getGroupHeatMetaDefinition()){
+        		List<HeatMetaFirstLevelDefinition> artifactList = groupHeatMetaDefinition.getArtifactList();
+        		boolean isBase = groupHeatMetaDefinition.getPropertyHeatMetaDefinition().getValue();
+        	}
+        	
+        }
+        System.out.println("Finished");
+        System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
+	}
+	
+	
+	@Test
+	public void distributionTest() throws SdcToscaParserException, JToscaException, IOException {
+		//String serviceName = import and create().getName();
+		//getServiceObject();
+		//parseServiceObject();
+		
+		
+		
+		SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();	
+        long startTime = System.currentTimeMillis();
+        long estimatedTime = System.currentTimeMillis() - startTime; 
+        System.out.println("Time to init factory " + estimatedTime);
+        String fileStr1 = "src//test//resources//CI//csars//service-ServiceFdnt-csar-0904-2.csar";//ToscaParserStubsTest.class.getClassLoader().getResource("csars/service-ServiceFdnt-csar-0904-2.csar").getFile();
+        File file1 = new File(fileStr1);
+        String name = file1.getName();
+        String absolutePath = file1.getAbsolutePath();
+        ISdcCsarHelper fdntCsarHelper = factory.getSdcCsarHelper(file1.getAbsolutePath());
+        
+        List<NodeTemplate> serviceVfList = fdntCsarHelper.getServiceVfList();
+        serviceVfList.size();
+        for (NodeTemplate nodeTemplate : serviceVfList) {
+        	ArrayList<Object> requirements = nodeTemplate.getRequirements();
+        	requirements.size();
+        	LinkedHashMap<String, Capability> capabilities = nodeTemplate.getCapabilities();
+        	ArrayList<Object> requirements2 = nodeTemplate.getRequirements();
+        	
+        	System.out.println(nodeTemplate.getName());
+		}
+        
+	}
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java
new file mode 100644
index 0000000..c334695
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java
@@ -0,0 +1,301 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.devCI;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
+
+public class ArtifactFromCsar {
+	
+
+	public static void main(String[] args) throws Exception {
+		// TODO Auto-generated method stub
+		String zipFile = "C:\\Users\\rp955r\\Documents\\InTesting\\resource-CivfonboardedFdnt2f792348-csar.csar";
+		
+//		Map<String, Object> combinedMap = combineHeatArtifacstWithFolderArtifacsToMap(zipFile);
+		
+		Map<String, Object> vfcArtifacts = ArtifactFromCsar.getVFCArtifacts(zipFile);
+		
+		System.out.println("1234o");
+	}
+	
+	public static Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap(String pathToCsar) throws Exception {
+		return combineHeatArtifacstWithFolderArtifacsToMap(pathToCsar, "output");
+	}
+	
+	public static Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap(String pathToCsar, String outputCsar) throws Exception {
+		File csarFile = new File(pathToCsar);
+		
+		
+		File dir = new File(csarFile.getParent() + File.separator + outputCsar);
+			dir.mkdir();
+			if(!dir.exists()) {
+		}
+
+		String outputFolder = dir.getPath();
+		unZip(pathToCsar, outputFolder);
+		File directory = new File(outputFolder + File.separator + "Artifacts" + File.separator );
+		
+		Map<String, Object> artifactsMap = combineHeatArtifacstWithFolderArtifacsToMap(getMapArtifactFromFolderStructure(directory), getDeploymentArtifactListFromHeatMeta(csarFile, directory));
+		FileUtils.cleanDirectory(new File(outputFolder));
+		
+		return artifactsMap;
+	}
+	
+	public static Map<String, Object> getVFCArtifacts(String pathToCsar) throws Exception{
+		String outputFolder = unzipCsarFile(pathToCsar);
+		File directory = new File(outputFolder + File.separator + "Artifacts" + File.separator );
+		Map<String, Object> artifactsMap = getMapArtifactFromFolderStructure(directory);
+		cleanFolders(outputFolder);
+		
+		return artifactsMap;
+	}
+	
+	private static Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap(Map<String, Object> map, List<HeatMetaFirstLevelDefinition> rlist) {
+		if(map.get("Deployment") != null) {
+			rlist.addAll((Collection<? extends HeatMetaFirstLevelDefinition>) map.get("Deployment"));
+		}
+		map.put("Deployment", rlist);
+		return map;
+	}
+	
+	private static List<HeatMetaFirstLevelDefinition> getDeploymentArtifactListFromHeatMeta(File pathToCsar, File directory) throws Exception {
+		List<HeatMetaFirstLevelDefinition> artifactList = new LinkedList<HeatMetaFirstLevelDefinition>();
+		
+		List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(pathToCsar);
+
+	    for(TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition){
+	    	for(GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition.getGroupHeatMetaDefinition()){
+	        	artifactList.addAll(groupHeatMetaDefinition.getArtifactList());
+	        }
+	    }
+		
+	    List<HeatMetaFirstLevelDefinition> listArtifactWithTypesByList = getListArtifactWithTypesByList(directory, artifactList);
+		return listArtifactWithTypesByList;
+//	    return artifactList;
+		
+	}
+	
+	private static Map<String, Object> getMapArtifactFromFolderStructure(File pathToArtifactFolder) throws IOException {
+		
+		Map<String, Object> map = new HashMap<String, Object>();
+		
+		
+		final Path dir = Paths.get(pathToArtifactFolder.getPath());
+		final DirectoryStream<Path> dirStream = Files.newDirectoryStream(dir);
+		
+		dirStream.forEach(currFile -> {
+			File file = currFile.toFile();
+				if (file.isDirectory()) {
+					System.out.println(file.getName());
+					if(file.getName().toLowerCase().equals("deployment") || file.getName().toLowerCase().equals("informational")) {
+						map.put(file.getName(), getListArtifactWithTypes(file));
+					} else {
+						try {
+							map.put(file.getName(), getMapArtifactFromFolderStructure(file));
+						} catch (IOException e) {
+							// TODO Auto-generated catch block
+							e.printStackTrace();
+						}
+					}
+				}
+		});
+		
+		dirStream.close();
+		
+
+		
+//		
+//		File[] fileList = pathToArtifactFolder.listFiles();
+//		for(File file: fileList) {
+//			if (file.isDirectory()) {
+//				
+//				System.out.println(file.getName());
+//				if(file.getName().equals("Deployment") || file.getName().equals("Informational")) {
+//					map.put(file.getName(), getListArtifactWithTypes(file));
+//				} else {
+//					map.put(file.getName(), getMapArtifactFromFolderStructure(file));
+//				}
+//			}
+//		}
+		return map;
+	}
+	
+	
+	
+	private static List<HeatMetaFirstLevelDefinition> getListArtifactWithTypes(File folderPath) {
+		List<HeatMetaFirstLevelDefinition> artifactList = new LinkedList<HeatMetaFirstLevelDefinition>();
+		
+		File[] fileList = folderPath.listFiles();
+		
+		for(File file: fileList) {
+			File[] artifacts = file.listFiles();
+			
+			for(File artifact: artifacts) {
+//				HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(file.getName(), artifact.getName());
+				HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifact.getName(), file.getName(), crunchifyGetMd5ForFile(artifact));
+				artifactList.add(heatMetaFirstLevelDefinition);
+			}
+		}
+		
+		return artifactList;
+	}
+	
+	private static List<HeatMetaFirstLevelDefinition> getListArtifactWithTypesByList(File folderPath, List<HeatMetaFirstLevelDefinition> artifactLogicList) {
+				
+		
+		File[] fileList = folderPath.listFiles();
+		
+		
+		
+		for (HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition : artifactLogicList) {
+			
+			String fileName = heatMetaFirstLevelDefinition.getFileName();
+			
+			for (File fileFromFolder : fileList) {
+				if ( fileFromFolder.getName().equals(fileName)){
+					heatMetaFirstLevelDefinition.setCheckSum(crunchifyGetMd5ForFile(fileFromFolder));
+				}
+				
+			}
+		 }
+
+		return artifactLogicList;
+	}
+	
+	public static String crunchifyGetMd5ForFile(File crunchifyFile) {
+		String crunchifyValue = null;
+		FileInputStream crunchifyInputStream = null;
+		try {
+			crunchifyInputStream = new FileInputStream(crunchifyFile);
+ 
+			// md5Hex converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
+			// The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.
+			crunchifyValue = DigestUtils.md5Hex(IOUtils.toByteArray(crunchifyInputStream));
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+			IOUtils.closeQuietly(crunchifyInputStream);
+		}
+		return crunchifyValue;
+	}
+	
+	public static void unZip(String zipFile, String outputFolder) {
+		byte[] buffer = new byte[1024];
+
+	     try{
+	    	File folder = new File(outputFolder);
+	    	
+	    	if(!folder.exists()){
+	    		folder.mkdir();
+	    	}
+
+	    	ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));
+	    	ZipEntry ze = zis.getNextEntry();
+
+	    	while(ze!=null){
+
+	    	   String fileName = ze.getName();
+	    	   File newFile = new File(outputFolder + File.separator + fileName);
+	           
+	           if(ze.isDirectory()) {
+	        	   newFile.mkdir();
+	        	   ze = zis.getNextEntry();
+	        	   continue;
+	           }
+
+	            new File(newFile.getParent()).mkdirs();
+	            FileOutputStream fos = new FileOutputStream(newFile);
+
+	            int len;
+	            while ((len = zis.read(buffer)) > 0) {
+	            	fos.write(buffer, 0, len);
+	            }
+
+	            fos.close();
+	            ze = zis.getNextEntry();
+	    	}
+
+	        zis.closeEntry();
+	    	zis.close();
+
+	    } catch (IOException ex) {
+	       ex.printStackTrace();
+	    }
+
+	}
+	
+    private static void cleanFolders(String outputFolder) throws IOException {
+		System.gc();
+		FileUtils.cleanDirectory(new File(outputFolder));
+		FileUtils.deleteDirectory(new File(outputFolder));
+	}
+
+    private static String unzipCsarFile(String pathToCsar) {
+		File csarFile = new File(pathToCsar);
+		
+		
+		File dir = new File(csarFile.getParent() + File.separator + "output-" + UUID.randomUUID());
+		if(!dir.exists()) {
+			dir.mkdirs();
+		}
+
+		String outputFolder = dir.getPath();
+		ArtifactFromCsar.unZip(pathToCsar, outputFolder);
+		return outputFolder;
+	}
+
+	public static String[] getArtifactNamesFromCsar(String path, String csarFile) throws Exception {
+		Map<String, Object> combinedMap = combineHeatArtifacstWithFolderArtifacsToMap(path + csarFile);
+		LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
+		List<String> artifactNamesList = deploymentArtifacts.stream().map(e -> e.getFileName()).collect(Collectors.toList());
+		Object[] artifactNamesObjectArr = artifactNamesList.toArray();
+		String[] artifactNamesFromFile = Arrays.copyOf(artifactNamesObjectArr, artifactNamesObjectArr.length, String[].class);
+		return artifactNamesFromFile;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java
new file mode 100644
index 0000000..f66fd67
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarUpdate.java
@@ -0,0 +1,362 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.devCI;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.imports.ImportCsarResourceTest;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class ImportCsarUpdate extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ImportCsarUpdate() {
+		super(name, ImportCsarUpdate.class.getName());
+	}
+
+	@DataProvider(name = "happyArts")
+	public Object[][] getHappyArtifacts() {
+
+		return new Object[][] { { "happy_VF_RI2_G2_two_different_artifacts_under_heatBaseheatVolheatNet2" },
+				{ "happy_VF_RI2_G2_two_different_artifacts_under_heatBaseheatVolheatNet" },
+				{ "happy_VF_RI2_G2_two_identical_artifacts_under_heatBaseheatVolheatNet" },
+				{ "happy_VF_RI2_G2_two_different_artifacts_under_nested" },
+				{ "happy_VF_RI2_G2_two_indentical_nested_under_different_groups" },
+				{ "happy_VF_RI2_G2_two_different_nested_under_different_groups" },
+				{ "happy_VF_RI2_G2_two_different_nested_under_same_group" },
+
+		};
+	}
+
+	@DataProvider(name = "negativeArts")
+	public Object[][] getNegativeArtifacts() {
+
+		return new Object[][] {
+
+				{ "negative_VF_RI2_G2_same_heatVol_different_groups" },
+				{ "negative_VF_RI2_G2_same_heatBase_different_envs" },
+				{ "negative_VF_RI2_G2_heatBaseHeatVolHeatNet_under_nested" },
+				{ "negative_VF_RI2_G2_two_indentical_artifacts_under_nested" },
+				{ "negative_VF_RI2_G2_nested_under_nested" }, { "negative_VF_RI2_G2_same_heatVol_different_groups" }, };
+	}
+
+	@BeforeTest
+	public void resumeOrigCsarBefore() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportCsarResourceTest.copyCsarRest(sdncModifierDetails, "orig.csar", "importCsar_2Gartifacts.csar");
+
+	}
+
+	@AfterTest
+	public void resumeOrigCsarAfter() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportCsarResourceTest.copyCsarRest(sdncModifierDetails, "orig.csar", "importCsar_2Gartifacts.csar");
+
+	}
+
+	@Test
+	public void updateVFsearchByCsarIdCheckInState() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true)
+				.getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"updateImportCsar_2Gartifacts_topologyChanged.csar", "importCsar_2Gartifacts.csar");
+
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+	@Test
+	public void updateVFsearchByCsarIdCheckInState_checkSum() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true)
+				.getLeft();
+
+		// User sdncModifierDetails =
+		// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		// RestResponse copyRes =
+		// ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,"updateImportCsar_2Gartifacts_topologyChanged.csar","importCsar_2Gartifacts.csar");
+
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+	@Test
+	public void updateVFsearchByCsarIdCheckOutState() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		// Component resourceObject =
+		// AtomicOperationUtils.changeComponentState(resourceFirstImport,
+		// UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"updateImportCsar_2Gartifacts_topologyChanged.csar", "importCsar_2Gartifacts.csar");
+
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+	@Test
+	public void updateVFsearchByCsarIdCertifyStat() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
+				.getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"updateImportCsar_2Gartifacts_topologyChanged.csar", "importCsar_2Gartifacts.csar");
+
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+	@Test
+	public void updateVFsearchByCsarStartCertifaicationState() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"updateImportCsar_2Gartifacts_topologyChanged.csar", "importCsar_2Gartifacts.csar");
+
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+	@Test
+	public void updateVFsearchBySystemNameCheckInState() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true)
+				.getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"updateImportCsar_2Gartifacts_topologyChanged.csar", "importCsar_2Gartifacts.csar");
+
+		resourceDetails.setName("hardcodedNameChanged");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+	@Test
+	public void updateVFsearchBySystemNameCertifyState() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
+				.getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"updateImportCsar_2Gartifacts_topologyChanged.csar", "importCsar_2Gartifacts.csar");
+
+		resourceDetails.setName("hardcodedNameChanged");
+		resourceDetails.setCsarUUID("importCsar_2Gartifacts");
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+	}
+
+	@Test
+	public void updateVFsearchBySystemNameCsarIdNotExist() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("hardcodedName");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceFirstImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resourceFirstImport, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true)
+				.getLeft();
+		// User sdncModifierDetails =
+		// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		// RestResponse copyRes =
+		// ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,"updateImportCsar_2Gartifacts_topologyChanged.csar","importCsar_2Gartifacts.csar");
+		ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
+		resourceDetails2.setName("hardcodedName");
+		resourceDetails2.setCsarUUID("importCsar_2Gartifacts");
+		resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails2,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resourceSecondImport = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		// Validation Part
+
+		resourceFirstImport.getGroups().equals(resourceSecondImport.getGroups());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java
new file mode 100644
index 0000000..5ed71e5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java
@@ -0,0 +1,108 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.devCI;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class ImportCsarValidateArtifacts extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ImportCsarValidateArtifacts() {
+		super(name, ImportCsarValidateArtifacts.class.getName());
+	}
+
+	@DataProvider(name = "happyArts")
+	public Object[][] getHappyArtifacts() {
+
+		return new Object[][] { { "happy_VF_RI2_G2_two_different_artifacts_under_heatBaseheatVolheatNet2" },
+				{ "happy_VF_RI2_G2_two_different_artifacts_under_heatBaseheatVolheatNet" },
+				{ "happy_VF_RI2_G2_two_identical_artifacts_under_heatBaseheatVolheatNet" },
+				{ "happy_VF_RI2_G2_two_different_artifacts_under_nested" },
+				{ "happy_VF_RI2_G2_two_indentical_nested_under_different_groups" },
+				{ "happy_VF_RI2_G2_two_different_nested_under_different_groups" },
+				{ "happy_VF_RI2_G2_two_different_nested_under_same_group" },
+
+		};
+	}
+
+	@DataProvider(name = "negativeArts")
+	public Object[][] getNegativeArtifacts() {
+
+		return new Object[][] {
+
+				{ "negative_VF_RI2_G2_same_heatVol_different_groups" },
+				{ "negative_VF_RI2_G2_same_heatBase_different_envs" },
+				{ "negative_VF_RI2_G2_heatBaseHeatVolHeatNet_under_nested" },
+				{ "negative_VF_RI2_G2_two_indentical_artifacts_under_nested" },
+				{ "negative_VF_RI2_G2_nested_under_nested" }, { "negative_VF_RI2_G2_same_heatVol_different_groups" }, };
+	}
+
+	@Test(dataProvider = "happyArts")
+	public void createResourceFromCsarArtsHappy(String artifactName) throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(artifactName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		CsarValidationUtils.validateCsarVfArtifact(artifactName, resource);
+
+	}
+
+	@Test(dataProvider = "negativeArts")
+	public void createResourceFromCsarArtsNegative(String artifactName) throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(artifactName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		assertTrue(createResource.getErrorCode() != 201 && createResource.getErrorCode() != 500);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java
new file mode 100644
index 0000000..64df976
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java
@@ -0,0 +1,580 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.devCI;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
+import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+public class ToscaGroupInsideVF extends ComponentBaseTest {
+	private static Logger logger = LoggerFactory.getLogger(ToscaGroupInsideVF.class.getName());
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ToscaGroupInsideVF() {
+		super(name, ToscaGroupInsideVF.class.getName());
+	}
+
+	/*@Test
+	public void createResourceFromCsarArts() throws Exception {
+
+		// String csar = getCsar();
+		// parseCsar(csar);
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("VF_RI2_G6_withArtifacts");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		Resource vfManual = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, vfManual, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.changeComponentState(vfManual, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
+				.getLeft();
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(resourceObject, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(vfManual, service, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		AtomicOperationUtils
+				.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
+				.getLeft();
+		AtomicOperationUtils
+				.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CANCELCERTIFICATION, true)
+				.getLeft();
+		AtomicOperationUtils
+				.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
+				.getLeft();
+
+	}
+
+	@Test
+	public void soferTest() throws Exception {
+
+		// String csar = getCsar();
+		// parseCsar(csar);
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("sofer");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+	}
+
+	@Test
+	public void createVFwith2VLs() throws Exception {
+
+		// String csar = getCsar();
+		// parseCsar(csar);
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("VSPPackage");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		Component resourceObject = AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		Resource vfManual = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, vfManual, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.changeComponentState(vfManual, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
+				.getLeft();
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(resourceObject, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(vfManual, service, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		AtomicOperationUtils
+				.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
+				.getLeft();
+		AtomicOperationUtils
+				.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CANCELCERTIFICATION, true)
+				.getLeft();
+		AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
+				.getLeft();
+
+	}
+
+	@Test // (enabled = false)
+	public void createResourceFromCsarHappy() throws Exception {
+		// String csarUUID = "VF_RI2_G2_withArtifacts";
+		String csarUUID = "VF_RI2_G1_Invalid";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+	}
+
+	@Test // (enabled = false)
+	public void createResourceFromCsarWithProperty() throws Exception {
+		String csarUUID = "VF_RI2_G4_withArtifacts";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+	}
+
+	@Test // (enabled = false)
+	public void UpdateCsarWithNonExistingResourceInstanceFail() throws Exception {
+
+		// String csarUUID = "VF_RI2_G1-RI_NotExist";
+		// String csarUUID = "nested3";
+
+		// String csarUUID = "VF_RI2_G1_Invalid_WithArtifacts";
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		String csarUUID = "VF_RI2_G4_withArtifacts.csar";
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifactsRI_FAIL.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails.setName(resource.getName());
+		// resourceDetails.setVendorName("Govnuk");
+		// resourceDetails.setDescription("Other");
+		RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource2);
+		Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
+
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+		ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+		CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
+
+		// CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
+		// ToscaDefinition toscaDefinition2 =
+		// ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
+		// CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
+		// resource2);
+
+		// Csar csar = parserTocsarObject(csarUUID);
+		// validateCsarVsResourceObj(csar, resource);
+		// csar.node_types();
+
+	}
+
+	@Test // (enabled = false)
+	public void UpdateCsarWithSameCsarDifferentMetadata() throws Exception {
+
+		// User sdncModifierDetails =
+		// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		// RestResponse copyRes =
+		// copyCsarRest(sdncModifierDetails,"VF_RI2_G4_withArtifacts_a.csar","VF_RI2_G4_withArtifacts.csar");
+		// BaseRestUtils.checkSuccess(copyRes);
+		String csarUUID = "VF_RI2_G4_withArtifacts.csar";
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		resourceDetails.setName(resource.getName());
+		resourceDetails.setVendorName("Govnuk");
+		resourceDetails.setDescription("Other");
+		RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource2);
+		Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
+
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+		ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+		CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
+
+		// CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
+		// ToscaDefinition toscaDefinition2 =
+		// ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
+		// CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
+		// resource2);
+
+		// Csar csar = parserTocsarObject(csarUUID);
+		// validateCsarVsResourceObj(csar, resource);
+		// csar.node_types();
+
+	}
+
+	@Test // (enabled = false)
+	public void UpdateCsarWithSameCsar() throws Exception {
+
+		// User sdncModifierDetails =
+		// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		// RestResponse copyRes =
+		// copyCsarRest(sdncModifierDetails,"VF_RI2_G4_withArtifacts_a.csar","VF_RI2_G4_withArtifacts.csar");
+		// BaseRestUtils.checkSuccess(copyRes);
+		String csarUUID = "VF_RI2_G4_withArtifacts.csar";
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		resourceDetails.setName(resource.getName());
+		RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource2);
+		Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
+
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+		ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+		CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
+
+		// CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
+		// ToscaDefinition toscaDefinition2 =
+		// ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
+		// CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
+		// resource2);
+
+		// Csar csar = parserTocsarObject(csarUUID);
+		// validateCsarVsResourceObj(csar, resource);
+		// csar.node_types();
+
+	}
+
+	@Test // (enabled = false)
+	public void UpdateCsarCertifiedVfWithSameCsar() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		String csarUUID = "VF_RI2_G4_withArtifacts.csar";
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(resource,
+				UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		resource = (Resource) changeComponentState.getLeft();
+
+		resourceDetails.setName(resource.getName());
+		RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource2);
+		Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
+
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+		ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+		CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
+
+		// CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
+		// ToscaDefinition toscaDefinition2 =
+		// ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
+		// CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
+		// resource2);
+
+		// Csar csar = parserTocsarObject(csarUUID);
+		// validateCsarVsResourceObj(csar, resource);
+		// csar.node_types();
+
+	}
+
+	@Test // (enabled = false)
+	public void UpdateCsarDifferentTosca() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		String csarUUID = "VF_RI2_G4_withArtifacts.csar";
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifactsUpdated.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails.setName(resource.getName());
+		RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource2);
+		Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
+
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+		ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+		CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
+
+		// CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
+		// ToscaDefinition toscaDefinition2 =
+		// ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
+		// CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
+		// resource2);
+
+		// Csar csar = parserTocsarObject(csarUUID);
+		// validateCsarVsResourceObj(csar, resource);
+		// csar.node_types();
+
+	}
+
+	@Test // (enabled = false)
+	public void UpdateCsarDifferentToscaAndArtifacts() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		String csarUUID = "VF_RI2_G4_withArtifacts.csar";
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_UpdateToscaAndArtifacts.csar",
+				"VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails.setName(resource.getName());
+		RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource2);
+		Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
+
+		CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
+		ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+		CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
+
+		// CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
+		// ToscaDefinition toscaDefinition2 =
+		// ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
+		// CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
+		// resource2);
+
+		// Csar csar = parserTocsarObject(csarUUID);
+		// validateCsarVsResourceObj(csar, resource);
+		// csar.node_types();
+
+	}
+
+	@Test // (enabled = false)
+	public void migration() throws Exception {
+		String csarUUID = "VF_RI2_G4_withArtifacts";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setName("Resource1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		resourceDetails.setName("Resource2");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+		resourceDetails.setName("Resource3");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		resourceDetails.setName("Resource4");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+		resourceDetails.setName("Resource5");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+		resourceDetails.setName("Resource6");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true)
+				.getLeft();
+
+		resourceDetails.setName("Resource7");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils
+				.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
+				.getLeft();
+
+		logger.debug("7 VF resources were created");
+
+	}
+
+	public static RestResponse copyCsarRest(User sdncModifierDetails, String sourceCsarUuid, String targetCsarUuid)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.COPY_CSAR_USING_SIMULATOR, config.getCatalogBeHost(), config.getCatalogBePort(),
+				sourceCsarUuid, targetCsarUuid);
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+
+		RestResponse copyCsarResponse = http.httpSendPost(url, "dummy", headersMap);
+		if (copyCsarResponse.getErrorCode() != 200) {
+			return null;
+		}
+		return copyCsarResponse;
+
+	}
+
+	private static Map<String, String> prepareHeadersMap(String userId) {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+		return headersMap;
+	}
+
+	public static void main(String[] args) throws Exception {
+		// String csarUUID = "VF_RI2_G4_withArtifacts";
+		String csarUUID = "node_types";
+		ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
+	}*/
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java
new file mode 100644
index 0000000..7acf120
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java
@@ -0,0 +1,96 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.devCI;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.DistributionNotificationStatusEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.DistributionValidationUtils;
+import org.openecomp.sdc.externalApis.CRUDExternalAPI;
+import org.testng.annotations.Test;
+
+import fj.data.Either;
+
+public class test1 extends ComponentBaseTest{
+
+	@Rule 
+	public static TestName name = new TestName();
+
+	public test1() {
+		super(name, CRUDExternalAPI.class.getName());
+
+	}
+	
+	@Test()
+	public void uploadArtifactOnServiceViaExternalAPI() throws Exception {
+		Config config = Utils.getConfig();	
+		
+		Service service = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_QUERY_SPEC, service, UserRoleEnum.DESIGNER, true, true);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		if(config.getIsDistributionClientRunning()){
+			List<String> distributionStatusList = Arrays.asList(DistributionNotificationStatusEnum.DOWNLOAD_OK.toString(), DistributionNotificationStatusEnum.DEPLOY_OK.toString(), DistributionNotificationStatusEnum.NOTIFIED.toString());
+			DistributionValidationUtils.validateDistributedArtifactsByAudit(service, distributionStatusList);
+		}
+	}
+
+	
+	public static Map<String, String> addVNF_ModuleDeploymentArtifactToMap(Service service, Map<String, String> distributionArtifactMap){
+		
+		
+		return distributionArtifactMap;
+	}
+	
+	public Component getComponentInTargetLifeCycleState(String componentType, UserRoleEnum creatorUser, LifeCycleStatesEnum targetLifeCycleState) throws Exception {
+		Component component = null;
+		
+		if(componentType.toLowerCase().equals("vf")) {
+			Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, creatorUser, true);
+			component = createdResource.left().value();
+			component = AtomicOperationUtils.changeComponentState(component, creatorUser, targetLifeCycleState, true).getLeft();
+		} else {
+			Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(creatorUser, true);
+			component = createdResource.left().value();
+			component = AtomicOperationUtils.changeComponentState(component, creatorUser, targetLifeCycleState, true).getLeft();
+		}
+		
+		return component;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java
new file mode 100644
index 0000000..b4a9bb8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java
@@ -0,0 +1,186 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.distribution;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedAuthenticationAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.util.ValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class AuthanticationTests extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected User sdncUserDetails;
+
+	protected static final String AUTH_SUCCESS = "AUTH_SUCCESS";
+
+	protected static final String AUTH_REQUIRED = "AUTH_REQUIRED";
+
+	// user ci password 123456
+	// protected final String authorizationHeader = "Basic Y2k6MTIzNDU2";
+	// user ci password 123456
+	protected final String USER = "ci";
+	protected final String PASSWORD = "123456";
+	protected final String SALT = "2a1f887d607d4515d4066fe0f5452a50";
+	protected final String HASHED_PASSWORD = "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b";
+	protected User sdncAdminUserDetails;
+	protected ConsumerDataDefinition consumerDataDefinition;
+
+	public AuthanticationTests() {
+		super(name, AuthanticationTests.class.getName());
+	}
+
+	@DataProvider
+	private final Object[][] getServiceDepArtType() throws IOException, Exception {
+		return new Object[][] { { ArtifactTypeEnum.YANG_XML.getType() }, { ArtifactTypeEnum.OTHER.getType() } };
+	}
+
+	@BeforeMethod
+	public void setup() throws Exception {
+		resourceDetails = ElementFactory.getDefaultResource();
+		serviceDetails = ElementFactory.getDefaultService();
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		createComponents();
+		consumerDataDefinition = createConsumer();
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+		;
+
+		RestResponse createResponse = ConsumerRestUtils.createConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		BaseRestUtils.checkCreateResponse(createResponse);
+
+	}
+
+	@AfterMethod
+	public void tearDown() throws Exception {
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+		;
+
+	}
+
+	protected ConsumerDataDefinition createConsumer() {
+		ConsumerDataDefinition consumer = new ConsumerDataDefinition();
+		consumer.setConsumerName(USER);
+		consumer.setConsumerSalt(SALT);
+		consumer.setConsumerPassword(HASHED_PASSWORD);
+		return consumer;
+
+	}
+
+	protected void createComponents() throws Exception {
+		RestResponse response = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		ServiceRestUtils.checkCreateResponse(response);
+	}
+
+	@Test(dataProvider = "getServiceDepArtType", description = "mumu")
+	public void downloadServiceArtifactSuccessWithAutantication(String serviceDepArtType) throws Exception {
+		String serviceUniqueId = serviceDetails.getUniqueId();
+
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(serviceDepArtType);
+
+		RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails,
+				sdncUserDetails, serviceUniqueId, ArtifactRestUtils.calculateChecksum(artifactDetails));
+		AssertJUnit.assertEquals("Check response code after adding interface artifact", 200,
+				addArtifactResponse.getErrorCode().intValue());
+
+		String artifactName = ValidationUtils.normalizeFileName(artifactDetails.getArtifactName());
+		// Thread.sleep(5000);
+		Map<String, String> authorizationHeaders = BaseRestUtils.addAuthorizeHeader(USER, PASSWORD);
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, artifactDetails,
+				sdncUserDetails, authorizationHeaders);
+		AssertJUnit.assertEquals("Check response code after download resource", 200,
+				restResponse.getErrorCode().intValue());
+
+		List<String> contDispHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_DISPOSITION_HEADER);
+		AssertJUnit.assertNotNull(contDispHeaderList);
+		AssertJUnit.assertEquals("Check content disposition header",
+				new StringBuilder().append("attachment; filename=\"").append(artifactName).append("\"").toString(),
+				contDispHeaderList.get(0));
+
+		String downloadUrl = ArtifactRestUtils
+				.getPartialUrlByArtifactName(serviceDetails, serviceDetails.getVersion(), artifactName).substring(6);
+
+		ExpectedAuthenticationAudit expectedAuthenticationAudit = new ExpectedAuthenticationAudit(downloadUrl, USER,
+				AuditingActionEnum.AUTH_REQUEST.getName(), AUTH_SUCCESS);
+		AuditValidationUtils.validateAuthenticationAudit(expectedAuthenticationAudit);
+	}
+
+	@Test(dataProvider = "getServiceDepArtType")
+	public void downloadServiceArtifactWithOutAutantication(String serviceDepArtType) throws Exception {
+		String serviceUniqueId = serviceDetails.getUniqueId();
+
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(serviceDepArtType);
+
+		RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails,
+				sdncUserDetails, serviceUniqueId, ArtifactRestUtils.calculateChecksum(artifactDetails));
+		assertEquals("Check response code after adding interface artifact", 200,
+				addArtifactResponse.getErrorCode().intValue());
+
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, artifactDetails,
+				sdncUserDetails, authorizationHeaders);
+		assertEquals("Check response code after download resource failure", 401,
+				restResponse.getErrorCode().intValue());
+
+		String downloadUrl = ArtifactRestUtils.getPartialUrlByArtifactName(serviceDetails, serviceDetails.getVersion(),
+				artifactDetails.getArtifactName()).substring(6);
+		ExpectedAuthenticationAudit expectedAuthenticationAudit = new ExpectedAuthenticationAudit(downloadUrl, "",
+				AuditingActionEnum.AUTH_REQUEST.getName(), AUTH_REQUIRED);
+		AuditValidationUtils.validateAuthenticationAudit(expectedAuthenticationAudit);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java
new file mode 100644
index 0000000..7ba705f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java
@@ -0,0 +1,537 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.distribution;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipInputStream;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedDistDownloadAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.util.GeneralUtility;
+import org.openecomp.sdc.common.util.ValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class DistributionDownloadArtifactTest extends ComponentBaseTest {
+
+	protected static ResourceReqDetails resourceDetails;
+	protected static User designerUser;
+	protected static User adminUser;
+	protected static String resourceBaseVersion;
+	// user ci password 123456
+	protected final String authorizationHeader = "Basic Y2k6MTIzNDU2";
+	protected ConsumerDataDefinition consumerDataDefinition;
+
+	@Rule
+	public static TestName name = new TestName();
+	protected static String artifactInterfaceType;
+	protected static String artifactOperationName;
+
+	protected static ServiceReqDetails serviceDetails;
+	protected static String serviceBaseVersion;
+	protected static String serviceUniqueId;
+	protected final String USER = "ci";
+	protected final String PASSWORD = "123456";
+	protected final String SALT = "2a1f887d607d4515d4066fe0f5452a50";
+	protected final String HASHED_PASSWORD = "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b";
+
+	public DistributionDownloadArtifactTest() {
+		super(name, DistributionDownloadArtifactTest.class.getName());
+	}
+
+	// @BeforeClass
+	// public static void InitBeforeTest() throws Exception
+	// {
+	//
+	//
+	// resourceBaseVersion = "0.1";
+	// serviceBaseVersion = "0.1";
+	// designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	// adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// resourceDetails =
+	// ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+	// NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS,
+	// adminUser);
+	// serviceDetails = ElementFactory.getDefaultService();
+	// serviceUniqueId = "svc_" + serviceDetails.getName().toLowerCase() + "." +
+	// serviceBaseVersion;
+	// artifactInterfaceType = "standard";
+	// artifactOperationName = "start";
+	// }
+
+	@BeforeMethod
+	public void setup() throws Exception {
+
+		resourceBaseVersion = "0.1";
+		serviceBaseVersion = "0.1";
+		designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		resourceDetails = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, adminUser);
+		serviceDetails = ElementFactory.getDefaultService();
+		serviceUniqueId = "svc_" + serviceDetails.getName().toLowerCase() + "." + serviceBaseVersion;
+		artifactInterfaceType = "standard";
+		artifactOperationName = "start";
+		consumerDataDefinition = createConsumer();
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, adminUser);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+
+		RestResponse createResponse = ConsumerRestUtils.createConsumer(consumerDataDefinition, adminUser);
+		BaseRestUtils.checkCreateResponse(createResponse);
+	}
+
+	@Test
+	public void downloadResourceArtifactSuccess() throws Exception {
+		// Create service
+		RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
+		AssertJUnit.assertEquals("Check response code after creating resource", 201,
+				serviceResponse.getErrorCode().intValue());
+
+		// Create resource
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
+		AssertJUnit.assertEquals("Check response code after creating resource", 201,
+				createResource.getErrorCode().intValue());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
+
+		ArtifactReqDetails artifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		// Setting the name to be with space
+		artifactDetails.setArtifactName("test artifact file.yaml");
+		// artifactDetails.set(ArtifactRestUtils.calculateChecksum(artifactDetails));
+
+		RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails,
+				designerUser, resource.getUniqueId(), ArtifactRestUtils.calculateChecksum(artifactDetails));
+		AssertJUnit.assertEquals("Check response code after adding interface artifact", 200,
+				addArtifactResponse.getErrorCode().intValue());
+
+		// Getting expected artifact checksum
+		ArtifactDefinition artifactResp = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addArtifactResponse.getResponse());
+		String expectedPayloadChecksum = artifactResp.getArtifactChecksum();
+
+		Config config = Utils.getConfig();
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion,
+				ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(),
+				artifactResp.getArtifactName()));
+		// String fullUrlFormatted =
+		// String.format(Urls.DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL,
+		// config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
+		// String consumerId = "dummy.ecomp";
+
+		ResourceReqDetails resourceInfo = new ResourceReqDetails();
+		resourceInfo.setName(resource.getName());
+		resourceInfo.setVersion(resource.getVersion());
+
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resourceInfo,
+				artifactDetails, designerUser, authorizationHeaders);
+		// RestResponse restResponse =
+		// artifactUtils.downloadResourceArtifact(designerUser,fullUrlFormatted,
+		// consumerId,true);
+		AssertJUnit.assertEquals("Check response code after download resource", 200,
+				restResponse.getErrorCode().intValue());
+
+		// Validating headers
+		// content disposition
+		List<String> contDispHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_DISPOSITION_HEADER);
+		AssertJUnit.assertNotNull(contDispHeaderList);
+		AssertJUnit
+				.assertEquals(
+						"Check content disposition header", new StringBuilder().append("attachment; filename=\"")
+								.append(artifactResp.getArtifactName()).append("\"").toString(),
+						contDispHeaderList.get(0));
+
+		// content type
+		List<String> contTypeHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_TYPE_HEADER);
+		AssertJUnit.assertNotNull(contTypeHeaderList);
+		AssertJUnit.assertEquals("Check content type", "application/octet-stream", contTypeHeaderList.get(0));
+
+		String actualContents = restResponse.getResponse();
+
+		// Contents - comparing decoded content
+		AssertJUnit.assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes()));
+
+		// validating checksum
+		String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(actualContents.getBytes());
+		AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum);
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
+				BaseRestUtils.ecomp, relativeUrl, "200", "OK");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	protected void download_serviceNameNotFound_inner(String serviceName, String serviceVersion, String resourceName,
+			String resourceVersion) throws Exception {
+		Config config = Utils.getConfig();
+		String artifactName = "kuku";
+		ArtifactReqDetails artifact = new ArtifactReqDetails();
+		artifact.setArtifactName(artifactName);
+		String relativeUrl;
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		ServiceReqDetails serviceInfo = new ServiceReqDetails();
+		serviceInfo.setName(serviceName);
+		serviceInfo.setVersion(serviceVersion);
+		RestResponse restResponse = null;
+		if (resourceName != null) {
+			ResourceReqDetails resourceDetailes = new ResourceReqDetails();
+			resourceDetailes.setName(resourceName);
+			resourceDetailes.setVersion(resourceVersion);
+			relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+					ValidationUtils.convertToSystemName(serviceName), serviceVersion,
+					ValidationUtils.convertToSystemName(resourceName), resourceVersion, artifactName));
+			restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceInfo, resourceDetailes, artifact,
+					designerUser, authorizationHeaders);
+		} else {
+			relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
+					ValidationUtils.convertToSystemName(serviceName), serviceVersion, artifactName));
+			restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceInfo, artifact, designerUser,
+					authorizationHeaders);
+		}
+
+		// RestResponse restResponse =
+		// artifactUtils.downloadResourceArtifact(designerUser,fullUrlFormatted,
+		// consumerId,true);
+		AssertJUnit.assertEquals("Check response code after download resource", 404,
+				restResponse.getErrorCode().intValue());
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
+				BaseRestUtils.ecomp, relativeUrl, "404", "SVC4503: Error: Requested '"
+						+ ValidationUtils.convertToSystemName(serviceName) + "' service was not found.");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	protected void download_serviceVersionNotFound_inner(String serviceName, String serviceVersion, String resourceName,
+			String resourceVersion) throws Exception {
+		Config config = Utils.getConfig();
+		String artifactName = "kuku";
+		String relativeUrl;
+		ArtifactReqDetails artifact = new ArtifactReqDetails();
+		artifact.setArtifactName(artifactName);
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		ServiceReqDetails serviceInfo = new ServiceReqDetails();
+		serviceInfo.setName(serviceName);
+		serviceInfo.setVersion(serviceVersion);
+		RestResponse restResponse = null;
+		if (resourceName != null) {
+			ResourceReqDetails resourceDetailes = new ResourceReqDetails();
+			resourceDetailes.setName(resourceName);
+			resourceDetailes.setVersion(resourceVersion);
+			relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+					ValidationUtils.convertToSystemName(serviceName), serviceVersion,
+					ValidationUtils.convertToSystemName(resourceName), resourceVersion, artifactName));
+			restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceInfo, resourceDetailes, artifact,
+					designerUser, authorizationHeaders);
+		} else {
+			relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
+					ValidationUtils.convertToSystemName(serviceName), serviceVersion, artifactName));
+			restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceInfo, artifact, designerUser,
+					authorizationHeaders);
+		}
+		// String fullUrlFormatted =
+		// String.format(Urls.DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL,
+		// config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
+		// String consumerId = "dummy.ecomp";
+
+		// RestResponse restResponse =
+		// artifactUtils.downloadResourceArtifact(designerUser,fullUrlFormatted,
+		// consumerId,true);
+		AssertJUnit.assertEquals("Check response code after download resource", 404,
+				restResponse.getErrorCode().intValue());
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
+				BaseRestUtils.ecomp, relativeUrl, "404",
+				"SVC4504: Error: Service version " + serviceVersion + " was not found.");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	protected String encodeUrlForDownload(String url) {
+		return url.replaceAll(" ", "%20");
+	}
+
+	protected ConsumerDataDefinition createConsumer() {
+		ConsumerDataDefinition consumer = new ConsumerDataDefinition();
+		consumer.setConsumerName(USER);
+		consumer.setConsumerSalt(SALT);
+		consumer.setConsumerPassword(HASHED_PASSWORD);
+		return consumer;
+
+	}
+
+	@Test(enabled = false)
+	public void downloadServiceArtifactSuccess() throws Exception {
+		// Create service
+		RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
+		assertEquals("Check response code after creating resource", 201, serviceResponse.getErrorCode().intValue());
+		serviceUniqueId = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse())
+				.getUniqueId();
+
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType("MURANO_PKG");
+
+		RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails,
+				designerUser, serviceUniqueId, ArtifactRestUtils.calculateMD5Header(artifactDetails));
+		assertEquals("Check response code after adding interface artifact", 200,
+				addArtifactResponse.getErrorCode().intValue());
+
+		// Getting expected artifact checksum
+
+		// ArtifactResJavaObject artifactResp =
+		// artifactUtils.parseInformationalArtifactResp(addArtifactResponse);
+		String expectedPayloadChecksum = ResponseParser
+				.convertArtifactDefinitionResponseToJavaObject(addArtifactResponse.getResponse()).getArtifactChecksum();
+
+		String artifactName = ValidationUtils.normalizeFileName(artifactDetails.getArtifactName());
+
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion, artifactName));
+
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, artifactDetails,
+				designerUser, authorizationHeaders);
+		assertEquals("Check response code after download resource", 200, restResponse.getErrorCode().intValue());
+
+		// Validating headers
+		// content disposition
+		List<String> contDispHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_DISPOSITION_HEADER);
+		assertNotNull(contDispHeaderList);
+		assertEquals("Check content disposition header",
+				new StringBuilder().append("attachment; filename=\"").append(artifactName).append("\"").toString(),
+				contDispHeaderList.get(0));
+
+		// content type
+		List<String> contTypeHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_TYPE_HEADER);
+		assertNotNull(contTypeHeaderList);
+		assertEquals("Check content type", "application/octet-stream", contTypeHeaderList.get(0));
+
+		String actualContents = restResponse.getResponse();
+
+		assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes()));
+
+		// validating checksum
+		byte[] bytes = actualContents.getBytes();
+		String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(bytes);
+		assertEquals(expectedPayloadChecksum, actualPayloadChecksum);
+
+		// validating valid zip
+		InputStream is = new ByteArrayInputStream(bytes);
+		InputStream zis = new ZipInputStream(is);
+		zis.close();
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
+				ResourceRestUtils.ecomp, encodeUrlForDownload(relativeUrl), "200", "OK");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	@Test
+	public void downloadResourceArtifact_NoConsumerId() throws Exception {
+
+		String artifactName = "kuku";
+		ArtifactReqDetails artifact = new ArtifactReqDetails();
+		artifact.setArtifactName(artifactName);
+		ResourceReqDetails resource = new ResourceReqDetails();
+		resource.setName("notExisting");
+		resource.setVersion("0.1");
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion,
+				ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(), artifactName));
+		serviceDetails.setVersion("0.1");
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resource, artifact,
+				designerUser, authorizationHeaders, false);
+		assertEquals("Check response code after download resource", 400, restResponse.getErrorCode().intValue());
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction, "",
+				relativeUrl, "400", "POL5001: Error: Missing 'X-ECOMP-InstanceID' HTTP header.");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	@Test
+	public void downloadResourceArtifact_ResourceNameNotFound() throws Exception {
+
+		String artifactName = "kuku";
+		ArtifactReqDetails artifact = new ArtifactReqDetails();
+		artifact.setArtifactName(artifactName);
+		ResourceReqDetails resource = new ResourceReqDetails();
+		resource.setName("notExisting");
+		resource.setVersion("0.1");
+		serviceDetails.setVersion("0.1");
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceDetails.getVersion(),
+				ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(), artifactName));
+
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resource, artifact,
+				designerUser, authorizationHeaders);
+
+		assertEquals("Check response code after download resource", 404, restResponse.getErrorCode().intValue());
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
+				BaseRestUtils.ecomp, relativeUrl, "404",
+				"SVC4063: Error: Requested 'Notexisting' resource was not found.");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	@Test
+	public void downloadResourceArtifact_ResourceVersionNotFound() throws Exception {
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
+		assertEquals("Check response code after creating resource", 201, createResource.getErrorCode().intValue());
+
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
+		ResourceReqDetails resourceDetailes = new ResourceReqDetails();
+		resourceDetailes.setName(resource.getName());
+		resourceDetailes.setVersion("0.2");
+
+		serviceDetails.setVersion("0.1");
+
+		String artifactName = "kuku";
+		ArtifactReqDetails artifact = new ArtifactReqDetails();
+		artifact.setArtifactName(artifactName);
+
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion,
+				ValidationUtils.convertToSystemName(resourceDetailes.getName()), resourceDetailes.getVersion(),
+				artifactName));
+
+		Map<String, String> authorizationHeaders = new HashMap<String, String>();
+		authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resourceDetailes,
+				artifact, designerUser, authorizationHeaders);
+		assertEquals("Check response code after download resource", 404, restResponse.getErrorCode().intValue());
+
+		// validate audit
+		String auditAction = "DArtifactDownload";
+
+		ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
+				BaseRestUtils.ecomp, relativeUrl, "404", "SVC4504: Error: Resource version 0.2 was not found.");
+		AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
+	}
+
+	@Test
+	public void downloadResourceArtifact_ServiceNameNotFound() throws Exception {
+		// Create resource
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
+		assertEquals("Check response code after creating resource", 201, createResource.getErrorCode().intValue());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
+		download_serviceNameNotFound_inner("notExistingServiceName", serviceBaseVersion, resource.getName(),
+				resource.getVersion());
+
+	}
+
+	@Test
+	public void downloadResourceArtifact_ServiceVersionNotFound() throws Exception {
+		// Create resource
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
+		assertEquals("Check response code after creating resource", 201, createResource.getErrorCode().intValue());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
+
+		// Create service
+		RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
+		assertEquals("Check response code after creating resource", 201, serviceResponse.getErrorCode().intValue());
+		serviceUniqueId = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse())
+				.getUniqueId();
+
+		download_serviceVersionNotFound_inner(serviceDetails.getName(), "0.3", resource.getName(),
+				resource.getVersion());
+	}
+
+	@Test
+	public void downloadServiceArtifact_ServiceNameNotFound() throws Exception {
+		download_serviceNameNotFound_inner("notExistingServiceName", serviceBaseVersion, null, null);
+
+	}
+
+	@Test
+	public void downloadServiceArtifact_ServiceVersionNotFound() throws Exception {
+
+		// Create service
+		RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
+		assertEquals("Check response code after creating resource", 201, serviceResponse.getErrorCode().intValue());
+		serviceUniqueId = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse())
+				.getUniqueId();
+
+		download_serviceVersionNotFound_inner(serviceDetails.getName(), "0.2", null, null);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java
new file mode 100644
index 0000000..80b70d6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java
@@ -0,0 +1,385 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.externalapi;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class DownloadArtifactsTest extends ComponentBaseTest {
+	@Rule
+	public static TestName name = new TestName();
+
+	Gson gson = new Gson();
+
+	public DownloadArtifactsTest() {
+		super(name, DownloadArtifactsTest.class.getName());
+	}
+
+	private User sdncDesignerDetails;
+	private User sdncAdminDetails;
+	private ImportReqDetails resourceDetailsVF_01;
+	private ResourceReqDetails resourceDetailsVF_02;
+	private ResourceReqDetails resourceDetailsVF_03;
+	private ResourceReqDetails resourceDetailsCP_01;
+	private ServiceReqDetails serviceDetails_01;
+	private ServiceReqDetails serviceDetails_02;
+	public static String rootPath = System.getProperty("user.dir");
+
+	@BeforeMethod(alwaysRun = true)
+	public void before() throws Exception {
+		init();
+		createComponents();
+	}
+
+	private void createComponents() throws Exception {
+		createAtomicResource(resourceDetailsCP_01);
+		importVfWithArtifacts(resourceDetailsVF_01);
+		createVF(resourceDetailsVF_03);
+		createVF(resourceDetailsVF_02);
+		createService(serviceDetails_01);
+	}
+
+	public void init() {
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		resourceDetailsVF_01 = ElementFactory.getDefaultImportResourceByType("VF100", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		resourceDetailsVF_02 = ElementFactory.getDefaultResourceByType("VF200", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		resourceDetailsVF_03 = ElementFactory.getDefaultResourceByType("VF300", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		resourceDetailsCP_01 = ElementFactory.getDefaultResourceByType("CP100", NormativeTypesEnum.PORT,
+				ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.CP.toString());
+		serviceDetails_01 = ElementFactory.getDefaultService("newtestservice1", ServiceCategoriesEnum.MOBILITY,
+				sdncDesignerDetails.getUserId());
+		serviceDetails_02 = ElementFactory.getDefaultService("newtestservice2", ServiceCategoriesEnum.MOBILITY,
+				sdncDesignerDetails.getUserId());
+	}
+
+	@Test
+	public void downloadResourceInstanceArtifactsFromServiceTest() throws Exception {
+		Service service = createServiceWithRIsWithArtifacts();
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		List<ComponentInstance> resourceInstances = service.getComponentInstances();
+		for (ComponentInstance ri : resourceInstances) {
+			deploymentArtifacts = ri.getDeploymentArtifacts();
+			for (ArtifactDefinition artifact : deploymentArtifacts.values()) {
+				assertNotNull(downloadResourceInstanceArtifact(service, ri, artifact));
+			}
+		}
+	}
+
+	@Test
+	public void downloadServiceArtifactsTest() throws Exception {
+		Service service = createServiceWithArtifacts();
+		Map<String, ArtifactDefinition> deploymentArtifacts = service.getDeploymentArtifacts();
+		for (ArtifactDefinition artifact : deploymentArtifacts.values()) {
+			assertNotNull(downloadServiceArtifact(service, artifact));
+		}
+
+	}
+
+	private Service createServiceWithArtifacts() throws Exception {
+
+		ArtifactReqDetails otherArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.OTHER.getType());
+
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(
+				otherArtifactDetails, sdncDesignerDetails, serviceDetails_01.getUniqueId());
+		assertTrue(
+				"response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :"
+						+ addInformationalArtifactToService.getErrorCode(),
+				addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		ArtifactReqDetails yangXmlArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.YANG_XML.getType());
+
+		addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(yangXmlArtifactDetails,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId());
+		assertTrue(
+				"response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :"
+						+ addInformationalArtifactToService.getErrorCode(),
+				addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		RestResponse createServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		return ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse());
+	}
+
+	private RestResponse downloadResourceInstanceArtifact(Service service, ComponentInstance ri,
+			ArtifactDefinition artifact) throws Exception {
+		String url = String.format(Urls.GET_DOWNLOAD_SERVICE_RI_ARTIFACT, "localhost", "8080", service.getUUID(),
+				ri.getUniqueId(), artifact.getArtifactUUID());
+		String userId = sdncDesignerDetails.getUserId();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), "Basic dGVzdDoxMjM0NTY=");
+		headersMap.put("X-ECOMP-InstanceID", "test");
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+		sendAuthorizationRequest();
+		HttpRequest http = new HttpRequest();
+		RestResponse response = http.httpSendGet(url, headersMap);
+		if (response.getErrorCode() != 200 && response.getResponse().getBytes() == null
+				&& response.getResponse().getBytes().length == 0) {
+			return null;
+		}
+		return response;
+	}
+
+	private RestResponse downloadServiceArtifact(Service service, ArtifactDefinition artifact) throws Exception {
+		String url = String.format(Urls.GET_DOWNLOAD_SERVICE_ARTIFACT, "localhost", "8080", service.getUUID(),
+				artifact.getArtifactUUID());
+		String userId = sdncDesignerDetails.getUserId();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), "Basic dGVzdDoxMjM0NTY=");
+		headersMap.put("X-ECOMP-InstanceID", "test");
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+		sendAuthorizationRequest();
+		HttpRequest http = new HttpRequest();
+		RestResponse response = http.httpSendGet(url, headersMap);
+		if (response.getErrorCode() != 200 && response.getResponse().getBytes() == null
+				&& response.getResponse().getBytes().length == 0) {
+			return null;
+		}
+		return response;
+
+	}
+
+	private RestResponse sendAuthorizationRequest() throws IOException {
+		String url = String.format(Urls.POST_AUTHORIZATION, "localhost", "8080");
+		String userId = sdncAdminDetails.getUserId();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+
+		HttpRequest http = new HttpRequest();
+		RestResponse response = http.httpSendPost(url,
+				"{\"consumerName\":\"test\",\"consumerPassword\":\"0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b\",\"consumerSalt\":\"2a1f887d607d4515d4066fe0f5452a50\"}",
+				headersMap);
+		if (response.getErrorCode() != 201) {
+			return null;
+		}
+		return response;
+	}
+
+	private Service createServiceWithRIsWithArtifacts() throws Exception {
+		serviceDetails_02.setUniqueId(serviceDetails_01.getUniqueId());
+		createTreeCheckedinVFInstances();
+		LifecycleRestUtils.changeResourceState(resourceDetailsCP_01, sdncDesignerDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createVFInstanceAndAtomicResourceInstanceWithoutCheckin(resourceDetailsVF_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		RestResponse updateServiceResp = ServiceRestUtils.updateService(serviceDetails_02, sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(updateServiceResp);
+		getComponentAndValidateRIs(serviceDetails_01, 5, 0);
+
+		return ResponseParser.convertServiceResponseToJavaObject(updateServiceResp.getResponse());
+	}
+
+	private void createTreeCheckedinVFInstances() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createSecondVFInstResp);
+		RestResponse createThirdVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_03,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createThirdVFInstResp);
+	}
+
+	private Component getComponentAndValidateRIs(ComponentReqDetails componentDetails, int numberOfRIs,
+			int numberOfRelations) throws IOException, Exception {
+
+		RestResponse getResponse = null;
+		Component component = null;
+		if (componentDetails instanceof ResourceReqDetails) {
+			getResponse = ResourceRestUtils.getResource(sdncAdminDetails, componentDetails.getUniqueId());
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
+		} else if (componentDetails instanceof ServiceReqDetails) {
+			getResponse = ServiceRestUtils.getService((ServiceReqDetails) componentDetails, sdncAdminDetails);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
+		} else if (componentDetails instanceof ProductReqDetails) {
+			getResponse = ProductRestUtils.getProduct(componentDetails.getUniqueId(), sdncAdminDetails.getUserId());
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Product.class);
+		} else {
+			Assert.fail("Unsupported type of componentDetails - " + componentDetails.getClass().getSimpleName());
+		}
+		ResourceRestUtils.checkSuccess(getResponse);
+		int numberOfActualRIs = component.getComponentInstances() != null ? component.getComponentInstances().size()
+				: 0;
+		int numberOfActualRelations = component.getComponentInstancesRelations() != null
+				? component.getComponentInstancesRelations().size() : 0;
+		assertEquals("Check number of RIs meet the expected number", numberOfRIs, numberOfActualRIs);
+		assertEquals("Check number of RI relations meet the expected number", numberOfRelations,
+				numberOfActualRelations);
+
+		return component;
+	}
+
+	private void createVFInstanceAndAtomicResourceInstanceWithoutCheckin(ResourceReqDetails vf,
+			ResourceReqDetails atomicResource, User user) throws Exception {
+		RestResponse createVFInstance = createVFInstance(serviceDetails_01, vf, user);
+		ResourceRestUtils.checkCreateResponse(createVFInstance);
+		RestResponse atomicInstanceForService = createAtomicInstanceForService(serviceDetails_01, atomicResource, user);
+		ResourceRestUtils.checkCreateResponse(atomicInstanceForService);
+	}
+
+	private RestResponse createCheckedinVFInstance(ServiceReqDetails containerDetails,
+			ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		changeResourceLifecycleState(compInstOriginDetails, modifier.getUserId(), LifeCycleStatesEnum.CHECKIN);
+		return createVFInstance(containerDetails, compInstOriginDetails, modifier);
+	}
+
+	private RestResponse createVFInstance(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails,
+			User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
+				true);
+	}
+
+	private RestResponse createAtomicInstanceForService(ServiceReqDetails containerDetails,
+			ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
+				true);
+	}
+
+	private RestResponse createComponentInstance(ComponentReqDetails containerDetails,
+			ComponentReqDetails compInstOriginDetails, User modifier, ComponentTypeEnum containerComponentTypeEnum,
+			boolean isHighestLevel) throws IOException, Exception {
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(compInstOriginDetails);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, modifier, containerDetails.getUniqueId(), containerComponentTypeEnum);
+		return createResourceInstanceResponse;
+	}
+
+	private void changeResourceLifecycleState(ResourceReqDetails resourceDetails, String userUserId,
+			LifeCycleStatesEnum lifeCycleStates) throws Exception {
+		RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, userUserId, lifeCycleStates);
+		LifecycleRestUtils.checkLCS_Response(response);
+	}
+
+	private void createAtomicResource(ResourceReqDetails resourceDetails) throws Exception {
+		RestResponse createResourceResponse = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceResponse);
+
+	}
+
+	private void createVF(ResourceReqDetails resourceDetails) throws Exception {
+		createVF(resourceDetails, sdncDesignerDetails);
+
+	}
+
+	private void createVF(ResourceReqDetails resourceDetails, User sdncModifier) throws Exception {
+		RestResponse createVfResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifier);
+		ResourceRestUtils.checkCreateResponse(createVfResponse);
+	}
+
+	private void createService(ServiceReqDetails serviceDetails) throws Exception {
+		createService(serviceDetails, sdncDesignerDetails);
+	}
+
+	private void createService(ServiceReqDetails serviceDetails, User sdncModifier) throws Exception {
+		RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifier);
+		ResourceRestUtils.checkCreateResponse(createServiceResponse);
+	}
+
+	private void importVfWithArtifacts(ImportReqDetails resourceDetailsVF_01) throws Exception {
+		String payloadName = "VF_RI2_G4_withArtifacts.csar";
+		Path path = Paths.get(rootPath + "/src/main/resources/ci/VF_RI2_G4_withArtifacts.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetailsVF_01.setPayloadData(payloadData);
+
+		resourceDetailsVF_01.setPayloadName(payloadName);
+		resourceDetailsVF_01.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetailsVF_01, sdncDesignerDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java
new file mode 100644
index 0000000..c52ee47
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/BasicHttpAuthenticationTest.java
@@ -0,0 +1,442 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+//US505653
+package org.openecomp.sdc.ci.tests.execute.general;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedAuthenticationAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.util.ValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class BasicHttpAuthenticationTest extends ComponentBaseTest {
+
+	protected static final String AUTH_FAILED_INVALID_AUTHENTICATION_HEADER = "AUTH_FAILED_INVALID_AUTHENTICATION_HEADER";
+
+	protected static final String AUTH_SUCCESS = "AUTH_SUCCESS";
+
+	protected static final String AUTH_FAILED_INVALID_PASSWORD = "AUTH_FAILED_INVALID_PASSWORD";
+
+	protected static final String AUTH_FAILED_USER_NOT_FOUND = "AUTH_FAILED_USER_NOT_FOUND";
+
+	protected static final String AUTH_REQUIRED = "AUTH_REQUIRED";
+
+	protected static final String WWW_AUTHENTICATE = "WWW-Authenticate";
+
+	// user ci password 123456
+	// protected final String authorizationHeader = "Basic Y2k6MTIzNDU2";
+	// user ci password 123456
+	protected final String USER = "ci";
+
+	protected final String PASSWORD = "123456";
+
+	protected final String SALT = "2a1f887d607d4515d4066fe0f5452a50";
+
+	protected final String HASHED_PASSWORD = "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b";
+
+	protected User sdncAdminUserDetails;
+
+	protected ConsumerDataDefinition consumerDataDefinition;
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected User sdncUserDetails;
+
+	protected ArtifactReqDetails deploymentArtifact;
+
+	protected ExpectedAuthenticationAudit expectedAuthenticationAudit;
+
+	protected final String auditAction = "HttpAuthentication";
+
+	protected String expectedDownloadServiceUrl;
+	protected String expectedDownloadResourceUrl;
+	protected ComponentInstanceReqDetails componentInstanceReqDetails;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public BasicHttpAuthenticationTest() {
+		super(name, BasicHttpAuthenticationTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		Resource resourceObject = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetails = new ResourceReqDetails(resourceObject);
+		Service serviceObject = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		serviceDetails = new ServiceReqDetails(serviceObject);
+
+		deploymentArtifact = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(deploymentArtifact,
+				sdncUserDetails, resourceDetails.getUniqueId());
+		AssertJUnit.assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		componentInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
+		// certified resource
+		response = LifecycleRestUtils.certifyResource(resourceDetails);
+		AssertJUnit.assertTrue("certify resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		// add resource instance with HEAT deployment artifact to the service
+		componentInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails, sdncUserDetails,
+				serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		AssertJUnit.assertTrue("response code is not 201, returned: " + response.getErrorCode(),
+				response.getErrorCode() == 201);
+		expectedAuthenticationAudit = new ExpectedAuthenticationAudit();
+
+		// RestResponse addDeploymentArtifactResponse =
+		// ArtifactRestUtils.addInformationalArtifactToService(deploymentArtifact,
+		// sdncUserDetails, serviceDetails.getUniqueId());
+		// assertEquals("didn't succeed to upload deployment artifact", 200,
+		// addDeploymentArtifactResponse.getErrorCode().intValue());
+		//
+		// downloadUrl =
+		// String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
+		// ValidationUtils.convertToSystemName(serviceDetails.getServiceName()),
+		// serviceDetails.getVersion(),
+		// ValidationUtils.normalizeFileName(deploymentArtifact.getArtifactName()));
+
+		expectedDownloadResourceUrl = String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceDetails.getVersion(),
+				ValidationUtils.convertToSystemName(resourceDetails.getName()), resourceDetails.getVersion(),
+				ValidationUtils.normalizeFileName(deploymentArtifact.getArtifactName()));
+		expectedDownloadResourceUrl = expectedDownloadResourceUrl.substring("/sdc/".length(),
+				expectedDownloadResourceUrl.length());
+
+		expectedDownloadServiceUrl = String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
+				ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceDetails.getVersion(),
+				ValidationUtils.normalizeFileName(deploymentArtifact.getArtifactName()));
+		expectedDownloadServiceUrl = expectedDownloadServiceUrl.substring("/sdc/".length(),
+				expectedDownloadServiceUrl.length());
+
+		sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		consumerDataDefinition = createConsumer();
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+		;
+
+		RestResponse createResponse = ConsumerRestUtils.createConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		BaseRestUtils.checkCreateResponse(createResponse);
+
+	}
+
+	@AfterMethod
+	public void tearDown() throws Exception {
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+		;
+	}
+
+	@Test
+	public void sendAuthenticatedRequestTest_success() throws Exception, Exception {
+		DbUtils.cleanAllAudits();
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(USER, PASSWORD);
+		// RestResponse restResponse =
+		// ArtifactRestUtils.downloadServiceArtifact(serviceDetails,
+		// deploymentArtifact, sdncUserDetails, authorizationHeader);
+		RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resourceDetails,
+				deploymentArtifact, sdncUserDetails, authorizationHeader);
+		AssertJUnit.assertEquals("Check response code after download artifact", 200,
+				restResponse.getErrorCode().intValue());
+		AssertJUnit.assertFalse(restResponse.getHeaderFields().containsKey(HttpHeaderEnum.WWW_AUTHENTICATE.getValue()));
+
+		validateAuditAuthentication(USER, AUTH_SUCCESS, ComponentTypeEnum.RESOURCE);
+
+	}
+
+	protected void validateAuditAuthentication(String userName, String AuthStatus, ComponentTypeEnum compType)
+			throws Exception {
+		if (compType.equals(ComponentTypeEnum.RESOURCE)) {
+			expectedAuthenticationAudit = new ExpectedAuthenticationAudit(expectedDownloadResourceUrl, userName,
+					auditAction, AuthStatus);
+		} else {
+			expectedAuthenticationAudit = new ExpectedAuthenticationAudit(expectedDownloadServiceUrl, userName,
+					auditAction, AuthStatus);
+		}
+		AuditValidationUtils.validateAuthenticationAudit(expectedAuthenticationAudit);
+	}
+
+	protected ConsumerDataDefinition createConsumer() {
+		ConsumerDataDefinition consumer = new ConsumerDataDefinition();
+		consumer.setConsumerName(USER);
+		consumer.setConsumerSalt(SALT);
+		consumer.setConsumerPassword(HASHED_PASSWORD);
+		return consumer;
+
+	}
+
+	@Test
+	public void sendAuthenticatedRequestWithoutHeadersTest() throws Exception, Exception {
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, new HashMap<String, String>());
+		assertEquals("Check response code after download artifact", 401, restResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_REQUIRED.name(), new ArrayList<String>(),
+				restResponse.getResponse());
+		assertTrue(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
+		List<String> getAuthenticateHeader = restResponse.getHeaderFields().get(WWW_AUTHENTICATE);
+		assertEquals("www-authenticate header contains more then one value", 1, getAuthenticateHeader.size());
+		assertTrue(getAuthenticateHeader.get(0).equals("Basic realm=" + "\"ASDC\""));
+
+		validateAuditAuthentication("", AUTH_REQUIRED, ComponentTypeEnum.SERVICE);
+	}
+
+	@Test
+	public void sendAuthenticatedRequestTest_userIsNotProvsioned() throws Exception, Exception {
+		String userName = "shay";
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userName, "123456");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
+				restResponse.getResponse());
+		assertFalse(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
+
+		validateAuditAuthentication(userName, AUTH_FAILED_USER_NOT_FOUND, ComponentTypeEnum.SERVICE);
+	}
+
+	@Test
+	public void sendAuthenticatedRequestTest_userIsNull() throws Exception, Exception {
+		String userName = "";
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userName, "123456");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
+				restResponse.getResponse());
+		assertFalse(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
+
+		validateAuditAuthentication(userName, AUTH_FAILED_USER_NOT_FOUND, ComponentTypeEnum.SERVICE);
+	}
+
+	@Test
+	public void sendAuthenticatedRequestTest_passwordIsNull() throws Exception, Exception {
+		String userName = "ci";
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userName, "");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
+				restResponse.getResponse());
+		assertFalse(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
+
+		validateAuditAuthentication(userName, AUTH_FAILED_INVALID_PASSWORD, ComponentTypeEnum.SERVICE);
+	}
+
+	@Test
+	public void sendAuthenticatedRequestTest_passowrdIsNotValidated() throws Exception, Exception {
+		String userCi = "ci";
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userCi, "98765");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
+				restResponse.getResponse());
+		assertFalse(restResponse.getHeaderFields().containsKey(HttpHeaderEnum.WWW_AUTHENTICATE.getValue()));
+
+		validateAuditAuthentication(userCi, AUTH_FAILED_INVALID_PASSWORD, ComponentTypeEnum.SERVICE);
+	}
+
+	@Test
+	public void sendAuthenticatedRequestTest_InvalidHeader() throws Exception, Exception {
+		String userCredentials = USER + ":" + PASSWORD;
+		byte[] encodeBase64 = Base64.encodeBase64(userCredentials.getBytes());
+		String encodedUserCredentials = new String(encodeBase64);
+		Map<String, String> authorizationHeader = new HashMap<String, String>();
+		authorizationHeader.put(HttpHeaderEnum.AUTHORIZATION.getValue(), encodedUserCredentials);
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 400, restResponse.getErrorCode().intValue());
+		assertFalse(restResponse.getHeaderFields().containsKey(HttpHeaderEnum.WWW_AUTHENTICATE.getValue()));
+
+		validateAuditAuthentication("", AUTH_FAILED_INVALID_AUTHENTICATION_HEADER, ComponentTypeEnum.SERVICE);
+	}
+
+	@Test(enabled = false)
+	public void sendTwoAuthenticatedRequestsTest() throws Exception, Exception {
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(USER, PASSWORD);
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+
+		RestResponse secondRestResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after second download artifact", 200,
+				secondRestResponse.getErrorCode().intValue());
+	}
+
+	@Test(enabled = false)
+	public void sendAuthenticatedRequestTest_userValidation_1() throws Exception, Exception {
+
+		ConsumerDataDefinition consumer = new ConsumerDataDefinition();
+		consumer.setConsumerName("cI2468");
+		consumer.setConsumerPassword(HASHED_PASSWORD);
+		consumer.setConsumerSalt(SALT);
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+
+		RestResponse createResponse = ConsumerRestUtils.createConsumer(consumer, sdncAdminUserDetails);
+		BaseRestUtils.checkCreateResponse(createResponse);
+
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(consumer.getConsumerName(),
+				PASSWORD);
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+
+		deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+	}
+
+	// ECOMP Consumer Name - UTF-8 string up to 255 characters containing the
+	// following characters : ( maybe to limit 4-64 chars ? )
+	// Lowercase characters {a-z}
+	// Uppercase characters {A-Z}
+	// Numbers {0-9}
+	// Dash {-}; this character is not supported as the first character in the
+	// user name
+	// Period {.}; this character is not supported as the first character in the
+	// user name
+	// Underscore {_}
+	// @Ignore("add manually user:password 24-!68:123456 to
+	// users-configuration.yaml in runtime")
+	@Test(enabled = false)
+	public void sendAuthenticatedRequestTest_userValidation_2() throws Exception, Exception {
+		ConsumerDataDefinition consumer = new ConsumerDataDefinition();
+		consumer.setConsumerName("24-!68");
+		consumer.setConsumerPassword(HASHED_PASSWORD);
+		consumer.setConsumerSalt(SALT);
+		RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+
+		RestResponse createResponse = ConsumerRestUtils.createConsumer(consumer, sdncAdminUserDetails);
+		BaseRestUtils.checkCreateResponse(createResponse);
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(consumer.getConsumerName(),
+				PASSWORD);
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+
+		deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
+		BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
+	}
+
+	// this is invalide becouse we do not use the : any more
+	// @Ignore("can't exectue, yaml file does not allow to enter more then one
+	// colon continuously (\":\") ")
+	@Test(enabled = false)
+	public void sendAuthenticatedRequestTest_userValidation_3() throws Exception, Exception {
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("a:", "123456");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+	}
+
+	//
+	// * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
+	// SALT + "real" password ) => maximal length 256 bytes = 32 characters
+	// Before storing/comparing please convert upper case letter to lower.
+	// The "normalized" encrypted password should match the following format :
+	// [a-z0-9]
+	// @Ignore("add manually user:password 2468:123:456 to
+	// users-configuration.yaml in runtime")
+	@Test(enabled = false)
+	public void sendAuthenticatedRequestTest_passwordValidation_1() throws Exception, Exception {
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("A1", "123:456");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+	}
+
+	// * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
+	// SALT + "real" password ) => maximal length 256 bytes = 32 characters
+	// Before storing/comparing please convert upper case letter to lower.
+	// The "normalized" encrypted password should match the following format :
+	// [a-z0-9]
+	@Test(enabled = false)
+	// @Ignore("add manually user:password 2468:Sq123a456B to
+	// users-configuration.yaml in runtime")
+	public void sendAuthenticatedRequestTest_passwordValidation_2() throws Exception, Exception {
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("B2", "Sq123a456B");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+	}
+
+	// * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
+	// SALT + "real" password ) => maximal length 256 bytes = 32 characters
+	// Before storing/comparing please convert upper case letter to lower.
+	// The "normalized" encrypted password should match the following format :
+	// [a-z0-9]
+	@Test
+	// @Ignore("add C3:111T-0-*# to file")
+	public void sendAuthenticatedRequestTest_passwordValidation_3() throws Exception, Exception {
+		Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("C3", "111T-0-*#");
+		RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
+				sdncUserDetails, authorizationHeader);
+		assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java
new file mode 100644
index 0000000..e4f7d39
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.general;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+
+public class FeProxyTest extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public FeProxyTest() {
+		super(name, FeProxyTest.class.getName());
+	}
+
+	@Test
+	public void testFeProxy() throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		RestResponse allCategoriesTowardsFe = CategoryRestUtils.getAllCategoriesTowardsFe(defaultUser,
+				BaseRestUtils.RESOURCE_COMPONENT_TYPE);
+		AssertJUnit.assertEquals("Check response code after get categories towards FE", 200,
+				allCategoriesTowardsFe.getErrorCode().intValue());
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java
new file mode 100644
index 0000000..9ef8f14
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/ManageEcompConsumerCredentials.java
@@ -0,0 +1,1420 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.general;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.HashMap;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedEcomConsumerAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class ManageEcompConsumerCredentials extends ComponentBaseTest {
+
+	protected static final String ADD_ECOMP_USER_CREDENTIALS = "AddECOMPUserCredentials";
+	protected static final String DELETE_ECOMP_USER_CREDENTIALS = "DeleteECOMPUserCredentials";
+	protected static final String GET_ECOMP_USER_CREDENTIALS = "GetECOMPUserCredentials";
+
+	public static final String contentTypeHeaderData = "application/json";
+	public static final String acceptHeaderData = "application/json";
+
+	public static final int STATUS_CODE_SUCCESS = 200;
+	public static final int STATUS_CODE_SUCSESS_CREATED = 201;
+	public static final int STATUS_CODE_SUCCESS_DELETE_GET = 200;
+	public static final int STATUS_CODE_INVALID_CONTENT = 400;
+	public static final int STATUS_CODE_MISSING_DATA = 400;
+	public static final int STATUS_CODE_MISSING_INFORMATION = 403;
+	public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
+
+	public static final int STATUS_CODE_NOT_FOUND = 404;
+	public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
+
+	protected static Gson gson = new Gson();
+	protected ConsumerDataDefinition consumerDataDefinition;
+	protected User sdncAdminUserDetails;
+	protected User sdncDesignerUserDetails;
+	protected User sdncTesterUserDetails;
+	protected User sdncGovernorUserDetails;
+	protected User sdncOpsUserDetails;
+
+	public ManageEcompConsumerCredentials() {
+		super(name, ManageEcompConsumerCredentials.class.getName());
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	protected String salt = "123456789012345678901234567890ab";
+	protected String password = "123456789012345678901234567890ab123456789012345678901234567890ab";
+	protected String ecompUser = "benny";
+
+	protected Long consumerDetailsLastupdatedtime;
+
+	@BeforeMethod
+	public void init() throws Exception {
+		sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncDesignerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncTesterUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncGovernorUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+		sdncOpsUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+
+		consumerDataDefinition = new ConsumerDataDefinition();
+		consumerDataDefinition.setConsumerName(ecompUser);
+		consumerDataDefinition.setConsumerPassword(password);
+		consumerDataDefinition.setConsumerSalt(salt);
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+
+	}
+
+	// US563681 manage ECOMP consumer credentials - DELETE/GET
+	@Test
+	public void deleteEcompCredentialsMethodDelete() throws Exception {
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		AssertJUnit.assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		AssertJUnit.assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		// DbUtils.deleteFromEsDbByPattern("_all");
+		DbUtils.cleanAllAudits();
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		AssertJUnit.assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS_DELETE_GET,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCCESS_DELETE_GET);
+		// Get Consumer to verify that consumer user does not exist
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		AssertJUnit.assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	//// US561728 CREATE ECOMP consumer credentials
+	@Test
+	public void createEcompCredentialsMethodPost() throws Exception {
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		// Validate actual consumerData to returned from response
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+	}
+
+	@Test(enabled = false)
+	public void createEcompCredentialsUserAlreayExist() throws Exception {
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+
+		// Create consumer which already exists with different password and Salt
+		DbUtils.deleteFromEsDbByPattern("_all");
+		consumerDataDefinition.setConsumerPassword("zxcvb");
+		consumerDataDefinition.setConsumerSalt("1234567890qwertyuiop1234567890as");
+		createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer with new data
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsByDesigner() throws Exception { // HttpCspUserId
+																		// header
+																		// contains
+																		// Designer
+																		// UserId
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncDesignerUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncDesignerUserDetails, ActionStatus.RESTRICTED_OPERATION);
+	}
+
+	@Test
+	public void createEcompCredentialsByTester() throws Exception { // HttpCspUserId
+																	// header
+																	// contains
+																	// Tester
+																	// UserId
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncTesterUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncTesterUserDetails, ActionStatus.RESTRICTED_OPERATION);
+	}
+
+	@Test
+	public void createEcompCredentialsByOps() throws Exception { // HttpCspUserId
+																	// header
+																	// contains
+																	// OPS
+																	// UserId
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition, sdncOpsUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncOpsUserDetails, ActionStatus.RESTRICTED_OPERATION);
+	}
+
+	@Test
+	public void createEcompCredentialsByGovernor() throws Exception { // HttpCspUserId
+																		// header
+																		// contains
+																		// Governor
+																		// UserId
+																		// Create
+																		// Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncGovernorUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncGovernorUserDetails, ActionStatus.RESTRICTED_OPERATION);
+	}
+
+	@Test
+	public void createEcompCredentialsByNoExistingIUser() throws Exception {
+		User noSdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		noSdncUserDetails.setRole("blabla");
+		noSdncUserDetails.setUserId("bt750h");
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition, noSdncUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_ACCESS.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(
+				consumerDataDefinition.getConsumerName() + "," + consumerDataDefinition.getConsumerSalt().toLowerCase()
+						+ "," + consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
+		expectedEcomConsumerAuditJavaObject.setModifier("(" + noSdncUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	// user name
+	@Test
+	public void createEcompCredentialsUserNameIsNull() throws Exception {
+		consumerDataDefinition.setConsumerName(null); // SVC4528
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_DATA,
+				createConsumerRest.getErrorCode().intValue());
+		// verify taht consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerSalt().toLowerCase() + ","
+				+ consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer name"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameIsEmpty() throws Exception {
+		consumerDataDefinition.setConsumerName("");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerSalt().toLowerCase() + ","
+				+ consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer name"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameIsNotUTF8() throws Exception {
+		consumerDataDefinition.setConsumerName("בני"); // SVC4528
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameMaxLength() throws Exception {
+		consumerDataDefinition.setConsumerName(
+				"_ABCD-.abcdqwertyuiopasdfghjklzxcvbnmqw1234567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890pf34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfgghjklqwertyuiopzaiutrewasdfghjklqwertyuiopzasxcdferf123456.-"); // SVC4528
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Validate actual consumerData to returned from response
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameExceedMaxLength() throws Exception {
+		consumerDataDefinition.setConsumerName(
+				"_ABCD-.abcdqwertyuiopasdfghjklzxcvbnmqw1234567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890pf34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfgghjklqwertyuiopzaiutrewasdfghjklqwertyuiopzasxcdferf123456.--"); // SVC4528
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.EXCEEDS_LIMIT, "Consumer name", "255");
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameLastCharIsDash() throws Exception { // allowed
+		consumerDataDefinition.setConsumerName("ABCD34567890pf34567890poiutrew-");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject , Validate actual consumerData
+		// to returned from response
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameLastCharIsPeriod() throws Exception {
+		consumerDataDefinition.setConsumerName("ABCD34567890pf34567890poiutrew.");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject , Validate actual consumerData
+		// to returned from response
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameLastCharIsUnderscore() throws Exception {
+		consumerDataDefinition.setConsumerName("ABCD34567890pf34567890poiutrew_");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject , Validate actual consumerData
+		// to returned from response
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameFirstCharIsUnderscore() throws Exception {
+		consumerDataDefinition.setConsumerName("_ABCD34567890pf34567890poiutre");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject , Validate actual consumerData
+		// to returned from response
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameFirstCharIsPeriod() throws Exception {
+		consumerDataDefinition.setConsumerName(".ABCD34567890pf34567890poiutre");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.INVALID_CONTENT_PARAM, "Consumer name");
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameFirstCharIsDash() throws Exception { // Not
+																					// allowed
+		consumerDataDefinition.setConsumerName("-ABCD34567890pf34567890poiutre");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.INVALID_CONTENT_PARAM, "Consumer name");
+	}
+
+	/// Password
+	@Test
+	public void createEcompCredentialsPasswordIsNull() throws Exception {
+		consumerDataDefinition.setConsumerPassword(null);
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_DATA,
+				createConsumerRest.getErrorCode().intValue());
+		// verify taht consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerSalt().toLowerCase());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer password"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsPasswordIsEmpty() throws Exception {
+		consumerDataDefinition.setConsumerPassword("");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_DATA,
+				createConsumerRest.getErrorCode().intValue());
+		// verify taht consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerSalt().toLowerCase());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer password"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsPasswordMaxLength() throws Exception { // password
+																				// must
+																				// be
+																				// 64
+																				// chars
+		consumerDataDefinition.setConsumerPassword("123456789012345678901234567890ab123456789012345678901234567890ab");
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		// Validate actual consumerData to returned from response
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+		// Delete Consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsPasswordExceeedMaxLength() throws Exception { // password
+																					// must
+																					// be
+																					// 64
+																					// chars
+		consumerDataDefinition.setConsumerPassword("123456789012345678901234567890ab123456789012345678901234567890ab1");
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.INVALID_LENGTH, "Consumer password", "64");
+	}
+
+	@Test
+	public void createEcompCredentiaPasswordValid() throws Exception {
+		// Password Contains lowercase/uppercase characters and numbers -
+		// convert upper case letter to lower
+		consumerDataDefinition.setConsumerPassword("ABCabc1234567890POImnb12345678901234567890POIUzxcvbNMASDFGhjkl12");
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+
+	}
+
+	//// Salt
+	@Test
+	public void createEcompCredentialsSaltIsNull() throws Exception {
+		// Length must be 32 characters
+		consumerDataDefinition.setConsumerSalt(null);
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_DATA,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerPassword().toLowerCase());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer salt"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+
+	}
+
+	@Test
+	public void createEcompCredentialsSaltIsEmpty() throws Exception {
+		consumerDataDefinition.setConsumerSalt("");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_DATA,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerPassword().toLowerCase());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer salt"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsSaltLengthLessThan32() throws Exception {
+		consumerDataDefinition.setConsumerSalt("123456789012345678901234567890a");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.INVALID_LENGTH, "Consumer salt");
+
+	}
+
+	// Bug
+	@Test
+	public void createEcompCredentialsSaltLengthMoreThan32() throws Exception { // Length
+																				// must
+																				// be
+																				// 32
+																				// characters
+																				// -
+																				// SVC4529
+																				// "Error:
+																				// Invalid
+																				// Content.
+																				// %1
+																				// exceeds
+																				// limit
+																				// of
+																				// %2
+																				// characters."
+		consumerDataDefinition.setConsumerSalt("123456789012345678901234567890abc");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.INVALID_LENGTH, "Consumer salt");
+
+	}
+
+	@Test
+	public void createEcompCredentialsSaltUppercaseCharacters() throws Exception {
+		// Contains uppercase characters– exception invalid content
+		consumerDataDefinition.setConsumerSalt("123456789012345678901234567890AB");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+				createConsumerRest.getErrorCode().intValue());
+		// verify that consumer didn't created
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT_PARAM.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerSalt() + "," + consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer salt"));
+		expectedEcomConsumerAuditJavaObject
+				.setModifier(sdncAdminUserDetails.getFullName() + "(" + sdncAdminUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	// USER_ID (USER_ID is taken from USER_ID header)
+
+	@Test
+	public void createEcompCredentialsHttpCspUserIdIsEmpty() throws Exception {
+		// USER_ID is taken from USER_ID header
+		sdncAdminUserDetails.setUserId("");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerSalt() + "," + consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer salt"));
+		expectedEcomConsumerAuditJavaObject.setModifier("");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsHttpCspUserIdIsNull() throws Exception { // USER_ID
+																				// is
+																				// taken
+																				// from
+																				// USER_ID
+																				// header
+		sdncAdminUserDetails.setUserId(null);
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerSalt() + "," + consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer salt"));
+		expectedEcomConsumerAuditJavaObject.setModifier("");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void createEcompCredentialsHttpCspUserIdHeaderIsMissing() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumerHttpCspAtuUidIsMissing(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName() + ","
+				+ consumerDataDefinition.getConsumerSalt() + "," + consumerDataDefinition.getConsumerPassword());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc("Consumer salt"));
+		expectedEcomConsumerAuditJavaObject.setModifier("");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				ADD_ECOMP_USER_CREDENTIALS);
+	}
+
+	// add USER_ID in json body
+	@Test
+	public void createEcompCredentiaJsonBodyContainLastModfierAtuid() throws Exception {
+		// Add USER_ID (not admin) to json - we will ignore and create the user
+		HashMap<String, String> jsonMap = new HashMap<String, String>();
+		jsonMap.put("consumerName", "benny");
+		jsonMap.put("consumerPassword", "123456789012345678901234567890ab123456789012345678901234567890ab");
+		jsonMap.put("consumerSalt", "123456789012345678901234567890ab");
+		jsonMap.put("lastModfierAtuid", "cs0008"); // designer
+		Gson gson = new Gson();
+		ConsumerDataDefinition consumer = gson.fromJson(jsonMap.toString(), ConsumerDataDefinition.class);
+
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumer, sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Validate actual consumerData to returned from response
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumer, getConsumerDataObject);
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumer, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumer, sdncAdminUserDetails,
+				STATUS_CODE_SUCSESS_CREATED);
+		// Delete consumer
+		ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void createEcompCredentialsUserNameNotAllowedCharacters() throws Exception {
+		char invalidChars[] = { '`', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '=', '<', '>', '?', '/',
+				'"', ':', '}', ']', '[', '{', '|', '\\', ' ', '\t', '\n' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			consumerDataDefinition.setConsumerName(invalidChars[i] + "ABCdef123");
+			RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+					sdncAdminUserDetails);
+			assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+					createConsumerRest.getErrorCode().intValue());
+			// Audit validation
+			AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+					sdncAdminUserDetails, ActionStatus.INVALID_CONTENT_PARAM, "Consumer name");
+		}
+	}
+
+	@Test
+	public void createEcompCredentialsPasswordIsInvalid() throws Exception {
+		char invalidChars[] = { '`', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '=', '<', '>', '?', '/',
+				'"', ':', '}', ']', '[', '{', '|', '\\', ' ', '\t', '\n' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			consumerDataDefinition.setConsumerPassword(
+					"ABC" + invalidChars[i] + "ABCabc1234567890POImnb12345678901234567890POIUzxcvbNMASDFGhj");
+			RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+					sdncAdminUserDetails);
+			assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+					createConsumerRest.getErrorCode().intValue());
+			// Audit validation
+			AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+					sdncAdminUserDetails, ActionStatus.INVALID_CONTENT_PARAM, "Consumer password");
+		}
+	}
+
+	@Test
+	public void createEcompCredentialsSaltNotAllowedCharacters() throws Exception { // Salt
+																					// must
+																					// be
+																					// 32
+																					// chars
+		char invalidChars[] = { '`', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '=', '<', '>', '?', '/',
+				'"', ':', '}', ']', '[', '{', '|', '\\', ' ', '\t', '\n' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			consumerDataDefinition.setConsumerSalt(invalidChars[i] + "1234567890123456789012345678901");
+			RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+					sdncAdminUserDetails);
+			assertEquals("Check response code after create Consumer", STATUS_CODE_INVALID_CONTENT,
+					createConsumerRest.getErrorCode().intValue());
+			// Audit validation
+			AuditValidationUtils.createEcompConsumerAuditFailure(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+					sdncAdminUserDetails, ActionStatus.INVALID_CONTENT_PARAM, "Consumer salt");
+		}
+	}
+
+	@Test
+	public void createEcompCredentialsPasswordEncoded() throws Exception {
+		consumerDataDefinition.setConsumerPassword("0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		// Validate actual consumerData to returned from response
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(ADD_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCSESS_CREATED);
+	}
+
+	//
+
+	@Test
+	public void deleteEcompUserAlreayDeleted() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete ECOMP consumer
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS_DELETE_GET,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Try to delete ECOMP consumer already deleted
+		DbUtils.deleteFromEsDbByPattern("_all");
+		deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+	}
+
+	@Test
+	public void deleteEcompUserByTester() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncTesterUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncTesterUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Verify that consumer is not deleted
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void deleteEcompUserByOps() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncOpsUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncOpsUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Verify that consumer is not deleted
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void deleteEcompUserByGovernor() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncGovernorUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncGovernorUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Verify that consumer is not deleted
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void deleteEcompUserByDesigner() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncDesignerUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncDesignerUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Verify that consumer is not deleted
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void deleteEcompUserByNoExistingIUser() throws Exception {
+		User noSdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		noSdncUserDetails.setRole("blabla");
+		noSdncUserDetails.setUserId("bt750h");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, noSdncUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_ACCESS,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_ACCESS.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(ADD_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
+		expectedEcomConsumerAuditJavaObject.setModifier("(" + noSdncUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				DELETE_ECOMP_USER_CREDENTIALS);
+		// Verify that consumer is not deleted
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void deleteEcompCredentialsUserDoesNotExist() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+
+	}
+
+	@Test
+	public void deleteEcompCredentialsUserNameIsNull() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		consumerDataDefinition.setConsumerName(null);
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+	}
+
+	@Test
+	public void deleteEcompCredentialsUserNameMaxLength() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		consumerDataDefinition.setConsumerName(
+				"_BCD-.abcdqwertyuiopasdfghjklzxcvbnmqw1234567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890pf34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfgghjklqwertyuiopzaiutrewasdfghjklqwertyuiopzasxcdferf123456.--"); // SVC4528
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+	}
+
+	@Test
+	public void deleteEcompCredentialsUserNameExceedMaxLength() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		consumerDataDefinition.setConsumerName(
+				"_XXXBCD-.abcdqwertyuiopasdfghjklzxcvbnmqw1234567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890pf34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfgghjklqwertyuiopzaiutrewasdfghjklqwertyuiopzasxcdferf123456.--"); // SVC4528
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+	}
+
+	@Test
+	public void deleteEcompCredentialsHttpCspUserIdHeaderIsMissing() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse createConsumerRest = ConsumerRestUtils.deleteConsumerHttpCspAtuUidIsMissing(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
+				createConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(DELETE_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc());
+		expectedEcomConsumerAuditJavaObject.setModifier("");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				DELETE_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void deleteEcompCredentialsNameIsUpperCase() throws Exception {
+		consumerDataDefinition.setConsumerName("benny");
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		consumerDataDefinition.setConsumerName("BENNY");
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				deleteConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(DELETE_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+		// Get Consumer to verify that consumer user was not deleted
+		consumerDataDefinition.setConsumerName("benny");
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+	}
+
+	@Test
+	public void getEcompCredentialsMethodGet() throws Exception {
+		// Create Consumer
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		// Validate actual consumerData to returned from response
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCCESS_DELETE_GET);
+		// Delete consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void getEcompUserAlreayDeleted() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Delete ECOMP consumer
+		RestResponse deleteConsumerRest = ConsumerRestUtils.deleteConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS_DELETE_GET,
+				deleteConsumerRest.getErrorCode().intValue());
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// Try to get ECOMP consumer already deleted
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+	}
+
+	@Test
+	public void getEcompUserByTester() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer by Tester user
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncTesterUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncTesterUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Get Consumer by Admin
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void getEcompUserByOps() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer by Ops user
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncOpsUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncOpsUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Get Consumer by Admin
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void getEcompUserByGovernor() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer by Ops user
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncGovernorUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncGovernorUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Get Consumer by Admin
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void getEcompUserByDesigner() throws Exception {
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// Get Consumer by Designer user
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncDesignerUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_OPERATION,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncDesignerUserDetails, ActionStatus.RESTRICTED_OPERATION);
+		// Get Consumer by Admin
+		getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+
+	@Test
+	public void getEcompUserByNoExistingIUser() throws Exception {
+		User noSdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		noSdncUserDetails.setRole("blabla");
+		noSdncUserDetails.setUserId("bt750h");
+		// Get Consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, noSdncUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_RESTRICTED_ACCESS,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_ACCESS.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(GET_ECOMP_USER_CREDENTIALS);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
+		expectedEcomConsumerAuditJavaObject.setModifier("(" + noSdncUserDetails.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject,
+				GET_ECOMP_USER_CREDENTIALS);
+	}
+
+	@Test
+	public void getEcompCredentialsUserDoesNotExist() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+
+	}
+
+	@Test
+	public void getEcompCredentialsUserNameIsNull() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		consumerDataDefinition.setConsumerName(null);
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_NOT_FOUND,
+				getConsumerRest.getErrorCode().intValue());
+		// Audit validation
+		AuditValidationUtils.deleteEcompConsumerAuditFailure(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, ActionStatus.ECOMP_USER_NOT_FOUND, consumerDataDefinition.getConsumerName());
+	}
+
+	@Test
+	public void getEcompCredentialsUserNameMaxLength() throws Exception {
+		consumerDataDefinition.setConsumerName(
+				"_ABCD-.abcdqwertyuiopasdfghjklzxcvbnmqw1234567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfg34567890pf34567890poiutrewasdfghjklqwertyuiopzaiutrewasdfgghjklqwertyuiopzaiutrewasdfghjklqwertyuiopzasxcdferf123456.-"); // SVC4528
+		RestResponse createConsumerRest = ConsumerRestUtils.createConsumer(consumerDataDefinition,
+				sdncAdminUserDetails);
+		assertEquals("Check response code after create Consumer", STATUS_CODE_SUCSESS_CREATED,
+				createConsumerRest.getErrorCode().intValue());
+		// parse updated response to javaObject
+		ConsumerDataDefinition getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(createConsumerRest);
+		// Validate actual consumerData to returned from response
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Get Consumer
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse getConsumerRest = ConsumerRestUtils.getConsumer(consumerDataDefinition, sdncAdminUserDetails);
+		assertEquals("Check response code after get Consumer", STATUS_CODE_SUCCESS,
+				getConsumerRest.getErrorCode().intValue());
+		getConsumerDataObject = ConsumerRestUtils.parseComsumerResp(getConsumerRest);
+		ConsumerRestUtils.validateConsumerReqVsResp(consumerDataDefinition, getConsumerDataObject);
+		// Audit validation
+		AuditValidationUtils.ecompConsumerAuditSuccess(GET_ECOMP_USER_CREDENTIALS, consumerDataDefinition,
+				sdncAdminUserDetails, STATUS_CODE_SUCCESS_DELETE_GET);
+		// Delete consumer
+		ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java
new file mode 100644
index 0000000..acb7e15
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.general;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.UUID;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+
+public class UuidTest extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public UuidTest() {
+		super(name, UuidTest.class.getName());
+		config = Config.instance();
+	}
+
+	@Test
+	public void testE2EUuidHeaderReturnedAndPreserved() throws IOException {
+		UUID randomUUID = UUID.randomUUID();
+		String uuidStr = randomUUID.toString();
+		RestResponse allTagsTowardsCatalogFe = CatalogRestUtils.getAllCategoriesTowardsCatalogFeWithUuid(uuidStr);
+		AssertJUnit.assertEquals(allTagsTowardsCatalogFe.getErrorCode(), new Integer(200));
+		List<String> list = allTagsTowardsCatalogFe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
+		// check that header is returned
+		AssertJUnit.assertTrue(list != null && !list.isEmpty());
+		String receivedUuid = list.get(0);
+		// Check that same uuid returned
+		AssertJUnit.assertEquals(uuidStr, receivedUuid);
+	}
+
+	@Test
+	public void testUuidHeaderGeneratedBe() throws IOException {
+		RestResponse allTagsTowardsCatalogBe = CatalogRestUtils.getAllCategoriesTowardsCatalogBe();
+		List<String> list = allTagsTowardsCatalogBe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
+		// check that response was OK
+		assertEquals(allTagsTowardsCatalogBe.getErrorCode(), new Integer(200));
+		// check that header is returned
+		assertTrue(list != null && !list.isEmpty());
+		String uuid = list.get(0);
+		// Check there is no conversion error
+		UUID.fromString(uuid);
+	}
+
+	@Test
+	public void testE2EOptionsNoUuid() throws IOException {
+		RestResponse allTagsTowardsCatalogFe = ResourceRestUtils.sendOptionsTowardsCatalogFeWithUuid();
+		assertEquals(allTagsTowardsCatalogFe.getErrorCode(), new Integer(200));
+		List<String> list = allTagsTowardsCatalogFe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
+		// check that header is returned (generated by BE)
+		assertTrue(list != null && !list.isEmpty());
+		String receivedUuid = list.get(0);
+		// Check there is no conversion error
+		UUID.fromString(receivedUuid);
+	}
+
+	@Test
+	public void testE2EMethodNotAllowedWithUuid() throws IOException {
+		UUID randomUUID = UUID.randomUUID();
+		String uuidStr = randomUUID.toString();
+		RestResponse allTagsTowardsCatalogFe = ResourceRestUtils
+				.putAllCategoriesTowardsCatalogFeWithUuidNotAllowed(uuidStr);
+		assertEquals(allTagsTowardsCatalogFe.getErrorCode(), new Integer(405));
+		List<String> list = allTagsTowardsCatalogFe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
+		// check that header is returned (generated by BE)
+		assertTrue(list != null && !list.isEmpty());
+		String receivedUuid = list.get(0);
+		// Check that same uuid returned
+		assertEquals(uuidStr, receivedUuid);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java
new file mode 100644
index 0000000..650ed61
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java
@@ -0,0 +1,460 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.FileUtils;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.common.util.YamlToObjectConverter;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+public class CsarUtilsTest extends ComponentBaseTest {
+	
+	public static final String ASSET_TOSCA_TEMPLATE = "assettoscatemplate";
+	
+	@Rule
+	public static TestName name = new TestName();
+	
+	public CsarUtilsTest() {
+		super(name, CsarUtilsTest.class.getName());
+	}
+	
+	@Test(enabled = true)
+	public void createServiceCsarBasicTest() throws Exception {
+		
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER,
+				true, true);
+		resourceVF = (Resource) AtomicOperationUtils
+				.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+		
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		
+		byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, service);
+		
+		csarBasicValidation(service, downloadCSAR);
+	}
+	
+	@Test(enabled = true)
+	public void createResourceCsarBasicTest() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		resourceVF = (Resource) AtomicOperationUtils
+				.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		
+		byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, resourceVF);
+		
+		csarBasicValidation(resourceVF, downloadCSAR);
+	}
+	
+	@Test(enabled = true)
+	public void createServiceCsarInclDeploymentArtTest() throws Exception {
+		
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+
+		Resource resourceVF1 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		
+		resourceVF1 = (Resource) AtomicOperationUtils
+				.changeComponentState(resourceVF1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		
+		resourceVF2 = (Resource) AtomicOperationUtils
+				.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF1, service, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
+		
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, service, UserRoleEnum.DESIGNER, true, true);
+		
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		
+		byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, service);
+		
+		csarBasicValidation(service, downloadCSAR);
+		
+		validateServiceCsar(resourceVF1, resourceVF2, service, downloadCSAR, 3, 5, 1);
+	}
+	
+	@Test(enabled = true)
+	public void createResourceCsarInclDeploymentArtTest() throws Exception {
+
+		Resource resourceVF1 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, resourceVF1, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_ARTIFACT, resourceVF1, UserRoleEnum.DESIGNER, true, true);
+		
+		resourceVF1 = (Resource) AtomicOperationUtils
+				.changeComponentState(resourceVF1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		
+		byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, resourceVF1);
+		
+		csarBasicValidation(resourceVF1, downloadCSAR);
+		
+		validateVFCsar(resourceVF1, downloadCSAR, 1, 0, 1, 1);
+	}
+	
+	private void csarBasicValidation(Component mainComponent, byte[] downloadCSAR) {
+		try (ByteArrayInputStream ins = new ByteArrayInputStream(downloadCSAR);
+				ZipInputStream zip = new ZipInputStream(ins);) {
+
+			String resourceYaml = null;
+			byte[] buffer = new byte[1024];
+			ZipEntry nextEntry = zip.getNextEntry();
+			StringBuffer sb = new StringBuffer();
+			int len;
+
+			while ((len = zip.read(buffer)) > 0) {
+				sb.append(new String(buffer, 0, len));
+			}
+
+			assertTrue(nextEntry.getName().equals("TOSCA-Metadata/TOSCA.meta"));
+
+			sb.setLength(0);
+			nextEntry = zip.getNextEntry();
+
+			while ((len = zip.read(buffer)) > 0) {
+				sb.append(new String(buffer, 0, len));
+			}
+
+			resourceYaml = sb.toString();
+
+			YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter();
+			ArtifactDefinition artifactDefinition = mainComponent.getToscaArtifacts()
+					.get(ASSET_TOSCA_TEMPLATE);
+			String fileName = artifactDefinition.getArtifactName();
+			assertEquals("Tosca-Template file name: ", "Definitions/" + fileName, nextEntry.getName());
+			assertTrue("Tosca template Yaml validation: ", yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
+
+			ins.close();
+			zip.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	private void validateServiceCsar(Component certifiedVFC1, Component certifiedVFC2, Service fetchedService,
+			byte[] resultByte, int toscaEntryIndexToPass, int generatorEntryIndexToPass,
+			int deploymentArtifactIndexToPass) {
+		
+		// TODO Test to validate everything is right (comment out after testing)
+		/*try {
+			FileUtils.writeByteArrayToFile(new File("c:/TestCSAR/" + fetchedService.getName() + ".zip"), resultByte);
+		} catch (IOException e) {
+			// Auto-generated catch block
+			e.printStackTrace();
+		}*/
+
+		try (ByteArrayInputStream ins = new ByteArrayInputStream(resultByte);
+				ZipInputStream zip = new ZipInputStream(ins);) {
+			
+			String resourceYaml = null;
+			byte[] buffer = new byte[1024];
+			ZipEntry nextEntry = zip.getNextEntry();
+			StringBuffer sb = new StringBuffer();
+			int len;
+
+			while ((len = zip.read(buffer)) > 0) {
+				sb.append(new String(buffer, 0, len));
+			}
+
+			assertTrue(nextEntry.getName().equals("TOSCA-Metadata/TOSCA.meta"));
+
+			YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter();
+
+			int toscaEntryIndex = 0;
+			int generatorEntryIndex = 0;
+			int deploymentArtifactIndex = 0;
+			String fileName = null;
+			ArtifactDefinition artifactDefinition;
+			Component componentToValidate = null;
+
+			artifactDefinition = fetchedService.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
+			String serviceFileName = artifactDefinition.getArtifactName();
+			artifactDefinition = certifiedVFC1.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
+			String vfc1FileName = artifactDefinition.getArtifactName();
+			artifactDefinition = certifiedVFC2.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
+			String vfc2FileName = artifactDefinition.getArtifactName();
+
+			while ((nextEntry = zip.getNextEntry()) != null) {
+				sb.setLength(0);
+
+				while ((len = zip.read(buffer)) > 0) {
+					sb.append(new String(buffer, 0, len));
+				}
+
+				String entryName = nextEntry.getName();
+
+				resourceYaml = sb.toString();
+				if (entryName.contains(serviceFileName)) {
+					componentToValidate = fetchedService;
+					fileName = "Definitions/" + serviceFileName;
+					
+					assertEquals("Validate entry Name", (fileName), nextEntry.getName());
+					assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
+					validateContent(resourceYaml, componentToValidate);
+					++toscaEntryIndex;
+					continue;
+				}
+				
+				if (entryName.contains(vfc1FileName)) {
+					componentToValidate = certifiedVFC1;
+					fileName = "Definitions/" + vfc1FileName;
+					
+					assertEquals("Validate entry Name", (fileName), nextEntry.getName());
+					assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
+					validateContent(resourceYaml, componentToValidate);
+					++toscaEntryIndex;
+					continue;
+				}
+				if (entryName.contains(vfc2FileName)) {
+					componentToValidate = certifiedVFC2;
+					fileName = "Definitions/" + vfc2FileName;
+					
+					assertEquals("Validate entry Name", (fileName), nextEntry.getName());
+					assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
+					validateContent(resourceYaml, componentToValidate);
+					++toscaEntryIndex;
+					continue;
+				}
+
+				if (entryName.contains(".xml") && !entryName.startsWith("Artifacts/AAI")) {
+					++deploymentArtifactIndex;
+					continue;
+				}
+
+				if (entryName.startsWith("Artifacts/AAI")) {
+					++generatorEntryIndex;
+					continue;
+				}
+				
+				assertTrue("Unexpected entry: " + entryName, true);
+			}
+			assertEquals("Validate amount of entries", toscaEntryIndexToPass, toscaEntryIndex);
+			assertEquals("Validate amount of generated AAI artifacts", generatorEntryIndexToPass, generatorEntryIndex);
+			assertEquals("Validate amount of generated Deployment artifacts", deploymentArtifactIndexToPass,
+					deploymentArtifactIndex);
+
+			ins.close();
+			zip.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	private void validateVFCsar(Component certifiedVF, byte[] resultByte, int toscaEntryIndexToPass, int ymlDeploymentArtifactIndexToPass,
+			int xmlDeploymentArtifactIndexToPass, int heatEnvDeploymentArtifactIndexToPass) {
+		
+		// TODO Test to validate everything is right (comment out after testing)
+		/*try {
+			FileUtils.writeByteArrayToFile(new File("c:/TestCSAR/" + fetchedService.getName() + ".zip"), resultByte);
+		} catch (IOException e) {
+			// Auto-generated catch block
+			e.printStackTrace();
+		}*/
+
+		try (ByteArrayInputStream ins = new ByteArrayInputStream(resultByte);
+				ZipInputStream zip = new ZipInputStream(ins);) {
+			
+			String resourceYaml = null;
+			byte[] buffer = new byte[1024];
+			ZipEntry nextEntry = zip.getNextEntry();
+			StringBuffer sb = new StringBuffer();
+			int len;
+
+			while ((len = zip.read(buffer)) > 0) {
+				sb.append(new String(buffer, 0, len));
+			}
+
+			assertTrue(nextEntry.getName().equals("TOSCA-Metadata/TOSCA.meta"));
+
+			YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter();
+
+			int toscaEntryIndex = 0;
+			int ymlEntryIndex = 0;
+			int xmlArtifactsIndex = 0;
+			int heatEnvDeploymentArtifactIndex = 0;
+			String fileName = null;
+			ArtifactDefinition artifactDefinition;
+			Component componentToValidate = null;
+
+			artifactDefinition = certifiedVF.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
+			String vfFileName = artifactDefinition.getArtifactName();
+
+			while ((nextEntry = zip.getNextEntry()) != null) {
+				sb.setLength(0);
+
+				while ((len = zip.read(buffer)) > 0) {
+					sb.append(new String(buffer, 0, len));
+				}
+
+				String entryName = nextEntry.getName();
+
+				resourceYaml = sb.toString();
+				if (entryName.contains(vfFileName)) {
+					componentToValidate = certifiedVF;
+					fileName = "Definitions/" + vfFileName;
+					
+					assertEquals("Validate entry Name", (fileName), nextEntry.getName());
+					assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
+					validateContent(resourceYaml, componentToValidate);
+					++toscaEntryIndex;
+					continue;
+				}
+
+				if (entryName.contains(".xml") && entryName.startsWith("Artifacts/")) {
+					++xmlArtifactsIndex;
+					continue;
+				}
+
+				if (entryName.contains(".sh") && entryName.startsWith("Artifacts/")) {
+					++heatEnvDeploymentArtifactIndex;
+					continue;
+				}
+				
+				if (entryName.contains(".yml") && entryName.startsWith("Artifacts/")) {
+					++ymlEntryIndex;
+					continue;
+				}
+				
+				assertTrue("Unexpected entry: " + entryName, false);
+			}
+			assertEquals("Validate amount of entries", toscaEntryIndexToPass, toscaEntryIndex);
+			assertEquals("Validate amount of YAML artifacts", ymlDeploymentArtifactIndexToPass, ymlEntryIndex);
+			assertEquals("Validate amount of generated XML artifacts", xmlDeploymentArtifactIndexToPass,
+					xmlArtifactsIndex);
+			assertEquals("Validate amount of generated HEAT ENV artifacts", heatEnvDeploymentArtifactIndexToPass,
+					heatEnvDeploymentArtifactIndex);
+
+			ins.close();
+			zip.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	private void validateContent(String content, Component component) {
+		Yaml yaml = new Yaml();
+
+		InputStream inputStream = new ByteArrayInputStream(content.getBytes());
+		@SuppressWarnings("unchecked")
+		Map<String, Object> load = (Map<String, Object>) yaml.load(inputStream);
+		@SuppressWarnings("unchecked")
+		Map<String, Object> metadata = (Map<String, Object>) load.get("metadata");
+		assertNotNull(metadata);
+
+		String name = (String) metadata.get("name");
+		assertNotNull(name);
+		assertEquals("Validate component name", component.getName(), name);
+
+		String invariantUUID = (String) metadata.get("invariantUUID");
+		assertNotNull(invariantUUID);
+		assertEquals("Validate component invariantUUID", component.getInvariantUUID(), invariantUUID);
+
+		String UUID = (String) metadata.get("UUID");
+		assertNotNull(UUID);
+		assertEquals("Validate component invariantUUID", component.getUUID(), UUID);
+
+		String type = (String) metadata.get("type");
+		assertNotNull(type);
+		if (component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
+			assertEquals("Validate component type", component.getComponentType().getValue(), type);
+		} else {
+			assertEquals("Validate component type", ((Resource) component).getResourceType(),
+					ResourceTypeEnum.valueOf(type));
+		}
+	}
+	
+	private byte[] downloadCSAR(User sdncModifierDetails, Component createdComponent) throws Exception {
+
+		String artifactUniqeId = createdComponent.getToscaArtifacts().get("assettoscacsar").getUniqueId();
+		RestResponse getCsarResponse = null;
+		
+		switch (createdComponent.getComponentType()) {
+		case RESOURCE:
+			getCsarResponse = ArtifactRestUtils.downloadResourceArtifactInternalApi(createdComponent.getUniqueId(),
+					sdncModifierDetails, artifactUniqeId);
+			break;			
+		case SERVICE:
+			getCsarResponse = ArtifactRestUtils.downloadServiceArtifactInternalApi(createdComponent.getUniqueId(),
+					sdncModifierDetails, artifactUniqeId);
+			break;
+		default:
+			break;
+		}
+		
+		assertNotNull(getCsarResponse);
+		BaseRestUtils.checkSuccess(getCsarResponse);
+
+		ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(getCsarResponse.getResponse(),
+				ArtifactUiDownloadData.class);
+
+		assertNotNull(artifactUiDownloadData);
+
+		byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
+		byte[] decodeBase64 = Base64.decodeBase64(fromUiDownload);
+
+		return decodeBase64;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java
new file mode 100644
index 0000000..163504f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java
@@ -0,0 +1,458 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstInputsMap;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceInput;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.InputsRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonParser;
+import com.google.gson.reflect.TypeToken;
+
+public class ExportToscaTest extends ComponentBaseTest {
+	@Rule
+	public static TestName name = new TestName();
+
+	public ExportToscaTest() {
+		super(name, ExportToscaTest.class.getName());
+	}
+
+	@Test(enabled = true)
+	public void exportVfModuleTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		Resource createdResource = createVfFromCSAR(sdncModifierDetails, "VSPPackage");
+
+		Map<String, Object> load = downloadAndParseToscaTemplate(sdncModifierDetails, createdResource);
+		assertNotNull(load);
+		Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
+		assertNotNull(topology_template);
+		Map<String, Object> groups = (Map<String, Object>) topology_template.get("groups");
+		assertNotNull(groups);
+		List<GroupDefinition> groupsOrigin = createdResource.getGroups();
+
+		assertEquals("Validate groups size", groupsOrigin.size(), groups.size());
+		for (GroupDefinition group : groupsOrigin) {
+			Map<String, Object> groupTosca = (Map<String, Object>) groups.get(group.getName());
+			assertNotNull(groupTosca);
+
+			Map<String, Object> metadata = (Map<String, Object>) groupTosca.get("metadata");
+			assertNotNull(metadata);
+
+			String invariantUUID;
+			String name;
+			String UUID;
+			String version;
+			Map<String, Object> properties = (Map<String, Object>) groupTosca.get("properties");
+
+			if (group.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)) {
+				invariantUUID = (String) metadata.get("vfModuleModelInvariantUUID");
+				name = (String) metadata.get("vfModuleModelName");
+				UUID = (String) metadata.get("vfModuleModelUUID");
+				version = (String) metadata.get("vfModuleModelVersion");
+				assertNotNull(properties);
+
+				String vf_module_type = (String) properties.get("vf_module_type");
+				List<PropertyDataDefinition> props = group.getProperties();
+				for (PropertyDataDefinition prop : props) {
+					if (prop.getName().equals(Constants.IS_BASE)) {
+						String value = prop.getValue() == null ? prop.getDefaultValue() : prop.getValue();
+						boolean bvalue = Boolean.parseBoolean(value);
+						if (bvalue) {
+							assertEquals("Validate vf_module_type", "Base", vf_module_type);
+						} else {
+							assertEquals("Validate vf_module_type", "Expansion", vf_module_type);
+						}
+						break;
+					}
+				}
+				String vf_module_description = (String) properties.get("vf_module_description");
+				assertEquals("Validate vf_module_description", group.getDescription(), vf_module_description);
+
+				Boolean volume_group = (Boolean) properties.get("volume_group");
+				boolean isVolume = false;
+				List<String> artifactsList = group.getArtifacts();
+				List<ArtifactDefinition> artifacts = new ArrayList<>();
+				if (artifactsList != null && !artifactsList.isEmpty()) {
+					ArtifactDefinition masterArtifact = findMasterArtifact(createdResource.getDeploymentArtifacts(),
+							artifacts, artifactsList);
+					if (masterArtifact.getArtifactType().equalsIgnoreCase(ArtifactTypeEnum.HEAT_VOL.getType())) {
+						isVolume = true;
+					}
+				}
+				assertEquals("Validate volume_group", isVolume, volume_group);
+
+			} else {
+				invariantUUID = (String) metadata.get("invariantUUID");
+				name = (String) metadata.get("name");
+				UUID = (String) metadata.get("UUID");
+				version = (String) metadata.get("version");
+				assertNull(properties);
+
+			}
+			assertEquals("Validate InvariantUUID", group.getInvariantUUID(), invariantUUID);
+			assertEquals("Validate name", group.getName(), name);
+			assertEquals("Validate UUID", group.getGroupUUID(), UUID);
+			assertEquals("Validate version", group.getVersion(), version);
+
+		}
+	}
+
+	@Test(enabled = true)
+	public void exportCsarInputsTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csar_1");
+		Map<String, Object> load = downloadAndParseToscaTemplate(sdncModifierDetails, createdResource);
+		assertNotNull(load);
+
+		Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
+		assertNotNull(topology_template);
+
+		Map<String, Object> inputs = (Map<String, Object>) topology_template.get("inputs");
+		assertNotNull(inputs);
+
+		List<InputDefinition> inputsFromResource = createdResource.getInputs();
+		assertEquals("validate inputs size", inputsFromResource.size(), inputs.size());
+		for (InputDefinition inputDef : inputsFromResource) {
+			Map<String, Object> inputInFile = (Map<String, Object>) inputs.get(inputDef.getName());
+			assertNotNull(inputInFile);
+			validateInput(inputDef, inputInFile);
+		}
+		List<ComponentInstance> componentInstances = createdResource.getComponentInstances();
+		Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = createdResource
+				.getComponentInstancesProperties();
+		Map<String, Object> node_templates = (Map<String, Object>) topology_template.get("node_templates");
+		assertNotNull(node_templates);
+
+		JsonParser jsonParser = new JsonParser();
+
+		for (Map.Entry<String, List<ComponentInstanceProperty>> entry : componentInstancesProperties.entrySet()) {
+
+			Optional<ComponentInstance> findFirst = componentInstances.stream()
+					.filter(ci -> ci.getUniqueId().equals(entry.getKey())).findFirst();
+			assertTrue(findFirst.isPresent());
+			String resourceName = findFirst.get().getName();
+			Map<String, Object> instance = (Map<String, Object>) node_templates.get(resourceName);
+			assertNotNull(instance);
+			Map<String, Object> properties = (Map<String, Object>) instance.get("properties");
+
+			for (ComponentInstanceProperty cip : entry.getValue()) {
+				if (cip.getValueUniqueUid() != null && !cip.getValueUniqueUid().isEmpty()) {
+					assertNotNull(properties);
+					if (cip.getValue().contains("get_input")) {
+						Object prop = properties.get(cip.getName());
+						assertNotNull(prop);
+
+						Gson gson = new Gson();
+						String json = gson.toJson(prop);
+						assertEquals("validate json property", cip.getValue(), json);
+					}
+
+				}
+			}
+
+		}
+
+	}
+
+	@Test
+	public void importExportCsarWithJsonPropertyType() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "jsonPropertyTypeTest.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		String rootPath = System.getProperty("user.dir");
+		Path path = null;
+		byte[] data = null;
+		String payloadData = null;
+		path = Paths.get(rootPath + "/src/test/resources/CI/csars/jsonPropertyTypeTest.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setCsarUUID(payloadName);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		ComponentInstance pmaaServer = resource.getComponentInstances().stream()
+				.filter(p -> p.getName().equals("pmaa_server_0")).findAny().get();
+		ComponentInstanceProperty jsonProp = resource.getComponentInstancesProperties().get(pmaaServer.getUniqueId())
+				.stream().filter(p -> p.getType().equals(ToscaPropertyType.JSON.getType())).findAny().get();
+		String jsonValue = "{\"pmaa.sb_nic\":{\"address\":{\"get_input\":\"pmaa_dpu_fixed_ip\"},\"cidr\":{\"get_input\":\"pmaa_dpu_cidr\"},\"gateway\":{\"get_input\":\"pmaa_dpu_gateway\"}}}";
+		assertEquals(jsonProp.getValue(), jsonValue);
+		// download and compare
+		Map<String, Object> load = downloadAndParseToscaTemplate(sdncModifierDetails, resource);
+		assertNotNull(load);
+		Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
+		assertNotNull(topology_template);
+		Map<String, Object> nodes = (Map<String, Object>) topology_template.get("node_templates");
+		assertNotNull(nodes);
+		Map<String, Object> pmaaServerObj = (Map<String, Object>) nodes.get("pmaa_server_0");
+		assertNotNull(pmaaServerObj);
+		Map<String, Object> props = (Map<String, Object>) pmaaServerObj.get("properties");
+		assertNotNull(props);
+		Map<String, Object> jsonPropObj = (Map<String, Object>) props.get("metadata");
+		assertNotNull(jsonPropObj);
+		Gson gson = new Gson();
+		String json = gson.toJson(jsonPropObj);
+		assertEquals(json, jsonValue);
+	}
+	
+	@Test(enabled = true)
+	public void exportServiceInputValue() throws Exception {
+		//1 create vf as certified
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csar_1");
+		RestResponse checkinState = LifecycleRestUtils.changeComponentState(createdResource, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		BaseRestUtils.checkSuccess(checkinState);
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService("ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncModifierDetails.getUserId());
+		
+		//2 create service
+		RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifierDetails);
+		ResourceRestUtils.checkCreateResponse(createServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(createServiceResponse.getResponse(), Service.class);
+
+		//3 create vf instance in service
+		ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(createdResource);
+		RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, sdncModifierDetails, service);
+		ResourceRestUtils.checkCreateResponse(createComponentInstance);
+		
+		RestResponse getService = ServiceRestUtils.getService(service.getUniqueId());
+		BaseRestUtils.checkSuccess(getService);
+		service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
+		
+		//4 download tosca template 
+		Map<String, Object> tosca = downloadAndParseToscaTemplate(sdncModifierDetails, service);
+		assertNotNull(tosca);
+		Map<String, Object> topology_template = (Map<String, Object>) tosca.get("topology_template");
+		assertNotNull(topology_template);
+	
+		//5 validate no inputs in service
+		Map<String, Object> inputs = (Map<String, Object>) tosca.get("inputs");
+		assertNull(inputs);
+	
+		List<ComponentInstance> componentInstances = service.getComponentInstances();
+		assertNotNull(componentInstances);
+		assertEquals(1, componentInstances.size());
+		ComponentInstance vfi = componentInstances.get(0);
+		
+		//6 add instance inputs in service
+		RestResponse getComponentInstanceInputsResponse = InputsRestUtils.getComponentInstanceInputs(service, vfi);
+		BaseValidationUtils.checkSuccess(getComponentInstanceInputsResponse);
+		List<InputDefinition> instanceInputs = new Gson().fromJson(getComponentInstanceInputsResponse.getResponse(), new TypeToken<ArrayList<InputDefinition>>(){}.getType());
+		// Take only the 2 first inputs
+		List<InputDefinition> inputsToAdd = instanceInputs.stream().limit(2).collect(Collectors.toList());
+
+		//7 Build component instances input map to add to server
+		ComponentInstInputsMap buildComponentInstInputsMap = buildComponentInstInputsMap(vfi.getUniqueId(), inputsToAdd);
+		RestResponse addInputResponse = InputsRestUtils.addInput(service, buildComponentInstInputsMap, UserRoleEnum.DESIGNER);
+		BaseValidationUtils.checkSuccess(addInputResponse);
+
+		//8 validate inputs in service 
+		//8.1 download tosca template 
+		getService = ServiceRestUtils.getService(service.getUniqueId());
+		BaseRestUtils.checkSuccess(getService);
+		service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
+		
+		tosca = downloadAndParseToscaTemplate(sdncModifierDetails, service);
+		assertNotNull(tosca);
+		topology_template = (Map<String, Object>) tosca.get("topology_template");
+		assertNotNull(topology_template);
+	
+		//8.2 validate inputs in service
+		inputs = (Map<String, Object>) topology_template.get("inputs");
+		assertNotNull(inputs);
+		assertEquals(2, inputs.size());
+	
+		//validate created inputs vs inputs in Tosca inputs section		
+		final Map<String, Object> inputsFinal = inputs;
+		buildComponentInstInputsMap.getComponentInstanceInputsMap().values().forEach(listPerInstance ->{
+			listPerInstance.forEach(input ->{
+				Map<String, Object> inputInMap = (Map<String, Object>)inputsFinal.get(input.getName());
+				assertNotNull(inputInMap);
+			});
+		});
+		Map<String, List<ComponentInstanceInput>> componentInstancesInputs = service.getComponentInstancesInputs();
+		
+		//validate created inputs vs inputs in Tosca instance input value
+		List<ComponentInstanceInput> vfiInputs = componentInstancesInputs.get(vfi.getUniqueId());
+		assertNotNull(vfiInputs);
+		assertEquals(2, vfiInputs.size());
+	
+		Map<String, Object> node_templates = (Map<String, Object>) topology_template.get("node_templates");
+		assertNotNull(node_templates);
+
+		Map<String, Object> instance = (Map<String, Object>) node_templates.get(vfi.getName());
+		assertNotNull(instance);
+		Map<String, Object> properties = (Map<String, Object>)instance.get("properties");
+		assertNotNull(properties);
+	
+		vfiInputs.forEach(vfiInput ->{
+			Map<String, Object> inputPropValueInTosca = (Map<String, Object>)properties.get(vfiInput.getName() );
+			assertNotNull(inputPropValueInTosca);
+			String instaneInputName = (String)inputPropValueInTosca.get("get_input");
+			assertNotNull(instaneInputName);
+			Map<String, Object> inputInMap = (Map<String, Object>)inputsFinal.get(instaneInputName);
+			assertNotNull(inputInMap);
+		});
+		
+
+	}
+
+	
+	// ----------------------------------------
+	private void validateInput(InputDefinition inputDef, Map<String, Object> inputInFile) {
+		assertEquals("validate input type", inputDef.getType(), (String) inputInFile.get("type"));
+
+		if (inputDef.getDefaultValue() == null) {
+			assertNull(inputInFile.get("default"));
+		} else {
+			assertNotNull(inputInFile.get("default"));
+			String value = inputDef.getDefaultValue().replace("\"", "");
+			value = value.replace(" ", "");
+			String expValue = inputInFile.get("default").toString().replace(" ", "");
+			assertEquals("validate input default", value, expValue);
+		}
+		assertEquals("validate input description", inputDef.getDescription(), (String) inputInFile.get("description"));
+	}
+
+	private Map<String, Object> downloadAndParseToscaTemplate(User sdncModifierDetails, Component createdComponent)
+			throws Exception {
+		String artifactUniqeId = createdComponent.getToscaArtifacts().get("assettoscatemplate").getUniqueId();
+		RestResponse toscaTemplate;
+
+		if ( createdComponent.getComponentType() == ComponentTypeEnum.RESOURCE ){
+			toscaTemplate = ArtifactRestUtils.downloadResourceArtifactInternalApi(
+					createdComponent.getUniqueId(), sdncModifierDetails, artifactUniqeId);
+				
+		}else{
+			toscaTemplate = ArtifactRestUtils.downloadServiceArtifactInternalApi(
+					createdComponent.getUniqueId(), sdncModifierDetails, artifactUniqeId);
+		}
+		BaseRestUtils.checkSuccess(toscaTemplate);
+
+		ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(toscaTemplate.getResponse(),
+				ArtifactUiDownloadData.class);
+		byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
+		byte[] decodeBase64 = Base64.decodeBase64(fromUiDownload);
+		Yaml yaml = new Yaml();
+
+		InputStream inputStream = new ByteArrayInputStream(decodeBase64);
+
+		Map<String, Object> load = (Map<String, Object>) yaml.load(inputStream);
+		return load;
+	}
+
+
+	public ArtifactDefinition findMasterArtifact(Map<String, ArtifactDefinition> deplymentArtifact,
+			List<ArtifactDefinition> artifacts, List<String> artifactsList) {
+		for (String artifactUid : artifactsList) {
+			for (Entry<String, ArtifactDefinition> entry : deplymentArtifact.entrySet()) {
+				ArtifactDefinition artifact = entry.getValue();
+				if (artifactUid.equalsIgnoreCase(artifact.getUniqueId())) {
+					artifacts.add(artifact);
+				}
+
+			}
+		}
+		ArtifactDefinition masterArtifact = null;
+		for (ArtifactDefinition artifactInfo : artifacts) {
+			String atrifactType = artifactInfo.getArtifactType();
+			if (atrifactType.equalsIgnoreCase(ArtifactTypeEnum.HEAT_VOL.getType())
+					|| atrifactType.equalsIgnoreCase(ArtifactTypeEnum.HEAT_NET.getType())) {
+				masterArtifact = artifactInfo;
+				continue;
+			}
+			if (atrifactType.equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) {
+				masterArtifact = artifactInfo;
+				break;
+			}
+		}
+		return masterArtifact;
+	}
+	private ComponentInstInputsMap buildComponentInstInputsMap (String addToInput, List<InputDefinition> inputs) {
+		Map<String, List<InputDefinition>> map = new HashMap<>();
+		map.put(addToInput, inputs);
+		ComponentInstInputsMap componentInstInputsMap = new ComponentInstInputsMap();
+		componentInstInputsMap.setComponentInstanceInputsMap(map);		
+		return componentInstInputsMap;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java
new file mode 100644
index 0000000..1b559aa
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportCsarResourceTest.java
@@ -0,0 +1,1751 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang.WordUtils;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupProperty;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.GroupRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.util.ValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class ImportCsarResourceTest extends ComponentBaseTest {
+	private static Logger log = LoggerFactory.getLogger(ImportCsarResourceTest.class.getName());
+	@Rule
+	public static TestName name = new TestName();
+
+	Gson gson = new Gson();
+
+	public ImportCsarResourceTest() {
+		super(name, ImportCsarResourceTest.class.getName());
+	}
+
+	private String buildAssertMessage(String expectedString, String actualString) {
+		return String.format("expected is : %s , actual is: %s", expectedString, actualString);
+	}
+
+	/**
+	 * 
+	 * User Story : US640615 [BE] - Extend create VF API with Import TOSCA CSAR
+	 */
+
+	@Test(enabled = true)
+	public void createResourceFromCsarHappy() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("AF7F231969C5463F9C968570070E8877");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		String expectedCsarUUID = resourceDetails.getCsarUUID();
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, resource.getCsarUUID()), expectedCsarUUID.equals(resource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, getResource.getCsarUUID()), expectedCsarUUID.equals(getResource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void emptyStringInCsarUUIDFieldTest() throws Exception {
+		String emptyString = "";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(emptyString);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(null, resource.getComponentInstances());
+
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(emptyString, resource.getCsarUUID()), resource.getCsarUUID() == emptyString);
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(emptyString, getResource.getCsarUUID()), getResource.getCsarUUID() == emptyString);
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromScratchTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(null, resource.getComponentInstances());
+
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(null, resource.getCsarUUID()), resource.getCsarUUID() == null);
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(null, getResource.getCsarUUID()), getResource.getCsarUUID() == null);
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void fileNotCsarTypeTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("valid_vf_zip");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_NOT_FOUND.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void missingToscaMetadataFolderTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("toscaFolderNotExists");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void missingToscaMetaFileTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("toscaMetaFileNotExists");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void toscaMetaFileOutsideTheFolderTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("toscaMetaOutsideTheFolder");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void caseSensitiveTest_1() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("caseSensitiveTest_1");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void caseSensitiveTest_2() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("caseSensitiveTest_2");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void missingOneLineInToscaMetaFileTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("missingOneLineInToscaMeta");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void noCSARVersionTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("noCSARVersion");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void noCreatedByValueTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("noCreatedByValue");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void noEntryDefinitionsValueTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("noEntryDefinitionsValue");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void noTOSCAMetaFileVersionValueTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("noTOSCAMetaFileVersionValue");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void invalidCsarVersionInMetaFileTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("invalidCsarVersion");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+
+		resourceDetails.setCsarUUID("invalidCsarVersion2");
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+
+		resourceDetails.setCsarUUID("invalidCsarVersion3");
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+
+		resourceDetails.setCsarUUID("invalidCsarVersion4");
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+
+		resourceDetails.setCsarUUID("invalidCsarVersion5");
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+
+	}
+
+	@Test(enabled = true)
+	public void validCsarVersionInMetaFileTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("validCsarVersion");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		String expectedCsarUUID = resourceDetails.getCsarUUID();
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, resource.getCsarUUID()), expectedCsarUUID.equals(resource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, getResource.getCsarUUID()), expectedCsarUUID.equals(getResource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void underscoreInToscaMetaFileVersionNameTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("underscoreInsteadOfDash");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void missingEntryDefintionInMetaFileTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("missingEntryDefintionPair");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = false)
+	public void noNewLineAfterBLock0Test() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("noNewLineAfterBLock0");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void moreThanOneYamlFileTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("moreThenOneYamlFile");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		String expectedCsarUUID = resourceDetails.getCsarUUID();
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, resource.getCsarUUID()), expectedCsarUUID.equals(resource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, getResource.getCsarUUID()), expectedCsarUUID.equals(getResource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void moreThanOneMetaFileTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("moreThanOneMetaFile");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		String expectedCsarUUID = resourceDetails.getCsarUUID();
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, resource.getCsarUUID()), expectedCsarUUID.equals(resource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, getResource.getCsarUUID()), expectedCsarUUID.equals(getResource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void csarNotContainsYamlAndMetaFilesTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("notContainYamlAndMetaFiles");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void csarNotContainsYamlFileTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("notContainYamlFile");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		variables.add("Definitions/tosca_mock_vf.yaml");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.YAML_NOT_FOUND_IN_CSAR.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void missingCsarFileTest() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("abc");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_NOT_FOUND.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void longNamesInToscaMetaFileTest_1() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("longNamesInToscaMetaFile1");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void longNamesInToscaMetaFileTest_2() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("longNamesInToscaMetaFile2");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void longNamesInToscaMetaFileTest_3() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("longNamesInToscaMetaFile3");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void longNamesInToscaMetaFileTest_4() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("longNamesInToscaMetaFile4");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void longNamesInToscaMetaFileTest_5() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("longNamesInToscaMetaFile5");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	// possible to have more than four lines in block 0
+	// @Test (enabled = true)
+	public void fiveLinesAsBlock0Test() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		resourceDetails.setCsarUUID("fiveLinesAsBlock0");
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		List<String> variables = new ArrayList<String>();
+		variables.add(resourceDetails.getCsarUUID());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.CSAR_INVALID_FORMAT.name(), variables, createResource.getResponse());
+	}
+
+	@Test(enabled = true)
+	public void lifecycleChangingToResourceFromCsarTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("valid_vf");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertTrue("0.1".equals(resource.getVersion()));
+		assertTrue(LifeCycleStatesEnum.CHECKOUT.getComponentState().equals(resource.getLifecycleState().toString()));
+
+		String designerUserId = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId();
+		String testerUserId = ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getUserId();
+		String csarUniqueId = resourceDetails.getUniqueId();
+		assertNotNull(csarUniqueId);
+
+		RestResponse lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUserId, LifeCycleStatesEnum.STARTCERTIFICATION);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUserId, LifeCycleStatesEnum.CERTIFY);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+
+		resource = ResponseParser.parseToObjectUsingMapper(lifecycleChangeResponse.getResponse(), Resource.class);
+		Map<String, String> allVersions = resource.getAllVersions();
+		assertEquals(2, allVersions.keySet().size());
+		assertEquals(2, allVersions.values().size());
+		Set<String> keySet = allVersions.keySet();
+		assertTrue(keySet.contains("1.0"));
+		assertTrue(keySet.contains("1.1"));
+	}
+
+	@Test(enabled = true)
+	public void csarWithJsonPromEnvTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("VSPPackageJsonProp.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+	}
+
+	@Test(enabled = true)
+	public void uploadArtifactToResourceFromCsarTest() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("valid_vf");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		User designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultArtifact("firstArtifact");
+		String firstArtifactLabel = artifactDetails.getArtifactLabel();
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails, designer, resourceDetails.getUniqueId());
+		ArtifactRestUtils.checkSuccess(addInformationalArtifactToResource);
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resourceDetails.getUniqueId());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		Map<String, ArtifactDefinition> informationalArtifacts = resource.getArtifacts();
+		assertEquals(1, informationalArtifacts.keySet().size());
+		Set<String> keySet = informationalArtifacts.keySet();
+		assertTrue(keySet.contains(firstArtifactLabel.toLowerCase()));
+		Collection<ArtifactDefinition> values = informationalArtifacts.values();
+		assertEquals(1, values.size());
+		Iterator<ArtifactDefinition> iterator = values.iterator();
+		while (iterator.hasNext()) {
+			ArtifactDefinition actualArtifact = iterator.next();
+			assertTrue(firstArtifactLabel.equals(actualArtifact.getArtifactDisplayName()));
+		}
+
+		RestResponse lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designer.getUserId(), LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designer.getUserId(), LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+
+		ArtifactReqDetails artifactDetails2 = ElementFactory.getDefaultArtifact("secondArtifact");
+		artifactDetails2.setArtifactName("secondArtifact");
+		addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails2, designer, resourceDetails.getUniqueId());
+		ArtifactRestUtils.checkSuccess(addInformationalArtifactToResource);
+
+		getResourceResponse = ResourceRestUtils.getResource(resourceDetails.getUniqueId());
+		resource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		informationalArtifacts = resource.getArtifacts();
+		assertEquals(2, informationalArtifacts.keySet().size());
+		keySet = informationalArtifacts.keySet();
+		assertTrue(keySet.contains(firstArtifactLabel.toLowerCase()));
+		assertTrue(keySet.contains(artifactDetails2.getArtifactLabel().toLowerCase()));
+		values = informationalArtifacts.values();
+		assertEquals(2, values.size());
+		ArtifactDefinition[] actualArtifacts = values.toArray(new ArtifactDefinition[2]);
+		assertTrue(firstArtifactLabel.equals(actualArtifacts[0].getArtifactDisplayName()));
+		assertTrue(artifactDetails2.getArtifactLabel().equals(actualArtifacts[1].getArtifactDisplayName()));
+	}
+
+	/*
+	 * // @Test (enabled = true) public void createUpdateImportResourceFromCsarArtifactsWereNotChangedTest() throws Exception { // User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); // //back original scar RestResponse
+	 * copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar"); BaseRestUtils.checkSuccess(copyRes);
+	 * 
+	 * // resourceDetails.setResourceType(ResourceTypeEnum.VF.name()); // RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails); resourceDetails.setName("test5");
+	 * resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar"); resourceDetails.setCsarVersion("1"); // String invariantUUID = resource.getInvariantUUID(); // // RestResponse changeResourceState =
+	 * LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN); // assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+	 * 
+	 * // BaseRestUtils.checkSuccess(copyRes); // //change name (temporary) resourceDetails.setCsarVersion("2"); resourceDetails.setName("test6"); createResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails,
+	 * resourceDetails.getUniqueId()); Resource updatedResource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class); Map<String, ArtifactDefinition> updatedArtifacts = updatedResource.getDeploymentArtifacts(); for
+	 * (Entry<String, ArtifactDefinition> artifactEntry : resource.getDeploymentArtifacts().entrySet()) { if (updatedArtifacts.containsKey(artifactEntry.getKey())) { ArtifactDefinition currArt = updatedArtifacts.get(artifactEntry.getKey());
+	 * assertEquals(currArt.getArtifactVersion(), artifactEntry.getValue().getArtifactVersion()); assertEquals(currArt.getArtifactUUID(), artifactEntry.getValue().getArtifactUUID()); assertEquals(currArt.getArtifactChecksum(),
+	 * artifactEntry.getValue().getArtifactChecksum()); } } // resourceDetails = ElementFactory.getDefaultResource(); // resourceDetails.setName("test5"); // resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar"); }
+	 */
+
+	@Test(enabled = true)
+	public void createImportResourceFromCsarDissotiateArtifactFromGroupTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+
+		// create new resource from Csar
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		String invariantUUID = resource.getInvariantUUID();
+
+		// add artifact from metadata (resource metadata should be updated)
+		// RestResponse addInformationalArtifactToResource =
+		// ArtifactRestUtils.addInformationalArtifactToResource(ElementFactory.getDefaultArtifact(),
+		// sdncModifierDetails, resourceDetails.getUniqueId());
+		// ArtifactRestUtils.checkSuccess(addInformationalArtifactToResource);
+		resourceDetails.setName("test4");
+		RestResponse updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(invariantUUID, resource.getInvariantUUID());
+
+		// wrong RI (without node types, resource shouldn't be updated)
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_dissociate.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		// change name (temporary)
+		resourceDetails.setName("test4");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(invariantUUID, resource.getInvariantUUID());
+
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+	}
+
+	@Test(enabled = true)
+	public void createImportResourceFromCsarNewgroupTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+
+		// create new resource from Csar
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		String invariantUUID = resource.getInvariantUUID();
+
+		// update scar
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_UpdateToscaAndArtifacts.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails.setName("test2");
+		// change resource metaData (resource should be updated)
+		resourceDetails.setDescription("It is new description bla bla bla");
+		RestResponse updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		assertEquals(invariantUUID, resource.getInvariantUUID());
+
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+	}
+
+	@Test(enabled = true)
+	public void createImportResourceFromCsarGetGroupTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		// RestResponse copyRes =
+		// copyCsarRest(sdncModifierDetails,"VF_RI2_G4_withArtifacts_a.csar","VF_RI2_G4_withArtifacts.csar");
+
+		// create new resource from Csar
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("VSPPackage");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		String invariantUUID = resource.getInvariantUUID();
+		List<GroupDefinition> groups = resource.getGroups();
+
+		GroupDefinition groupWithArtifact = groups.stream().filter(p -> p.getArtifacts() != null && !p.getArtifacts().isEmpty()).findFirst().get();
+
+		RestResponse groupRest = GroupRestUtils.getGroupById(resource, groupWithArtifact.getUniqueId(), sdncModifierDetails);
+		BaseRestUtils.checkSuccess(groupRest);
+
+		GroupDefinition groupWithoutArtifact = groups.stream().filter(p -> p.getArtifacts() == null || p.getArtifacts().isEmpty()).findFirst().get();
+
+		groupRest = GroupRestUtils.getGroupById(resource, groupWithoutArtifact.getUniqueId(), sdncModifierDetails);
+		BaseRestUtils.checkSuccess(groupRest);
+	}
+
+	@Test(enabled = true)
+	public void createImportResourceFromCsarUITest() throws Exception {
+		RestResponse getResource = null;
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "valid_vf.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		String rootPath = System.getProperty("user.dir");
+		Path path = null;
+		byte[] data = null;
+		String payloadData = null;
+
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		// create new resource from Csar
+		resourceDetails.setCsarUUID(payloadName);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		RestResponse changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change composition (resource should be updated)
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf_b.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		// change name
+		resourceDetails.setName("test1");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(2, resource.getComponentInstances().size());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change name
+		resourceDetails.setName("test2");
+		// change resource metaData (resource should be updated)
+		resourceDetails.setDescription("It is new description bla bla bla");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(2, resource.getComponentInstances().size());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// wrong RI (without node types, resource shouldn't be updated)
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf_c.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		// change name
+		resourceDetails.setName("test3");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.INVALID_NODE_TEMPLATE, "Definitions/tosca_mock_vf.yaml", "nodejs", "tosca.nodes.Weber");
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(null, resource);
+		getResource = ResourceRestUtils.getResourceByNameAndVersion(sdncModifierDetails.getUserId(), "test3", resourceDetails.getVersion());
+		BaseRestUtils.checkErrorResponse(getResource, ActionStatus.RESOURCE_NOT_FOUND, "test3");
+
+		// create new resource from other Csar
+		resourceDetails = ElementFactory.getDefaultImportResource();
+		path = Paths.get(rootPath + "/src/main/resources/ci/VF_RI2_G4_withArtifacts.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setPayloadName("VF_RI2_G4_withArtifacts.csar");
+		resourceDetails.setName("test4");
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// wrong RI (with node types) resource shouldn't be created
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts_b.csar");
+		path = Paths.get(rootPath + "/src/main/resources/ci/VF_RI2_G4_withArtifacts_b.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setPayloadName("VF_RI2_G4_withArtifacts_b.csar");
+		resourceDetails.setName("test5");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.INVALID_NODE_TEMPLATE, "Definitions/VF_RI2_G1.yaml", "ps04_port_0", "org.openecomp.resource.cp.nodes.heat.network.neutron.Portur");
+	}
+
+	@Test(enabled = true)
+	public void createUpdateImportResourceFromCsarUITest() throws Exception {
+		RestResponse getResource = null;
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "valid_vf.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		String rootPath = System.getProperty("user.dir");
+		Path path = null;
+		byte[] data = null;
+		String payloadData = null;
+
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		// create new resource from Csar
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		RestResponse changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change composition and update resource
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf_b.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setUniqueId(resource.getUniqueId());
+		// change name
+		RestResponse updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resource.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(2, resource.getComponentInstances().size());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change name
+		resourceDetails.setName("test2");
+		// change resource metaData (resource should be updated)
+		resourceDetails.setDescription("It is new description bla bla bla");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resource.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(2, resource.getComponentInstances().size());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// try to update resource with wrong RI (without node types, resource
+		// shouldn't be updated)
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf_c.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		// change name
+		resourceDetails.setName("test3");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resource.getUniqueId());
+		BaseRestUtils.checkErrorResponse(updateResource, ActionStatus.INVALID_NODE_TEMPLATE, "Definitions/tosca_mock_vf.yaml", "nodejs", "tosca.nodes.Weber");
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(null, resource);
+		getResource = ResourceRestUtils.getResourceByNameAndVersion(sdncModifierDetails.getUserId(), "test3", resourceDetails.getVersion());
+		BaseRestUtils.checkErrorResponse(getResource, ActionStatus.RESOURCE_NOT_FOUND, "test3");
+	}
+
+	@Test(enabled = true)
+	public void createUpdateImportResourceFromCsarTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = null;
+		RestResponse getResource = null;
+		ResourceReqDetails resourceDetails = null;
+		RestResponse updateResource = null;
+		RestResponse createResource = null;
+		Resource resource = null;
+		RestResponse changeResourceState = null;
+
+		// create new resource from Csar
+		copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_a.csar", "valid_vf.csar");
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("valid_vf.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+		String invariantUUID = resource.getInvariantUUID();
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change composition and update resource
+		copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_b.csar", "valid_vf.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		// change name
+		resourceDetails.setName("test1");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resource.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(2, resource.getComponentInstances().size());
+		assertEquals(invariantUUID, resource.getInvariantUUID());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_a.csar", "valid_vf.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		// change name
+		resourceDetails.setName("test2");
+		// change resource metaData and update resource
+		resourceDetails.setDescription("It is new description bla bla bla");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resource.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+		assertEquals(invariantUUID, resource.getInvariantUUID());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_a.csar", "valid_vf.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		// try to update resource with wrong RI (without node types, resource
+		// shouldn't be updated)
+		copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_c.csar", "valid_vf.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		// change name (temporary)
+		resourceDetails.setName("test3");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resource.getUniqueId());
+		BaseRestUtils.checkErrorResponse(updateResource, ActionStatus.INVALID_NODE_TEMPLATE, "Definitions/tosca_mock_vf.yaml", "nodejs", "tosca.nodes.Weber");
+
+		getResource = ResourceRestUtils.getResourceByNameAndVersion(sdncModifierDetails.getUserId(), "test3", resourceDetails.getVersion());
+		BaseRestUtils.checkErrorResponse(getResource, ActionStatus.RESOURCE_NOT_FOUND, "test3");
+		getResource = ResourceRestUtils.getResourceByNameAndVersion(sdncModifierDetails.getUserId(), "test2", resourceDetails.getVersion());
+		BaseRestUtils.checkSuccess(getResource);
+
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_a.csar", "valid_vf.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		// create new resource from Csar
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("TEST01");
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// scar with wrong RI
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_b.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		resourceDetails.setDescription("BLA BLA BLA");
+		// wrong RI (with node types) resource shouldn't be created
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkErrorResponse(updateResource, ActionStatus.INVALID_NODE_TEMPLATE, "Definitions/VF_RI2_G1.yaml", "ps04_port_0", "org.openecomp.resource.cp.nodes.heat.network.neutron.Portur");
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+	}
+
+	@Test(enabled = true)
+	public void createUpdateImportResourceFromCsarWithArtifactsTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = null;
+		ResourceReqDetails resourceDetails = null;
+		RestResponse updateResource = null;
+		RestResponse createResource = null;
+		Resource resource = null;
+		RestResponse changeResourceState = null;
+
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("TEST01");
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts.csar");
+		resourceDetails.setCsarVersion("1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		// create new resource from Csar
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		List<String> requiredArtifactsOld = resource.getDeploymentArtifacts().get("heat5").getRequiredArtifacts();
+		assertTrue(requiredArtifactsOld != null && !requiredArtifactsOld.isEmpty() && requiredArtifactsOld.size() == 3);
+		assertTrue(requiredArtifactsOld.contains("hot-nimbus-pcm-volumes_v1.0.yaml"));
+		assertTrue(requiredArtifactsOld.contains("nested-pcm_v1.0.yaml"));
+		assertTrue(requiredArtifactsOld.contains("hot-nimbus-oam-volumes_v1.0.yaml"));
+
+		// update scar with new artifacts
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_updated.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		resourceDetails.setDescription("BLA BLA BLA");
+		resourceDetails.setCsarVersion("2");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+
+		List<String> requiredArtifactsNew = resource.getDeploymentArtifacts().get("heat5").getRequiredArtifacts();
+		assertTrue(requiredArtifactsNew != null && !requiredArtifactsNew.isEmpty() && requiredArtifactsNew.size() == 3);
+		assertTrue(requiredArtifactsNew.contains("hot-nimbus-swift-container_v1.0.yaml"));
+		assertTrue(requiredArtifactsNew.contains("hot-nimbus-oam-volumes_v1.0.yaml"));
+		assertTrue(requiredArtifactsNew.contains("nested-oam_v1.0.yaml"));
+
+		// back original scar
+		copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar", "VF_RI2_G4_withArtifacts.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+	}
+
+	@Test(enabled = true)
+	public void createUpdateImportWithPropertiesFromCsarUITest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "valid_vf.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		String rootPath = System.getProperty("user.dir");
+		Path path = null;
+		byte[] data = null;
+		String payloadData = null;
+
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		// create new resource from Csar
+		resourceDetails.setCsarUUID(payloadName);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		RestResponse changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change composition (add new RI with specified property values)
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf_d.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		// change name
+		resourceDetails.setName("test1");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(6, resource.getComponentInstances().size());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		// change composition (add new specified property values to existing RI)
+		path = Paths.get(rootPath + "/src/main/resources/ci/valid_vf_f.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		// change name
+		resourceDetails.setName("test2");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(6, resource.getComponentInstances().size());
+
+	}
+
+	public static RestResponse copyCsarRest(User sdncModifierDetails, String sourceCsarUuid, String targetCsarUuid) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.COPY_CSAR_USING_SIMULATOR, config.getCatalogBeHost(), config.getCatalogBePort(), sourceCsarUuid, targetCsarUuid);
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+
+		RestResponse copyCsarResponse = http.httpSendPost(url, "dummy", headersMap);
+		if (copyCsarResponse.getErrorCode() != 200) {
+			return null;
+		}
+		return copyCsarResponse;
+
+	}
+
+	public static RestResponse getCsarRest(User sdncModifierDetails, String sourceCsarUuid) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_CSAR_USING_SIMULATOR, config.getCatalogBeHost(), config.getCatalogBePort(), sourceCsarUuid);
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+
+		RestResponse copyCsarResponse = http.httpSendGet(url, headersMap);
+		if (copyCsarResponse.getErrorCode() != 200) {
+			return null;
+		}
+		return copyCsarResponse;
+
+	}
+
+	@Test(enabled = true)
+	public void updateResourceFromCsarHappy() throws Exception {
+		RestResponse copyRes = copyCsarRest(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "valid_vf_a.csar", "valid_vf.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		// create
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("valid_vf");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		String expectedCsarUUID = resourceDetails.getCsarUUID();
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, resource.getCsarUUID()), expectedCsarUUID.equals(resource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getResource(resource.getUniqueId());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, getResource.getCsarUUID()), expectedCsarUUID.equals(getResource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+
+		RestResponse updateResource = ResourceRestUtils.updateResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarWithGroupsHappy() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroups");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		assertEquals("verify there are 2 groups", 2, resource.getGroups().size());
+
+		Map<String, String> compNameToUniqueId = resource.getComponentInstances().stream().collect(Collectors.toMap(p -> p.getName(), p -> p.getUniqueId()));
+
+		// Verify 2 members on group1
+		// members: [ app_server, mongo_server ]
+		String[] membersNameGroup1 = { "app_server", "mongo_server" };
+		verifyMembersInResource(resource, compNameToUniqueId, "group1", membersNameGroup1);
+		// Verify 4 members on group2
+		// members: [ mongo_db, nodejs, app_server, mongo_server ]
+		String[] membersNameGroup2 = { "app_server", "mongo_server", "mongo_db", "nodejs" };
+		verifyMembersInResource(resource, compNameToUniqueId, "group2", membersNameGroup2);
+
+		// Check OUT
+		resourceDetails.setUniqueId(resource.getUniqueId());
+		RestResponse changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		changeResourceState = LifecycleRestUtils.changeResourceState(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+
+		Resource checkedOutResource = ResponseParser.parseToObjectUsingMapper(changeResourceState.getResponse(), Resource.class);
+		compNameToUniqueId = checkedOutResource.getComponentInstances().stream().collect(Collectors.toMap(p -> p.getName(), p -> p.getUniqueId()));
+
+		// Verify 2 members on group1
+		// members: [ app_server, mongo_server ]
+		verifyMembersInResource(checkedOutResource, compNameToUniqueId, "group1", membersNameGroup1);
+		// Verify 4 members on group2
+		// members: [ mongo_db, nodejs, app_server, mongo_server ]
+		verifyMembersInResource(checkedOutResource, compNameToUniqueId, "group2", membersNameGroup2);
+
+	}
+
+	private void verifyMembersInResource(Resource resource, Map<String, String> compNameToUniqueId, String groupName, String[] membersName) {
+		GroupDefinition groupDefinition = resource.getGroups().stream().filter(p -> p.getName().equals(groupName)).findFirst().get();
+		assertEquals("Verify number of members", membersName.length, groupDefinition.getMembers().size());
+		Map<String, String> createdMembers = groupDefinition.getMembers();
+		Arrays.asList(membersName).forEach(p -> {
+			assertTrue("check member name exist", createdMembers.containsKey(p));
+		});
+
+		verifyMembers(createdMembers, compNameToUniqueId);
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarWithGroupsAndPropertiesHappy() throws Exception {
+
+		RestResponse importNewGroupTypeByName = ImportRestUtils.importNewGroupTypeByName("myHeatStack1", UserRoleEnum.ADMIN);
+		// BaseRestUtils.checkCreateResponse(importNewGroupTypeByName);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroupsWithProps");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+
+		assertEquals("verify there are 2 groups", 2, resource.getGroups().size());
+
+		Map<String, String> compNameToUniqueId = resource.getComponentInstances().stream().collect(Collectors.toMap(p -> p.getName(), p -> p.getUniqueId()));
+
+		// Verify 2 members on group1
+		// members: [ app_server, mongo_server ]
+		List<GroupDefinition> groupDefinition1 = resource.getGroups().stream().filter(p -> p.getName().equals("group1")).collect(Collectors.toList());
+		assertEquals("Verify number of members", 2, groupDefinition1.get(0).getMembers().size());
+		Map<String, String> createdMembers = groupDefinition1.get(0).getMembers();
+		verifyMembers(createdMembers, compNameToUniqueId);
+
+		List<PropertyDataDefinition> properties = groupDefinition1.get(0).getProperties();
+		assertEquals("Verify number of members", 2, properties.size());
+
+		PropertyDataDefinition heatFiles = properties.stream().filter(p -> p.getName().equals("heat_files")).findFirst().get();
+		assertNotNull("check heat files not empty", heatFiles);
+		List<String> heatFilesValue = new ArrayList<>();
+		heatFilesValue.add("heat1.yaml");
+		heatFilesValue.add("heat2.yaml");
+		String heatFilesJson = gson.toJson(heatFilesValue);
+		log.debug(heatFiles.getValue());
+		assertEquals("check heat files value", heatFilesJson, heatFiles.getValue());
+
+		PropertyDataDefinition urlCredential = properties.stream().filter(p -> p.getName().equals("url_credential")).findFirst().get();
+		assertNotNull("check heat files not empty", urlCredential);
+		log.debug(urlCredential.getValue());
+		assertEquals("check url credential", "{\"protocol\":\"protocol1\",\"keys\":{\"keya\":\"valuea\",\"keyb\":\"valueb\"}}", urlCredential.getValue());
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarWithGroupsAndPropertyInvalidValue() throws Exception {
+
+		RestResponse importNewGroupTypeByName = ImportRestUtils.importNewGroupTypeByName("myHeatStack1", UserRoleEnum.ADMIN);
+		// BaseRestUtils.checkCreateResponse(importNewGroupTypeByName);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroupsInvalidPropertyValue");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+		BaseRestUtils.checkStatusCode(createResource, "Check bad request error", false, 400);
+
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarWithGroupsAndInvalidPropertyName() throws Exception {
+
+		RestResponse importNewGroupTypeByName = ImportRestUtils.importNewGroupTypeByName("myHeatStack1", UserRoleEnum.ADMIN);
+		// BaseRestUtils.checkCreateResponse(importNewGroupTypeByName);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroupsPropertyNotExist");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+		BaseRestUtils.checkStatusCode(createResource, "Check bad request error", false, 400);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.GROUP_PROPERTY_NOT_FOUND, "url_credential111", "group1", "org.openecomp.groups.MyHeatStack1");
+
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarGroupTypeNotExist() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroupsInvalidGroupType");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+		BaseRestUtils.checkStatusCode(createResource, "Check bad request error", false, 400);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.GROUP_TYPE_IS_INVALID, "org.openecomp.groups.stamGroupType");
+
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarMemberNotExist() throws Exception {
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroupsInvalidMember");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+		BaseRestUtils.checkStatusCode(createResource, "Check bad request error", false, 400);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.GROUP_INVALID_COMPONENT_INSTANCE, "mycomp", "mygroup", ValidationUtils.normaliseComponentName(resourceDetails.getName()), "VF");
+
+	}
+
+	@Test(enabled = true)
+	public void createResourceFromCsarMemberNotAllowed() throws Exception {
+
+		RestResponse importNewGroupTypeByName = ImportRestUtils.importNewGroupTypeByName("myHeatStack2", UserRoleEnum.ADMIN);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csarWithGroupsNotAllowedMember");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+
+		BaseRestUtils.checkStatusCode(createResource, "Check bad request error", false, 400);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.GROUP_INVALID_TOSCA_NAME_OF_COMPONENT_INSTANCE, "nodejs", "group1", "org.openecomp.groups.MyHeatStack2");
+
+	}
+
+	@Test(enabled = true)
+	public void getResourceFromCsarUuidHappy() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("tam");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(6, resource.getComponentInstances().size());
+
+		String expectedCsarUUID = resourceDetails.getCsarUUID();
+		String expectedToscaResourceName = "org.openecomp.resource.vf." + WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, resource.getCsarUUID()), expectedCsarUUID.equals(resource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, resource.getToscaResourceName()), expectedToscaResourceName.equals(resource.getToscaResourceName()));
+
+		RestResponse getResourceResponse = ResourceRestUtils.getLatestResourceFromCsarUuid(resource.getCsarUUID());
+		Resource getResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(), Resource.class);
+		assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID, getResource.getCsarUUID()), expectedCsarUUID.equals(getResource.getCsarUUID()));
+		assertTrue("toscaResourceName : " + buildAssertMessage(expectedToscaResourceName, getResource.getToscaResourceName()), expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+	}
+
+	@Test(enabled = true)
+	public void getResourceFromCsarResourceNotFound() throws Exception {
+		String csarUUID = "tam";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+
+		RestResponse resResponse = ResourceRestUtils.getLatestResourceFromCsarUuid(csarUUID);
+
+		BaseRestUtils.checkStatusCode(resResponse, "Check bad request error", false, 400);
+		BaseRestUtils.checkErrorResponse(resResponse, ActionStatus.RESOURCE_FROM_CSAR_NOT_FOUND, csarUUID);
+
+	}
+
+	@Test(enabled = true)
+	public void getResourceFromMissingCsar() throws Exception {
+		String csarUUID = "abcdefg12345";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID(csarUUID);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+
+		RestResponse resResponse = ResourceRestUtils.getLatestResourceFromCsarUuid(csarUUID);
+
+		BaseRestUtils.checkStatusCode(resResponse, "Check bad request error", false, 400);
+		BaseRestUtils.checkErrorResponse(resResponse, ActionStatus.RESOURCE_FROM_CSAR_NOT_FOUND, csarUUID);
+
+	}
+
+	@Test(enabled = true)
+	public void createUpdateCertifiedImportResourceFromCsarTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes = copyCsarRest(sdncModifierDetails, "valid_vf_a.csar", "valid_vf.csar");
+		RestResponse updateResponse = null;
+		String oldName = null;
+		// create new resource from Csar
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("valid_vf.csar");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+		String invariantUUID = resource.getInvariantUUID();
+
+		// change metadata
+		// resource name, icon, vendor name, category, template derivedFrom
+		oldName = resourceDetails.getName();
+		resourceDetails.setName("test1");
+		resourceDetails.setIcon("newicon");
+		resourceDetails.setVendorName("newname");
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.VSP_ALREADY_EXISTS, "valid_vf.csar", oldName);
+
+		updateResponse = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResponse);
+
+		LifecycleRestUtils.certifyResource(resourceDetails);
+		// change metadata
+		// resource name, icon, vendor name, category, template derivedFrom
+		resourceDetails.setName("test2");
+		resourceDetails.setIcon("new icon1");
+		resourceDetails.setVendorName("new name1");
+		resourceDetails.setDescription("bla bla bla");
+		updateResponse = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails, resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResponse);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResponse.getResponse(), Resource.class);
+		assertEquals(5, resource.getComponentInstances().size());
+		assertEquals(invariantUUID, resource.getInvariantUUID());
+		assertEquals(resource.getName(), "test1");
+		assertEquals(resource.getIcon(), "newicon");
+		assertEquals(resource.getVendorName(), "newname");
+		assertEquals(resource.getDescription(), "bla bla bla");
+		assertEquals(resource.getTags().contains("test2"), false);
+	}
+
+	@Test
+	public void createImportRIRelationByCapNameFromCsarUITest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "vmmc_relate_by_cap_name.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		String rootPath = System.getProperty("user.dir");
+		Path path = null;
+		byte[] data = null;
+		String payloadData = null;
+
+		path = Paths.get(rootPath + "/src/test/resources/CI/csars/vmmc_relate_by_cap_name.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		// create new resource from Csar
+		resourceDetails.setCsarUUID(payloadName);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		// assert all relations created
+		assertEquals(80, resource.getComponentInstancesRelations().size());
+	}
+
+	@Test
+	public void createImportRIRelationByCapNameFromCsarUITest2() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "vf_relate_by_cap_name.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		String rootPath = System.getProperty("user.dir");
+		Path path = null;
+		byte[] data = null;
+		String payloadData = null;
+
+		path = Paths.get(rootPath + "/src/test/resources/CI/csars/vf_relate_by_cap_name.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		// create new resource from Csar
+		resourceDetails.setCsarUUID(payloadName);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		// assert relations created: 1.by name: virtual_linkable. 2.by name:
+		// link
+		Map<String, ComponentInstance> nodes = resource.getComponentInstances().stream().collect(Collectors.toMap(n -> n.getName(), n -> n));
+		Map<String, CapabilityDefinition> capabilities = nodes.get("elinenode").getCapabilities().get("tosca.capabilities.network.Linkable").stream().collect(Collectors.toMap(e -> e.getName(), e -> e));
+		String cp1Uid = nodes.get("cp1node").getUniqueId();
+		String cp2Uid = nodes.get("cp2node").getUniqueId();
+		Map<String, List<RequirementCapabilityRelDef>> mappedByReqOwner = resource.getComponentInstancesRelations().stream().collect(Collectors.groupingBy(e -> e.getFromNode()));
+		assertEquals(mappedByReqOwner.get(cp1Uid).get(0).getRelationships().get(0).getCapabilityUid(), capabilities.get("virtual_linkable").getUniqueId());
+		assertEquals(mappedByReqOwner.get(cp2Uid).get(0).getRelationships().get(0).getCapabilityUid(), capabilities.get("link").getUniqueId());
+	}
+
+	@Test(enabled = true)
+	public void importCsarCheckVfHeatEnv() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("csar_1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+	
+		Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
+		assertNotNull(deploymentArtifacts);
+		// 2 lisence, 1 heat, 1 heatenv
+		assertEquals(4, deploymentArtifacts.size());
+
+		ArtifactDefinition artifactHeat = deploymentArtifacts.get("heat0");
+		assertNotNull(artifactHeat);
+
+		ArtifactDefinition artifactHeatEnv = deploymentArtifacts.get("heat0env");
+		assertNotNull(artifactHeatEnv);
+
+		assertEquals(artifactHeat.getUniqueId(), artifactHeatEnv.getGeneratedFromId());
+		assertEquals("VF HEAT ENV", artifactHeatEnv.getArtifactDisplayName());
+		assertEquals("HEAT_ENV", artifactHeatEnv.getArtifactType());
+		assertEquals("VF Auto-generated HEAT Environment deployment artifact", artifactHeatEnv.getDescription());
+
+		String designerUserId = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId();
+		String testerUserId = ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getUserId();
+		RestResponse lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUserId, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUserId, LifeCycleStatesEnum.STARTCERTIFICATION);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		lifecycleChangeResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUserId, LifeCycleStatesEnum.CERTIFY);
+		LifecycleRestUtils.checkSuccess(lifecycleChangeResponse);
+		Resource certifiedResource = ResponseParser.parseToObjectUsingMapper(lifecycleChangeResponse.getResponse(), Resource.class);
+
+
+		User modifier = new User();
+		modifier.setUserId(designerUserId);
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService("newtestservice1", ServiceCategoriesEnum.MOBILITY, designerUserId);
+		
+		RestResponse serviceRes = ServiceRestUtils.createService(serviceDetails, modifier);
+		ResourceRestUtils.checkCreateResponse(serviceRes);
+		Service service =  ResponseParser.parseToObjectUsingMapper(serviceRes.getResponse(), Service.class);
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getComponentInstance(certifiedResource);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, modifier, service.getUniqueId(), service.getComponentType());
+		BaseRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		RestResponse serviceByGet = ServiceRestUtils.getService(service.getUniqueId());
+		service =  ResponseParser.parseToObjectUsingMapper(serviceByGet.getResponse(), Service.class);
+		
+		List<ComponentInstance> componentInstances = service.getComponentInstances();
+		assertNotNull(componentInstances);
+		
+		assertEquals(1, componentInstances.size());
+		ComponentInstance ci = componentInstances.get(0);
+		Map<String, ArtifactDefinition> instDepArtifacts = ci.getDeploymentArtifacts();
+		assertNotNull(instDepArtifacts);
+		ArtifactDefinition instArtifactHeat = instDepArtifacts.get("heat0");
+		assertNotNull(instArtifactHeat);
+
+		ArtifactDefinition instArtifactHeatEnv = instDepArtifacts.get("heat0env");
+		assertNotNull(instArtifactHeatEnv);
+		assertEquals(artifactHeat.getUniqueId(), instArtifactHeatEnv.getGeneratedFromId());
+		assertEquals("HEAT ENV", instArtifactHeatEnv.getArtifactDisplayName());
+		assertEquals("HEAT_ENV", instArtifactHeatEnv.getArtifactType());
+
+		assertEquals(artifactHeat.getUniqueId(), instArtifactHeat.getUniqueId());
+		//different artifacts
+		assertTrue( !artifactHeatEnv.getUniqueId().equals(instArtifactHeat.getUniqueId()) );
+	
+
+	}
+	
+	@Test(enabled = true)
+	public void createAndUpdateCsarCheckVfHeatEnv() throws Exception {
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setCsarUUID("orig2G_org");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+	
+		Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
+		assertNotNull(deploymentArtifacts);
+		
+		assertEquals(13, deploymentArtifacts.size());
+
+		ArtifactDefinition artifactHeat = deploymentArtifacts.get("heat0");
+		assertNotNull(artifactHeat);
+
+		ArtifactDefinition artifactHeatEnv = deploymentArtifacts.get("heat0env");
+		assertNotNull(artifactHeatEnv);
+
+		assertEquals(artifactHeat.getUniqueId(), artifactHeatEnv.getGeneratedFromId());
+		assertEquals("VF HEAT ENV", artifactHeatEnv.getArtifactDisplayName());
+		assertEquals("HEAT_ENV", artifactHeatEnv.getArtifactType());
+		assertEquals("VF Auto-generated HEAT Environment deployment artifact", artifactHeatEnv.getDescription());
+		
+		List<GroupDefinition>  groups = resource.getGroups();
+		assertEquals(2, groups.size());
+		GroupDefinition group1 = groups.stream().filter(p -> p.getName().contains("module-0")).findAny().get();
+		GroupDefinition group2 = groups.stream().filter(p -> p.getName().contains("module-1")).findAny().get();
+		assertEquals(11, group1.getArtifacts().size());
+		assertEquals(3, group2.getArtifacts().size());
+		
+		resourceDetails.setCsarUUID("orig2G_update");
+		
+		RestResponse updateResource = ResourceRestUtils.updateResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+
+		
+		Map<String, ArtifactDefinition> deploymentArtifactsUpd = resource.getDeploymentArtifacts();
+		assertNotNull(deploymentArtifactsUpd);
+		
+		assertEquals(13, deploymentArtifactsUpd.size());
+
+		ArtifactDefinition artifactHeatUpd = deploymentArtifacts.get("heat0");
+		assertNotNull(artifactHeatUpd);
+
+		ArtifactDefinition artifactHeatEnvUpd = deploymentArtifacts.get("heat0env");
+		assertNotNull(artifactHeatEnvUpd);
+		
+		groups = resource.getGroups();
+		assertEquals(2, groups.size());
+		assertEquals(7, groups.get(0).getArtifacts().size());
+		assertEquals(7, groups.get(1).getArtifacts().size());
+	
+
+	}
+	
+	@Test
+	public void importInnerVfcWithArtifactsSucceed() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String rootPath = System.getProperty("user.dir");
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		
+		String payloadName = "ImportArtifactsToVFC.csar";
+		Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/ImportArtifactsToVFC.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		
+		List<ComponentInstance> componentInstances = resource.getComponentInstances();
+		List<ComponentInstance> reducedComponentInstances = componentInstances.stream()
+				.filter(ci->ci.getNormalizedName().contains("server_sm"))
+				.collect(Collectors.toList());
+		assertTrue(!reducedComponentInstances.isEmpty() && reducedComponentInstances.size() == 2);
+		reducedComponentInstances.stream().forEach(ci->isValidArtifacts(ci));
+		
+		payloadName = "ImportArtifactsToVFC_empty.csar";
+		path = Paths.get(rootPath + "/src/test/resources/CI/csars/ImportArtifactsToVFC_empty.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setName(resourceDetails.getName()+"2");
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		
+		componentInstances = resource.getComponentInstances();
+		reducedComponentInstances = componentInstances.stream()
+				.filter(ci->ci.getNormalizedName().contains("server_sm"))
+				.collect(Collectors.toList());
+		assertTrue(!reducedComponentInstances.isEmpty() && reducedComponentInstances.size() == 2);
+		reducedComponentInstances.stream()
+		.forEach(ci->assertTrue(
+				(ci.getDeploymentArtifacts()==null || ci.getDeploymentArtifacts().isEmpty()) &&
+				(ci.getArtifacts()==null || ci.getArtifacts().isEmpty()))
+				);
+	}
+	
+	private void isValidArtifacts(ComponentInstance ci) {
+		assertTrue(!ci.getDeploymentArtifacts().isEmpty() && ci.getDeploymentArtifacts().size() == 11);
+		ci.getDeploymentArtifacts().values().stream()
+						 .forEach(a->assertTrue(a.getArtifactName().startsWith("Some")));
+		
+		assertTrue(!ci.getArtifacts().isEmpty() && ci.getArtifacts().size() == 1);
+		ci.getArtifacts().values().stream()
+						 .forEach(a->assertTrue(a.getArtifactName().startsWith("Process")));
+	}
+
+	private void verifyMembers(Map<String, String> createdMembers, Map<String, String> compNameToUniqueId) {
+		for (Map.Entry<String, String> entry : createdMembers.entrySet()) {
+			String key = entry.getKey();
+			String value = entry.getValue();
+			String comparedValue = compNameToUniqueId.get(key);
+
+			assertEquals("compare instance ids", comparedValue, value);
+		}
+
+	}
+
+	private static Map<String, String> prepareHeadersMap(String userId) {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+		return headersMap;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java
new file mode 100644
index 0000000..110fa0f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java
@@ -0,0 +1,600 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.http.HttpStatus;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
+import org.apache.http.entity.mime.content.StringBody;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ImportTestTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.RespJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.TODO.ImportCapabilityTypeCITest;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
+public class ImportGenericResourceCITest extends ComponentBaseTest {
+	private static Logger log = LoggerFactory.getLogger(ImportGenericResourceCITest.class.getName());
+	private static final String FILE_NAME_MY_COMPUTE = "tosca.nodes.MyCompute";
+	private static final String RESOURCE_NAME_UPDATE_COMPUTE = "userUpdateCompute";
+	private static final String RESOURCE_NAME_MY_COMPUTE = "myCompute";
+	private static final String RESOURCE_NAME_USER_COMPUTE = "userCompute";
+	private static final String FILE_NAME_USER_COMPUTE = "tosca.nodes.userCompute";
+	@Rule
+	public static TestName name = new TestName();
+
+	public ImportGenericResourceCITest() {
+		super(name, ImportGenericResourceCITest.class.getName());
+	}
+
+	@BeforeClass
+	public static void beforeImportClass() throws IOException {
+		ImportCapabilityTypeCITest.importAllCapabilityTypes();
+		// removeAllNormativeTypeResources();
+		// importAllNormativeTypesResources(UserRoleEnum.ADMIN);
+	}
+
+	static Config config = Config.instance();
+
+	public static Map<NormativeTypesEnum, Boolean> removeAllNormativeTypeResources() throws ClientProtocolException, IOException {
+		Map<NormativeTypesEnum, Boolean> normativeExistInDB = new HashMap<>();
+
+		for (NormativeTypesEnum current : NormativeTypesEnum.values()) {
+			Boolean existedBeforeDelete = ImportRestUtils.removeNormativeTypeResource(current);
+			normativeExistInDB.put(current, existedBeforeDelete);
+		}
+		return normativeExistInDB;
+	}
+
+	public static Either<String, Boolean> getNormativeTypeResource(NormativeTypesEnum current) throws ClientProtocolException, IOException {
+		return getResource(current.getNormativeName(), "1.0");
+	}
+
+	@Test
+	public void importAllTestResources() throws Exception {
+		for (ImportTestTypesEnum currResource : ImportTestTypesEnum.values()) {
+			DbUtils.cleanAllAudits();
+
+			RestResponse importResponse = ImportRestUtils.importTestResource(currResource, UserRoleEnum.ADMIN);
+			// System.err.println("import Resource
+			// "+"<"+currResource+">"+"response:
+			// "+importResponse.getErrorCode());
+			ImportRestUtils.validateImportTestTypesResp(currResource, importResponse);
+			if (currResource.getvalidateAudit() == true) {
+				// validate audit
+				String baseVersion = "1.0";
+				ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(currResource.getActionStatus().name());
+				ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+				String auditAction = "ResourceImport";
+				expectedResourceAuditJavaObject.setAction(auditAction);
+				expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.ADMIN.getUserId());
+				expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.ADMIN.getUserName());
+				expectedResourceAuditJavaObject.setResourceName(currResource.getNormativeName());
+				expectedResourceAuditJavaObject.setResourceType("Resource");
+				expectedResourceAuditJavaObject.setPrevVersion("");
+				expectedResourceAuditJavaObject.setCurrVersion(baseVersion);
+				expectedResourceAuditJavaObject.setPrevState("");
+				expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.toString());
+				expectedResourceAuditJavaObject.setComment(null);
+				expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+				List<String> variables = (currResource.getErrorParams() != null ? currResource.getErrorParams() : new ArrayList<String>());
+				String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+				expectedResourceAuditJavaObject.setDesc(auditDesc);
+				AuditValidationUtils.validateAuditImport(expectedResourceAuditJavaObject, auditAction);
+			}
+		}
+	}
+
+	// -----------------------------------------------------------------------------------
+	protected void validateMyComputeCapabilities(Map<String, Object> map) {
+		assertTrue(map.containsKey("capabilities"));
+		Map<String, Object> capabilities = (Map<String, Object>) map.get("capabilities");
+		assertTrue(capabilities.containsKey("tosca.capabilities.Container"));
+		List<Object> hostCapList = (List<Object>) capabilities.get("tosca.capabilities.Container");
+		assertFalse(hostCapList.isEmpty());
+		Map<String, Object> hostCap = (Map<String, Object>) hostCapList.get(0);
+		validateField(hostCap, "type", "tosca.capabilities.Container");
+		validateField(hostCap, "name", "host");
+		validateField(hostCap, "validSourceTypes", Arrays.asList(new String[] { "tosca.nodes.SoftwareComponent" }));
+
+		assertTrue(capabilities.containsKey("tosca.capabilities.Endpoint.Admin"));
+		List<Object> endPointCapList = (List<Object>) capabilities.get("tosca.capabilities.Endpoint.Admin");
+		assertFalse(endPointCapList.isEmpty());
+		Map<String, Object> endPointCap = (Map<String, Object>) endPointCapList.get(0);
+		validateField(endPointCap, "name", "endpoint");
+		validateField(endPointCap, "type", "tosca.capabilities.Endpoint.Admin");
+
+		assertTrue(capabilities.containsKey("tosca.capabilities.OperatingSystem"));
+		List<Object> osCapList = (List<Object>) capabilities.get("tosca.capabilities.OperatingSystem");
+		assertFalse(osCapList.isEmpty());
+		Map<String, Object> osCap = (Map<String, Object>) osCapList.get(0);
+		validateField(osCap, "name", "os");
+		validateField(osCap, "type", "tosca.capabilities.OperatingSystem");
+
+		assertTrue(capabilities.containsKey("tosca.capabilities.Scalable"));
+		List<Object> scalableCapList = (List<Object>) capabilities.get("tosca.capabilities.Scalable");
+		assertFalse(scalableCapList.isEmpty());
+		Map<String, Object> scalableCap = (Map<String, Object>) scalableCapList.get(0);
+		validateField(scalableCap, "name", "scalable");
+		validateField(scalableCap, "type", "tosca.capabilities.Scalable");
+
+		assertTrue(capabilities.containsKey("tosca.capabilities.network.Bindable"));
+		List<Object> bindingCapList = (List<Object>) capabilities.get("tosca.capabilities.network.Bindable");
+		assertFalse(bindingCapList.isEmpty());
+		Map<String, Object> bindingCap = (Map<String, Object>) bindingCapList.get(0);
+		validateField(bindingCap, "name", "binding");
+		validateField(bindingCap, "type", "tosca.capabilities.network.Bindable");
+
+	}
+
+	protected void validateMyComputeResource(String resourceName, String resourceVersion, String expectedState) throws ClientProtocolException, IOException {
+		Either<String, Boolean> eitherMyCompute = getResource(resourceName, resourceVersion);
+		assertTrue(eitherMyCompute.isLeft());
+		String testComputeYml = eitherMyCompute.left().value();
+
+		Map<String, Object> map = new HashMap<String, Object>();
+		map = (Map<String, Object>) new Gson().fromJson(testComputeYml, map.getClass());
+
+		validateMyComputeBasicFields(map, resourceName, resourceVersion, expectedState);
+
+		validateMyComputeCapabilities(map);
+
+		validateMyComputeRequirements(map);
+		validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceVersion);
+
+	}
+
+	protected void validateMyComputeResource(String uid, String resourceName, String resourceVersion, String expectedState) throws ClientProtocolException, IOException {
+		RestResponse resourceResponse = ResourceRestUtils.getResource(uid);
+		ResourceRestUtils.checkSuccess(resourceResponse);
+		String testComputeYml = resourceResponse.getResponse();
+
+		// Either<String, Boolean> eitherMyCompute = getResource(resourceName,
+		// resourceVersion);
+		// assertTrue( eitherMyCompute.isLeft() );
+		// String testComputeYml = eitherMyCompute.left().value();
+
+		Map<String, Object> map = new HashMap<String, Object>();
+		map = (Map<String, Object>) new Gson().fromJson(testComputeYml, map.getClass());
+
+		validateMyComputeBasicFields(map, resourceName, resourceVersion, expectedState);
+
+		validateMyComputeCapabilities(map);
+
+		validateMyComputeRequirements(map);
+		validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceVersion);
+
+	}
+
+	protected void validateMyComputeResourceAfterUpdate(String uid, String resourceName, String resourceVersion, String expectedState) throws ClientProtocolException, IOException {
+		RestResponse resourceResponse = ResourceRestUtils.getResource(uid);
+		ResourceRestUtils.checkSuccess(resourceResponse);
+		String testComputeYml = resourceResponse.getResponse();
+
+		// Either<String, Boolean> eitherMyCompute = getResource(resourceName,
+		// resourceVersion);
+		// assertTrue( eitherMyCompute.isLeft() );
+
+		// String testComputeYml = eitherMyCompute.left().value();
+
+		Map<String, Object> map = new HashMap<String, Object>();
+		map = (Map<String, Object>) new Gson().fromJson(testComputeYml, map.getClass());
+
+		validateMyComputeBasicFields(map, resourceName, resourceVersion, expectedState);
+		validateField(map, RespJsonKeysEnum.DESCRIPTION.getRespJsonKeyName(), "Short description");
+		validateField(map, RespJsonKeysEnum.VENDOR_NAME.getRespJsonKeyName(), "UserVendor");
+		validateField(map, RespJsonKeysEnum.VENDOR_RELEASE.getRespJsonKeyName(), "1.1.2");
+
+		// validateMyComputeCapabilities(map);
+		// AssertJUnit.assertTrue(map.containsKey("capabilities"));
+		// Map<String, Object> capabilities = (Map<String, Object>)
+		// map.get("capabilities");
+		// AssertJUnit.assertTrue(capabilities.containsKey("host"));
+		// Map<String, Object> hostCap = (Map<String, Object>)
+		// capabilities.get("host");
+		// validateField(hostCap, "type", "tosca.capabilities.Container");
+		// validateField(hostCap, "validSourceTypes", Arrays.asList(new
+		// String[]{"tosca.nodes.SoftwareComponent"}));
+		//
+		// AssertJUnit.assertTrue(capabilities.containsKey("endpoint"));
+		// Map<String, Object> endPointCap = (Map<String, Object>)
+		// capabilities.get("endpoint");
+		// validateField(endPointCap, "type",
+		// "tosca.capabilities.Endpoint.Admin");
+
+		assertTrue(map.containsKey("capabilities"));
+		Map<String, Object> capabilities = (Map<String, Object>) map.get("capabilities");
+		assertTrue(capabilities.containsKey("tosca.capabilities.Container"));
+		List<Object> hostCapList = (List<Object>) capabilities.get("tosca.capabilities.Container");
+		assertFalse(hostCapList.isEmpty());
+		Map<String, Object> hostCap = (Map<String, Object>) hostCapList.get(0);
+		validateField(hostCap, "type", "tosca.capabilities.Container");
+		validateField(hostCap, "name", "host");
+		validateField(hostCap, "validSourceTypes", Arrays.asList(new String[] { "tosca.nodes.SoftwareComponent" }));
+
+		assertTrue(capabilities.containsKey("tosca.capabilities.Endpoint.Admin"));
+		List<Object> endPointCapList = (List<Object>) capabilities.get("tosca.capabilities.Endpoint.Admin");
+		assertFalse(endPointCapList.isEmpty());
+		Map<String, Object> endPointCap = (Map<String, Object>) endPointCapList.get(0);
+		validateField(endPointCap, "name", "endpoint");
+		validateField(endPointCap, "type", "tosca.capabilities.Endpoint.Admin");
+
+		validateMyComputeRequirements(map);
+		validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceVersion);
+
+	}
+
+	protected void validateMyComputeRequirements(Map<String, Object> map) {
+		assertTrue(map.containsKey("requirements"));
+		Map<String, Object> requirements = (Map<String, Object>) map.get("requirements");
+
+		assertTrue(requirements.containsKey("tosca.capabilities.Attachment"));
+		List<Object> localStorageReqList = (List<Object>) requirements.get("tosca.capabilities.Attachment");
+		assertFalse(localStorageReqList.isEmpty());
+		Map<String, Object> localStorageReq = (Map<String, Object>) localStorageReqList.get(0);
+		validateField(localStorageReq, "capability", "tosca.capabilities.Attachment");
+		validateField(localStorageReq, "node", "tosca.nodes.BlockStorage");
+		validateField(localStorageReq, "relationship", "tosca.relationships.AttachesTo");
+		validateField(localStorageReq, "name", "local_storage");
+	}
+
+	protected void validateMyComputeBasicFields(Map<String, Object> map, String resourceName, String resourceVersion, String expectedState) {
+		validateField(map, RespJsonKeysEnum.IS_ABSTRACT.getRespJsonKeyName(), false);
+		// validateField(map, RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName(),
+		// categoryDefinition);
+		// validateField(map, RespJsonKeysEnum.UNIQUE_ID.getRespJsonKeyName(),
+		// UniqueIdBuilder.buildResourceUniqueId(resourceName,
+		// resourceVersion));
+		validateField(map, RespJsonKeysEnum.RESOURCE_NAME.getRespJsonKeyName(), resourceName);
+		validateField(map, RespJsonKeysEnum.TAGS.getRespJsonKeyName(), Arrays.asList(new String[] { resourceName }));
+		validateField(map, RespJsonKeysEnum.LIFE_CYCLE_STATE.getRespJsonKeyName(), expectedState);
+
+		validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(), Arrays.asList(new String[] { "tosca.nodes.Root" }));
+	}
+
+	protected static void validateField(Map<String, Object> map, String jsonField, Object expectedValue) {
+		if (expectedValue == null) {
+			assertTrue(!map.containsKey(jsonField));
+		} else {
+			assertTrue("map does not contain field " + jsonField, map.containsKey(jsonField));
+			Object foundValue = map.get(jsonField);
+			compareElements(expectedValue, foundValue);
+		}
+	}
+
+	protected static void compareElements(Object expectedValue, Object foundValue) {
+		if (expectedValue instanceof String) {
+			assertTrue(foundValue instanceof String);
+			assertTrue(foundValue.equals(expectedValue));
+		}
+
+		else if (expectedValue instanceof Boolean) {
+			assertTrue(foundValue instanceof Boolean);
+			assertTrue(foundValue == expectedValue);
+		} else if (expectedValue instanceof Map) {
+			assertTrue(foundValue instanceof Map);
+			Map<String, Object> foundMap = (Map<String, Object>) foundValue;
+			Map<String, Object> excpectedMap = (Map<String, Object>) expectedValue;
+			assertTrue(foundMap.size() == excpectedMap.size());
+			Iterator<String> foundkeyItr = foundMap.keySet().iterator();
+			while (foundkeyItr.hasNext()) {
+				String foundKey = foundkeyItr.next();
+				assertTrue(excpectedMap.containsKey(foundKey));
+				compareElements(excpectedMap.get(foundKey), foundMap.get(foundKey));
+			}
+
+		} else if (expectedValue instanceof List) {
+			assertTrue(foundValue instanceof List);
+			List<Object> foundList = (List<Object>) foundValue;
+			List<Object> excpectedList = (List<Object>) expectedValue;
+			assertTrue(foundList.size() == excpectedList.size());
+			for (int i = 0; i < foundList.size(); i++) {
+				compareElements(excpectedList.get(i), foundList.get(i));
+			}
+
+		} else if (expectedValue instanceof CategoryDefinition) {
+			assertTrue(foundValue instanceof Map);
+			CategoryDefinition expCat = (CategoryDefinition) expectedValue;
+			Map<String, Object> actCat = (Map<String, Object>) foundValue;
+			assertEquals(expCat.getName(), actCat.get("name"));
+
+			// assertEquals(expCat.getSubcategories().get(0).getName(),
+			// actCat.get("subcategories").getName());
+		} else {
+			assertTrue(foundValue.equals(expectedValue));
+		}
+	}
+
+	public static void restoreToOriginalState(Map<NormativeTypesEnum, Boolean> originalState, UserRoleEnum userRole) throws IOException {
+		removeAllNormativeTypeResources();
+
+		Iterator<Entry<NormativeTypesEnum, Boolean>> iterator = originalState.entrySet().iterator();
+		while (iterator.hasNext()) {
+			Entry<NormativeTypesEnum, Boolean> entry = iterator.next();
+			Boolean isExistBeforeDelete = entry.getValue();
+			if (isExistBeforeDelete) {
+				importNormativeResource(entry.getKey(), userRole);
+			}
+		}
+
+	}
+
+	public static void importAllNormativeTypesResources(UserRoleEnum userRole) throws IOException {
+		for (NormativeTypesEnum currResource : NormativeTypesEnum.values()) {
+			Either<String, Boolean> resource = getResource(currResource.getNormativeName(), "1.0");
+			if (resource.isRight()) {
+				importNormativeResource(currResource, userRole);
+			}
+		}
+
+	}
+
+	protected static Integer importNormativeResource(NormativeTypesEnum resource, UserRoleEnum userRole) throws IOException {
+		return importResource(resource.getFolderName(), userRole, true);
+	}
+
+	protected static Integer importResource(String folderName, UserRoleEnum userRole, boolean isNormative) throws IOException {
+		Config config = Utils.getConfig();
+		CloseableHttpResponse response = null;
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("resourceZip", new FileBody(getZipFile(folderName)));
+		mpBuilder.addPart("resourceMetadata", new StringBody(getJsonStringOfFile(folderName, folderName + ".json"), ContentType.APPLICATION_JSON));
+
+		String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(), config.getCatalogBePort());
+		if (!isNormative) {
+			url = String.format(Urls.IMPORT_USER_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+		}
+
+		CloseableHttpClient client = HttpClients.createDefault();
+		try {
+			HttpPost httpPost = new HttpPost(url);
+			httpPost.addHeader("USER_ID", userRole.getUserId());
+			httpPost.setEntity(mpBuilder.build());
+			response = client.execute(httpPost);
+			return response.getStatusLine().getStatusCode();
+		} finally {
+			closeResponse(response);
+			closeHttpClient(client);
+
+		}
+	}
+
+	public static void closeHttpClient(CloseableHttpClient client) {
+		try {
+			if (client != null) {
+				client.close();
+			}
+		} catch (IOException e) {
+			log.debug("failed to close client or response: ", e);
+		}
+	}
+
+	public static void closeResponse(CloseableHttpResponse response) {
+		try {
+			if (response != null) {
+				response.close();
+			}
+		} catch (IOException e) {
+			log.debug("failed to close client or response: ", e);
+		}
+	}
+
+	protected static String getJsonStringOfFile(String folderName, String fileName) throws IOException {
+		String sourceDir = config.getImportResourceConfigDir();
+		sourceDir += File.separator + "normative-types";
+
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + folderName, fileName);
+		byte[] fileContent = Files.readAllBytes(filePath);
+		String content = new String(fileContent);
+		return content;
+	}
+
+	protected static File getZipFile(String elementName) throws IOException {
+		String sourceDir = config.getImportResourceConfigDir();
+		sourceDir += File.separator + "normative-types";
+
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName, "normative-types-new-" + elementName + ".zip");
+		return filePath.toFile();
+	}
+
+	protected static String getTestJsonStringOfFile(String folderName, String fileName) throws IOException {
+		String sourceDir = config.getImportResourceTestsConfigDir();
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + folderName, fileName);
+		byte[] fileContent = Files.readAllBytes(filePath);
+		String content = new String(fileContent);
+		return content;
+	}
+
+	protected static File getTestZipFile(String elementName) throws IOException {
+		String sourceDir = config.getImportResourceTestsConfigDir();
+
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName, "normative-types-new-" + elementName + ".zip");
+		return filePath.toFile();
+	}
+
+	protected static Either<String, Boolean> getResource(String name, String version) throws IOException {
+		RestResponse resource = ResourceRestUtils.getResourceByNameAndVersion(UserRoleEnum.DESIGNER.getUserId(), name, version);
+		if (resource.getErrorCode() == ImportRestUtils.STATUS_CODE_GET_SUCCESS) {
+			return Either.left(resource.getResponse());
+			// return Either.right(true);
+
+		}
+		return Either.right(false);
+	}
+
+	@Test
+	public void testImportWithRequirmentsAndCapabilities() throws IOException {
+		String fileName = FILE_NAME_MY_COMPUTE;
+		RestResponse response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.ADMIN);
+		Integer statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
+		String uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "1.0", "CERTIFIED");
+	}
+
+	@Test
+	public void testImportWithUpdateNormativeType() throws IOException {
+		String fileName = FILE_NAME_MY_COMPUTE;
+		RestResponse response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.ADMIN);
+		Integer statusCode = response.getErrorCode();
+		assertTrue(statusCode == BaseRestUtils.STATUS_CODE_IMPORT_SUCCESS);
+		String uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "1.0", "CERTIFIED");
+
+		// update
+		response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.ADMIN);
+		statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS);
+		uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "2.0", "CERTIFIED");
+
+	}
+
+	@Test
+	public void testImportWithInvalidDefaultValue() throws IOException {
+		RestResponse response = ImportRestUtils.importNewResourceByName("portInvalidDefaultValue", UserRoleEnum.DESIGNER);
+		assertTrue(response.getErrorCode() == HttpStatus.SC_BAD_REQUEST);
+	}
+
+	@Test
+	public void testImportUserResource() throws IOException {
+		String fileName = FILE_NAME_USER_COMPUTE;
+		RestResponse response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
+		Integer statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
+		String uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
+
+	}
+
+	@Test
+	public void testImportAndUpdateUserResource() throws IOException {
+		String fileName = FILE_NAME_USER_COMPUTE;
+		RestResponse response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
+		Integer statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
+		String uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
+		response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_UPDATE_COMPUTE, UserRoleEnum.DESIGNER);
+		statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS);
+		uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResourceAfterUpdate(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
+
+	}
+
+	@Test
+	public void testImportAndUpdateChangesUserResource() throws IOException {
+		String fileName = FILE_NAME_USER_COMPUTE;
+		RestResponse response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
+		Integer statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
+		String uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
+		// Either<String, Boolean> resource = getResource(fileName, "0.1");
+		// assertTrue(resource.isLeft());
+
+		response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_UPDATE_COMPUTE, UserRoleEnum.DESIGNER);
+		statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS);
+		validateMyComputeResourceAfterUpdate(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
+
+	}
+
+	@Test
+	public void testImportCheckoutAndUpdateUserResource() throws IOException {
+		String fileName = FILE_NAME_USER_COMPUTE;
+		RestResponse response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.ADMIN);
+		Integer statusCode = response.getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
+		String uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "1.0", "CERTIFIED");
+
+		response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
+		statusCode = response.getErrorCode();
+		assertEquals("check response code after update resource", ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS, statusCode.intValue());
+		uid = ResponseParser.getUniqueIdFromResponse(response);
+		validateMyComputeResource(uid, fileName, "1.1", "NOT_CERTIFIED_CHECKOUT");
+
+	}
+
+	@Test
+	public void importNormativeTypesTesterUserRole() throws Exception {
+		Integer statusCode = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.TESTER).getErrorCode();
+		assertTrue(statusCode == ImportRestUtils.RESTRICTED_OPERATION);
+	}
+
+	@Test
+	public void importNormativeTypesDesignerUserRole() throws Exception {
+		Integer statusCode = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.DESIGNER).getErrorCode();
+		assertTrue(statusCode == 409);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java
new file mode 100644
index 0000000..c069f98
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java
@@ -0,0 +1,1529 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.http.HttpStatus;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ImportTestTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.util.GeneralUtility;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class ImportNewResourceCITest extends ComponentBaseTest {
+
+	// public static UserUtils userUtils = new UserUtils();
+	// public ResourceUtils resourceUtils = new ResourceUtils();
+	// public AuditValidationUtils AuditValidationUtils = new
+	// AuditValidationUtils();
+	// protected ArtifactUtils artifactUtils = new ArtifactUtils();
+
+	protected String resourceVersion = null;
+	protected String auditAction = null;
+	public User sdncModifierDetails = new User();
+	protected String artifactName1 = "data_artifact1.sh";
+	protected String artifactName2 = "data_artifact2.sh";
+	protected String interfaze = "standard";
+	protected String interfaceArtifactName = "data_interface1.sh";
+
+	private String SPECIAL_CHARACTERS = "~!#@~$%^*()[];:'\"|\\/";
+
+	public ResourceReqDetails resourceDetails = new ResourceReqDetails();
+
+	public Gson gson = new Gson();
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ImportNewResourceCITest() {
+		super(name, ImportNewResourceCITest.class.getName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+
+		// init user
+		sdncModifierDetails.setUserId(UserRoleEnum.ADMIN.getUserId());
+		// init resource details
+		resourceDetails = ElementFactory.getDefaultResource("importResource4test", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, "jh0003");
+	}
+
+	@Test
+	public void importAllTestResources_toValidateNewAPI() throws Exception {
+
+		for (ImportTestTypesEnum currResource : ImportTestTypesEnum.values()) {
+			// clean audit
+			DbUtils.cleanAllAudits();
+
+			// import testResources trough newResource API
+			RestResponse importResponse = ImportRestUtils.importNewResourceByName(currResource.getFolderName(),
+					UserRoleEnum.ADMIN);
+			System.err.println("import Resource " + "<" + currResource.getFolderName() + ">" + "response: "
+					+ importResponse.getErrorCode());
+
+			// validate response
+			ImportRestUtils.validateImportTestTypesResp(currResource, importResponse);
+			if (currResource.getvalidateAudit() == true) {
+				// validate audit
+				// String baseVersion="0.1";
+				String baseVersion = "";
+				ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(currResource.getActionStatus().name());
+				ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+				String auditAction = "ResourceImport";
+				expectedResourceAuditJavaObject.setAction(auditAction);
+				expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.ADMIN.getUserId());
+				expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.ADMIN.getUserName());
+				expectedResourceAuditJavaObject.setResourceName(currResource.getNormativeName());
+				expectedResourceAuditJavaObject.setResourceType("Resource");
+				expectedResourceAuditJavaObject.setPrevVersion("");
+				expectedResourceAuditJavaObject.setCurrVersion(baseVersion);
+				expectedResourceAuditJavaObject.setPrevState("");
+				// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+				expectedResourceAuditJavaObject.setCurrState("");
+				expectedResourceAuditJavaObject.setComment(null);
+				expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+				List<String> variables = (currResource.getErrorParams() != null ? currResource.getErrorParams()
+						: new ArrayList<String>());
+				String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+				expectedResourceAuditJavaObject.setDesc(auditDesc);
+				AuditValidationUtils.validateAuditImport(expectedResourceAuditJavaObject, auditAction);
+			}
+		}
+	}
+
+	protected RestResponse importNewResource(UserRoleEnum userRoleEnum) throws Exception {
+
+		// init user
+		sdncModifierDetails.setUserId(userRoleEnum.getUserId());
+		// init resource details
+		resourceDetails = ElementFactory.getDefaultResource("importResource4test", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, "jh0003");
+		// clean ES DB
+		DbUtils.cleanAllAudits();
+		// import new resource (expected checkOut state)
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4test", userRoleEnum);
+		return importResponse;
+	}
+
+	@Test(enabled = false)
+	public void importUIResource() throws IOException {
+		String payload = "tosca_definitions_version: tosca_simple_yaml_1_0_0\r\n" + "node_types: \r\n"
+				+ "  org.openecomp.resource.importResource4test:\r\n" + "    derived_from: tosca.nodes.Root\r\n"
+				+ "    description: someDesc";
+
+		String encodedPayload = new String(Base64.encodeBase64(payload.getBytes()));
+
+		String json = "{\r\n" + "  \"resourceName\": \"importResource4test\",\r\n"
+				+ "  \"payloadName\": \"importResource4test.yml\",\r\n"
+				+ "  \"categories\": [{\"name\": \"Application L4+\",\"normalizedName\": \"application l4+\",\"uniqueId\": \"resourceNewCategory.application l4+\",\"subcategories\": [{\"name\": \"Web Server\"}]}],\r\n"
+				+ "  \"description\": \"ResourceDescription\",\r\n" + "  \"vendorName\": \"VendorName\",\r\n"
+				+ "  \"vendorRelease\": \"VendorRelease\",\r\n" + "  \"contactId\": \"AT1234\",\r\n"
+				+ "  \"icon\": \"router\",\r\n" + "  \"tags\": [\r\n" + "    \"importResource4test\"\r\n" + "  ],\r\n"
+				+ "  \"payloadData\": \"" + encodedPayload + "\"\r\n" + "}";
+
+		String md5 = GeneralUtility.calculateMD5ByString(json);
+
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put(Constants.MD5_HEADER, md5);
+		headers.put(Constants.USER_ID_HEADER, UserRoleEnum.ADMIN.getUserId());
+		headers.put(Constants.CONTENT_TYPE_HEADER, "application/json");
+
+		String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		HttpRequest httpUtil = new HttpRequest();
+		RestResponse httpSendPost = httpUtil.httpSendPost(url, json, headers);
+		Integer errorCode = httpSendPost.getErrorCode();
+		assertTrue(errorCode == HttpStatus.SC_CREATED);
+
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_suc() throws Exception {
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		// validate response
+
+		resourceVersion = "0.1";
+
+		// ResourceRespJavaObject resourceRespJavaObject =
+		// Convertor.constructFieldsForRespValidation(resourceDetails,
+		// resourceVersion);
+		// resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		// ResourceValidationUtils.validateResp(importResponse,
+		// resourceRespJavaObject);
+		//
+		// //validate get response
+		//
+		// RestResponse resourceGetResponse =
+		// ResourceRestUtils.getResource(sdncModifierDetails, resourceVersion);
+		// ResourceValidationUtils.validateResp(resourceGetResponse,
+		// resourceRespJavaObject);
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertNotNull(resourceFromImport);
+
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceRespJavaObject.getUniqueId());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// validate
+		ResourceValidationUtils.validateModelObjects(resourceFromImport, resourceFromGet);
+
+		// validate audit
+		resourceDetails.setVersion(resourceDetails.getVersion());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+
+		auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void importNewResource_byTester_failed() throws Exception {
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.TESTER);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 409, importResponse.getErrorCode().intValue());
+
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existInCheckout_updateVendorName_updateCategory() throws Exception {
+
+		// import new resource
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in other state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4testUpdateVendorNameAndCategory",
+				UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 200, importResponse.getErrorCode().intValue());
+
+		// validate response
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertNotNull(resourceFromImport);
+
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceRespJavaObject.getUniqueId());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// validate
+		ResourceValidationUtils.validateModelObjects(resourceFromImport, resourceFromGet);
+
+		// validate audit
+		resourceDetails.setVersion(resourceDetails.getVersion());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails);
+
+		auditAction = "ResourceImport";
+		resourceVersion = "0.1";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@Test
+	public void importNewResource_perfromByAdmin_ownedBy_diffrentUser() throws Exception {
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.DESIGNER);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CHECKOUT_STATE.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), importResponse.getErrorCode());
+
+		String[] split = resourceFromImport.getLastUpdaterFullName().split(" ");
+		String firstName = split[0];
+		String lastName = split[1];
+		List<String> variables = Arrays.asList(resourceFromImport.getName(), "resource", firstName, lastName,
+				resourceFromImport.getLastUpdaterUserId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_IN_CHECKOUT_STATE.name(), variables,
+				importResponse.getResponse());
+
+	}
+
+	@Test
+	public void importNewResource_perfromByDesigner_ownedBy_diffrentUser() throws Exception {
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		importResponse = importNewResource(UserRoleEnum.DESIGNER);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CHECKOUT_STATE.name());
+		assertEquals("Check response code after adding artifact", errorInfo.getCode(), importResponse.getErrorCode());
+
+		String[] split = resourceFromImport.getLastUpdaterFullName().split(" ");
+		String firstName = split[0];
+		String lastName = split[1];
+		List<String> variables = Arrays.asList(resourceFromImport.getName(), "resource", firstName, lastName,
+				resourceFromImport.getLastUpdaterUserId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_IN_CHECKOUT_STATE.name(), variables,
+				importResponse.getResponse());
+
+	}
+
+	@Test(enabled = false)
+	public void importNewResource_nameSpace_vf() throws Exception {
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4testVF",
+				UserRoleEnum.DESIGNER);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertTrue(resourceRespJavaObject.getResourceType().equals(ResourceTypeEnum.VF));
+
+	}
+
+	@Test
+	public void importNewResource_nameSpace_vfc() throws Exception {
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4testVFC",
+				UserRoleEnum.DESIGNER);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertTrue(resourceRespJavaObject.getResourceType().equals(ResourceTypeEnum.VFC));
+	}
+
+	@Test
+	public void importNewResource_nameSpace_vl() throws Exception {
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4testVL",
+				UserRoleEnum.DESIGNER);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertTrue(resourceRespJavaObject.getResourceType().equals(ResourceTypeEnum.VL));
+
+	}
+
+	@Test
+	public void importNewResource_nameSpace_cp() throws Exception {
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4testCP",
+				UserRoleEnum.DESIGNER);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertTrue(resourceRespJavaObject.getResourceType().equals(ResourceTypeEnum.CP));
+	}
+
+	@Test
+	public void importNewResource_nameSpace_unknown() throws Exception {
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4test",
+				UserRoleEnum.DESIGNER);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertTrue(resourceRespJavaObject.getResourceType().equals(ResourceTypeEnum.VFC));
+
+	}
+
+	@Test
+	public void importNewResource_MissingNameSpace() throws Exception {
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName("importResource4testMissingNameSpace",
+				UserRoleEnum.DESIGNER);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 400, importResponse.getErrorCode().intValue());
+
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existInCheckOut() throws Exception {
+
+		// import new resource
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in CHECKOUT state
+
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 200, importResponse.getErrorCode().intValue());
+
+		// validate response
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertNotNull(resourceFromImport);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceRespJavaObject.getUniqueId());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// validate
+		ResourceValidationUtils.validateModelObjects(resourceFromImport, resourceFromGet);
+
+		// validate audit
+		resourceDetails.setVersion(resourceDetails.getVersion());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails);
+
+		auditAction = "ResourceImport";
+		resourceVersion = "0.1";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existIn_CheckIn_state() throws Exception {
+
+		// import new resource
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		// checkIn resource
+
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in CHECKIN state
+
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 200, importResponse.getErrorCode().intValue());
+
+		// validate response
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertNotNull(resourceFromImport);
+
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceRespJavaObject.getUniqueId());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// validate
+		ResourceValidationUtils.validateModelObjects(resourceFromImport, resourceFromGet);
+
+		// validate audit
+		resourceDetails.setVersion(resourceDetails.getVersion());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails);
+
+		resourceVersion = "0.2";
+		auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@Test
+	public void importNewResource_existIn_Ready4cert_state_performByTester() throws Exception {
+		// import new resource
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		// add mandatory artifacts
+		// // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// checkIn resource
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(checkInResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(checkInResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in CHECKIN state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.TESTER);
+
+		// validate response
+		resourceVersion = resourceDetails.getVersion();
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		assertNotNull("check response object is not null after create resouce", importResponse);
+		assertNotNull("check error code exists in response after create resource", importResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), importResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				importResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+
+		String auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setResourceName("");
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.TESTER.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.TESTER.getUserName());
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existIn_Ready4cert_state_performByDesigner() throws Exception {
+		// import new resource
+
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		// add mandatory artifacts
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// checkIn resource
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in other state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.DESIGNER);
+
+		// validate response
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_SENT_FOR_CERTIFICATION.name());
+		assertNotNull("check response object is not null after create resouce", importResponse);
+		assertNotNull("check error code exists in response after create resource", importResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), importResponse.getErrorCode());
+		String[] split = resourceFromGet.getLastUpdaterFullName().split(" ");
+		String firstName = split[0];
+		String lastName = split[1];
+		List<String> variables = Arrays.asList(resourceFromGet.getName(), "resource", firstName, lastName,
+				resourceFromGet.getLastUpdaterUserId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SENT_FOR_CERTIFICATION.name(), variables,
+				importResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.DESIGNER.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.DESIGNER.getUserName());
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.READY_FOR_CERTIFICATION).toString());
+		// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existIn_Ready4cert_state_performByAdmin() throws Exception {
+
+		// import new resource
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// add mandatory artifacts
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// checkIn resource
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in other state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.ADMIN);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 200, importResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+		resourceVersion = resourceDetails.getVersion();
+		// resourceVersion="0.2";
+
+		// validate response
+		Resource resourceFromImport = ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+		assertNotNull(resourceFromImport);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+
+		// validate get response
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceRespJavaObject.getUniqueId());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// validate
+		ResourceValidationUtils.validateModelObjects(resourceFromImport, resourceFromGet);
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@Test
+	public void importNewResource_existIn_CerInProgress_state_performByTester() throws Exception {
+
+		// import new resource
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// add mandatory artifacts
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// checkIn resource
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// startCert
+		RestResponse startCert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertNotNull("check response object is not null after resource request start certification", startCert);
+		assertEquals("Check response code after checkout resource", 200, startCert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(startCert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(startCert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in other state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.TESTER);
+
+		// validate response
+		resourceVersion = resourceDetails.getVersion();
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		assertNotNull("check response object is not null after create resouce", importResponse);
+		assertNotNull("check error code exists in response after create resource", importResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), importResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				importResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setResourceName("");
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.TESTER.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.TESTER.getUserName());
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existIn_CerInProgress_state_performByDesigner() throws Exception {
+
+		User sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// import new resource
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// add mandatory artifacts
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// checkIn resource
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// startCert
+		RestResponse startCert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertNotNull("check response object is not null after resource request start certification", startCert);
+		assertEquals("Check response code after checkout resource", 200, startCert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(startCert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(startCert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+		resourceVersion = resourceDetails.getVersion();
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in other state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.DESIGNER);
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
+		assertNotNull("check response object is not null after create resouce", importResponse);
+		assertNotNull("check error code exists in response after create resource", importResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), importResponse.getErrorCode());
+		List<String> variables = Arrays.asList(resourceDetails.getName(), "resource", sdncAdminUser.getFirstName(),
+				sdncAdminUser.getLastName(), sdncAdminUser.getUserId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name(),
+				variables, importResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.DESIGNER.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.DESIGNER.getUserName());
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.CERTIFICATION_IN_PROGRESS).toString());
+		// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	// TODO DE171337
+	@Test(enabled = false)
+	public void importNewResource_existIn_CerInProgress_state_performByAdmin() throws Exception {
+
+		User sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// import new resource
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+
+		// add mandatory artifacts
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// checkIn resource
+		resourceVersion = resourceDetails.getVersion();
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		// startCert
+		RestResponse startCert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertNotNull("check response object is not null after resource request start certification", startCert);
+		assertEquals("Check response code after checkout resource", 200, startCert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(startCert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(startCert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+		resourceVersion = resourceDetails.getVersion();
+
+		// clean audit
+		DbUtils.cleanAllAudits();
+
+		// import new resource while resource already exist in other state
+		importResponse = ImportRestUtils.importNewResourceByName("importResource4test", UserRoleEnum.ADMIN);
+
+		// validate response
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
+		assertNotNull("check response object is not null after create resouce", importResponse);
+		assertNotNull("check error code exists in response after create resource", importResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), importResponse.getErrorCode());
+		List<String> variables = Arrays.asList(resourceDetails.getName(), "resource", sdncAdminUser.getFirstName(),
+				sdncAdminUser.getLastName(), sdncAdminUser.getUserId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name(),
+				variables, importResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "ResourceImport";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.ADMIN.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.ADMIN.getUserName());
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.CERTIFICATION_IN_PROGRESS).toString());
+		// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	// TODO DE171337
+	// @Test(enabled = false)
+	// public void
+	// importNewResource_existIn_Certified_state_chnage_reqAndCap_byDesigner()
+	// throws Exception{
+	//
+	// // Andrey - set default artifact details
+	// ArtifactDefinition artifactDefinition =
+	// artifactUtils.constructDefaultArtifactInfo();
+	//
+	// // import new resource
+	// RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+	// assertNotNull("check response object is not null after import resource",
+	// importResponse);
+	// assertNotNull("check error code exists in response after import
+	// resource", importResponse.getErrorCode());
+	// assertEquals("Check response code after import resource", 201,
+	// importResponse.getErrorCode().intValue());
+	// String resourceId =
+	// ResponseParser.getUniqueIdFromResponse(importResponse);
+	// resourceDetails =
+	// ResponseParser.parseToObject(importResponse.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceVersion = resourceDetails.getVersion();
+	// RestResponse resourceGetResponse =
+	// ResourceRestUtils.getResource(sdncModifierDetails,
+	// resourceDetails.getUniqueId());
+	// assertEquals("Check response code after get resource", 200,
+	// resourceGetResponse.getErrorCode().intValue());
+	// Resource resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+	// assertNotNull(resourceFromGet);
+	//
+	// // add mandatory artifacts
+	// // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+	// resourceGetResponse);
+	// resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+	// resourceDetails.getUniqueId());
+	// assertEquals("Check response code after get resource", 200,
+	// resourceGetResponse.getErrorCode().intValue());
+	// resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+	// assertNotNull(resourceFromGet);
+	// resourceDetails =
+	// ResponseParser.parseToObject(importResponse.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceDetails.setVersion(resourceFromGet.getVersion());
+	//
+	// // add artifact
+	// artifactDefinition.setArtifactName(artifactName1);
+	// ArtifactRestUtils.addInformationalArtifactToResource(resourceDetails,
+	// sdncModifierDetails, resourceVersion , artifactDefinition);
+	//
+	// // add artifact
+	// artifactDefinition.setArtifactName(artifactName2);
+	// resourceUtils.add_artifact(resourceDetails, sdncModifierDetails,
+	// resourceVersion , artifactDefinition);
+	//
+	// // add interface
+	// artifactDefinition.setArtifactName(interfaceArtifactName);
+	// ResourceRestUtils.add_interface(resourceDetails, sdncModifierDetails,
+	// resourceVersion , artifactDefinition);
+	//
+	// //construct fields for validation
+	// resourceVersion="1.0";
+	//
+	// ResourceRespJavaObject resourceRespJavaObject =
+	// Convertor.constructFieldsForRespValidation(resourceDetails,
+	// resourceVersion);
+	// ArrayList<String> artifacts = new ArrayList<String>();
+	//
+	// artifacts.add(resourceId+":"+artifactName1);
+	// artifacts.add(resourceId+":"+artifactName2);
+	// resourceRespJavaObject.setArtifacts(artifacts);
+	// ArrayList<String> interfaces = new ArrayList<String>();
+	//
+	// interfaces.add(interfaze);
+	// resourceRespJavaObject.setInterfaces(interfaces);
+	//
+	// // checkIn resource
+	// resourceVersion = resourceDetails.getVersion();
+	// String checkinComment = "good checkin";
+	// String checkinComentJson = "{\"userRemarks\": \""+checkinComment+"\"}";
+	// RestResponse checkInResponse =
+	// LifecycleRestUtils.changeResourceState(resourceDetails,
+	// sdncModifierDetails, resourceVersion, LifeCycleStatesEnum.CHECKIN,
+	// checkinComentJson);
+	// assertNotNull("check response object is not null after import resource",
+	// checkInResponse);
+	// assertEquals("Check response code after checkout resource", 200,
+	// checkInResponse.getErrorCode().intValue());
+	//
+	// // req4cert resource
+	// RestResponse request4cert =
+	// LifecycleRestUtils.changeResourceState(resourceDetails,
+	// sdncModifierDetails, resourceVersion,
+	// LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+	// assertNotNull("check response object is not null after resource request
+	// for certification", request4cert);
+	// assertEquals("Check response code after checkout resource", 200,
+	// request4cert.getErrorCode().intValue());
+	// resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+	// assertNotNull(resourceFromGet);
+	// resourceDetails =
+	// ResponseParser.parseToObject(request4cert.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceDetails.setVersion(resourceFromGet.getVersion());
+	//
+	// // startCert
+	// RestResponse startCert =
+	// LifecycleRestUtils.changeResourceState(resourceDetails,
+	// sdncModifierDetails, resourceVersion,
+	// LifeCycleStatesEnum.STARTCERTIFICATION);
+	// assertNotNull("check response object is not null after resource request
+	// start certification", startCert);
+	// assertEquals("Check response code after checkout resource", 200,
+	// startCert.getErrorCode().intValue());
+	// resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(startCert.getResponse());
+	// assertNotNull(resourceFromGet);
+	// resourceDetails = ResponseParser.parseToObject(startCert.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceDetails.setVersion(resourceFromGet.getVersion());
+	//
+	// // certify
+	// RestResponse certify =
+	// LifecycleRestUtils.changeResourceState(resourceDetails,
+	// sdncModifierDetails, resourceVersion, LifeCycleStatesEnum.CERTIFY);
+	// assertNotNull("check response object is not null after resource request
+	// certify", certify);
+	// assertEquals("Check response code after certify resource", 200,
+	// certify.getErrorCode().intValue());
+	// resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(certify.getResponse());
+	// assertNotNull(resourceFromGet);
+	// resourceDetails = ResponseParser.parseToObject(certify.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceDetails.setVersion(resourceFromGet.getVersion());
+	//
+	// // clean audit
+	// DbUtils.cleanAllAudits();
+	//
+	// // change resource details
+	//
+	// // import new resource while resource already exist in other state
+	// importResponse =
+	// ImportRestUtils.importNewResourceByName("importResource4testUpdateWithoutReqCap",
+	// UserRoleEnum.ADMIN);
+	// assertNotNull("check response object is not null after import resource",
+	// importResponse);
+	// assertNotNull("check error code exists in response after import
+	// resource", importResponse.getErrorCode());
+	// assertEquals("Check response code after import resource", 200,
+	// importResponse.getErrorCode().intValue());
+	// resourceDetails =
+	// ResponseParser.parseToObject(importResponse.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceVersion = resourceDetails.getVersion();
+	// resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+	// resourceDetails.getUniqueId());
+	// assertEquals("Check response code after get resource", 200,
+	// resourceGetResponse.getErrorCode().intValue());
+	// resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+	// assertNotNull(resourceFromGet);
+	//
+	// // validate response
+	// Resource resourceFromImport =
+	// ResponseParser.convertResourceResponseToJavaObject(importResponse.getResponse());
+	// assertNotNull(resourceFromImport);
+	//
+	// resourceDetails =
+	// ResponseParser.parseToObject(importResponse.getResponse(),
+	// ResourceReqDetails.class);
+	// resourceRespJavaObject =
+	// Convertor.constructFieldsForRespValidation(resourceDetails);
+	// resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	//
+	// // validate get response
+	// resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+	// resourceRespJavaObject.getUniqueId());
+	// resourceFromGet =
+	// ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+	// assertNotNull(resourceFromGet);
+	//
+	// // validate
+	// ResourceValidationUtils.validateModelObjects(resourceFromImport,
+	// resourceFromGet);
+	//
+	// // validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// Convertor.constructFieldsForAuditValidation(resourceDetails,
+	// resourceVersion);
+	// auditAction="ResourceImport";
+	// expectedResourceAuditJavaObject.setAction(auditAction);
+	// expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setPrevVersion(resourceVersion);
+	// expectedResourceAuditJavaObject.setStatus("200");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// expectedResourceAuditJavaObject.setToscaNodeType(resourceFromGet.getToscaResourceName());
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	// }
+
+	@Test
+	public void importNewResource_uuidTest() throws Exception {
+		RestResponse importResponse = importNewResource(UserRoleEnum.ADMIN);
+
+		assertNotNull("check response object is not null after import resource", importResponse);
+		assertNotNull("check error code exists in response after import resource", importResponse.getErrorCode());
+		assertEquals("Check response code after import resource", 201, importResponse.getErrorCode().intValue());
+		String oldUuid = ResponseParser.getValueFromJsonResponse(importResponse.getResponse(), "uuid");
+
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceVersion = resourceDetails.getVersion();
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		Resource resourceFromGet = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		// add mandatory artifacts
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// resourceGetResponse);
+		resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceDetails.getUniqueId());
+		assertEquals("Check response code after get resource", 200, resourceGetResponse.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(importResponse.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				"0.1", LifeCycleStatesEnum.CHECKIN);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		String newUuid = ResponseParser.getValueFromJsonResponse(checkInResponse.getResponse(), "uuid");
+		assertTrue(ResourceValidationUtils.validateUuidAfterChangingStatus(oldUuid, newUuid));
+
+		// req4cert resource
+		RestResponse request4cert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertNotNull("check response object is not null after resource request for certification", request4cert);
+		assertEquals("Check response code after checkout resource", 200, request4cert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(request4cert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(request4cert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		String newUuid2 = ResponseParser.getValueFromJsonResponse(request4cert.getResponse(), "uuid");
+		assertTrue(ResourceValidationUtils.validateUuidAfterChangingStatus(oldUuid, newUuid2));
+
+		// startCert
+		RestResponse startCert = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertNotNull("check response object is not null after resource request start certification", startCert);
+		assertEquals("Check response code after checkout resource", 200, startCert.getErrorCode().intValue());
+		resourceFromGet = ResponseParser.convertResourceResponseToJavaObject(startCert.getResponse());
+		assertNotNull(resourceFromGet);
+		resourceDetails = ResponseParser.parseToObject(startCert.getResponse(), ResourceReqDetails.class);
+		resourceDetails.setVersion(resourceFromGet.getVersion());
+
+		String newUuid3 = ResponseParser.getValueFromJsonResponse(startCert.getResponse(), "uuid");
+		assertTrue(ResourceValidationUtils.validateUuidAfterChangingStatus(oldUuid, newUuid3));
+
+		RestResponse certify = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails, "0.1",
+				LifeCycleStatesEnum.CERTIFY);
+		assertNotNull("check response object is not null after import resource", certify);
+		assertEquals("Check response code after checkout resource", 200, certify.getErrorCode().intValue());
+
+		String newUuid4 = ResponseParser.getValueFromJsonResponse(certify.getResponse(), "uuid");
+		assertTrue(ResourceValidationUtils.validateUuidAfterChangingStatus(oldUuid, newUuid4));
+
+		RestResponse checkoutResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				"1.0", LifeCycleStatesEnum.CHECKOUT);
+		assertNotNull("check response object is not null after import resource", checkInResponse);
+		assertEquals("Check response code after checkout resource", 200, checkInResponse.getErrorCode().intValue());
+
+		String newUuid5 = ResponseParser.getValueFromJsonResponse(checkoutResponse.getResponse(), "uuid");
+		assertFalse(ResourceValidationUtils.validateUuidAfterChangingStatus(oldUuid, newUuid5));
+	}
+
+	@Test
+	public void importNewResource_propertiesMapInternalUrlCredential() throws Exception {
+		String folderName = "validateProporties_typeMap_valueUrlCredential";
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName(folderName, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(importResponse.getResponse(), Resource.class);
+
+		List<PropertyDefinition> properties = resource.getProperties();
+		assertEquals("check properties size", 3, properties.size());
+
+		PropertyDefinition propertyDefinition = properties.stream().filter(p -> p.getName().equals("validation_test"))
+				.findFirst().get();
+		String defaultValue = propertyDefinition.getDefaultValue();
+
+		Map mapValue = gson.fromJson(defaultValue, Map.class);
+		assertEquals("check Map value size", 2, mapValue.size());
+		checkMapValues(mapValue, "key", 1, null);
+		checkMapValues(mapValue, "key", 2, null);
+
+		System.err.println("import Resource " + "<" + folderName + ">" + "response: " + importResponse.getErrorCode());
+
+	}
+
+	@Test
+	public void importNewResource_propertiesListInternalUrlCredential() throws Exception {
+		String folderName = "validateProporties_typeList_valueUrlCredential";
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName(folderName, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(importResponse.getResponse(), Resource.class);
+
+		List<PropertyDefinition> properties = resource.getProperties();
+		assertEquals("check properties size", 3, properties.size());
+
+		PropertyDefinition propertyDefinition = properties.stream().filter(p -> p.getName().equals("validation_test"))
+				.findFirst().get();
+		String defaultValue = propertyDefinition.getDefaultValue();
+
+		List listValue = gson.fromJson(defaultValue, List.class);
+		assertEquals("check List value size", 2, listValue.size());
+		checkListValues(listValue.get(0), 1, SPECIAL_CHARACTERS);
+		checkListValues(listValue.get(1), 2, SPECIAL_CHARACTERS);
+
+		// Verify attributes
+		List<PropertyDefinition> attributes = resource.getAttributes();
+
+		assertEquals("check properties size", 2, attributes.size());
+
+		// Verify attribute from type map
+		PropertyDefinition attributeMapDefinition = attributes.stream()
+				.filter(p -> p.getName().equals("validation_test_map")).findFirst().get();
+		String defaultMapValue = attributeMapDefinition.getDefaultValue();
+		Map attributeMapValue = gson.fromJson(defaultMapValue, Map.class);
+		assertEquals("check Map value size", 2, attributeMapValue.size());
+		checkMapValues(attributeMapValue, "key", 1, SPECIAL_CHARACTERS);
+		checkMapValues(attributeMapValue, "key", 2, SPECIAL_CHARACTERS);
+
+		// Verify attribute from type list
+		PropertyDefinition attributeListDefinition = attributes.stream()
+				.filter(p -> p.getName().equals("validation_test_list")).findFirst().get();
+		String defaultListValue = attributeListDefinition.getDefaultValue();
+
+		List attributeListValue = gson.fromJson(defaultListValue, List.class);
+		assertEquals("check List value size", 2, attributeListValue.size());
+		checkListValues(attributeListValue.get(0), 1, SPECIAL_CHARACTERS);
+		checkListValues(attributeListValue.get(1), 2, SPECIAL_CHARACTERS);
+
+		System.err.println("import Resource " + "<" + folderName + ">" + "response: " + importResponse.getErrorCode());
+
+	}
+
+	private void checkListValues(Object object, int index, String suffix) {
+
+		Map map = (Map) object;
+		assertEquals("check Map protocol value", "protocol" + index + (suffix == null ? "" : suffix),
+				map.get("protocol"));
+		assertEquals("check Map token value", "token" + index, map.get("token"));
+	}
+
+	// @Test
+	public void importNewResource_validateProporties_typeTestDataType() throws Exception {
+		String folderName = "validateProporties_typeTestDataType";
+		RestResponse importResponse = ImportRestUtils.importNewResourceByName(folderName, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.parseToObjectUsingMapper(importResponse.getResponse(), Resource.class);
+
+	}
+
+	private void checkMapValues(Map mapValue, String key, int index, String suffix) {
+
+		Map map1 = (Map) mapValue.get(key + index);
+		assertEquals("check Map protocol value", "protocol" + index + (suffix == null ? "" : suffix),
+				map1.get("protocol"));
+		assertEquals("check Map token value", "token" + index, map1.get("token"));
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java
new file mode 100644
index 0000000..3d7c81a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java
@@ -0,0 +1,416 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+/**
+ * US US730518 Story [BE] - TOSCA capabilities with properties - import "As a
+ * resource designer, I would like to add my VFC capabilities with properties."
+ * 
+ * @author ns019t
+ *
+ */
+public class ImportToscaCapabilitiesWithProperties extends ComponentBaseTest {
+	@Rule
+	public static TestName name = new TestName();
+
+	Gson gson = new Gson();
+
+	/**
+	 * public Constructor ImportToscaCapabilitiesWithProperties
+	 */
+	public ImportToscaCapabilitiesWithProperties() {
+		super(name, ImportToscaCapabilitiesWithProperties.class.getName());
+	}
+
+	/**
+	 * String constants
+	 */
+	public static String propertyForTestName = "propertyfortest";
+	public static String rootPath = System.getProperty("user.dir");
+	public static String scalable = "tosca.capabilities.Scalable";
+	public static String container = "tosca.capabilities.Container";
+	public static String minInstances = "min_instances";
+	public static String userDefinedNodeYaml = "mycompute.yml";
+
+	/**
+	 * Capability Type - capability type on the graph should already have
+	 * properties modeled on it. please verify. The import of the capability
+	 * types should support adding those properties. when importing, validate
+	 * name uniqueness between the capability's properties see capability
+	 * tosca.capabilities.Container
+	 * 
+	 * Acceptance Criteria: validate capability type properties (for example,
+	 * compute have capability Container -> the properties of this capability
+	 * should be in the Json response)
+	 * 
+	 * @throws IOException
+	 */
+	@Test
+	public void validateCapabilityTypePropertiesSucceed() throws IOException {
+		User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse createResourceRes = ResourceRestUtils.getResourceByNameAndVersion(user.getUserId(), "Compute",
+				"1.0");
+		BaseRestUtils.checkSuccess(createResourceRes);
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResourceRes.getResponse());
+		Map<String, List<CapabilityDefinition>> capabilities = resource.getCapabilities();
+		assertEquals(capabilities.size(), 6);
+
+		CapabilityDefinition capability = capabilities.get(scalable).get(0);
+		List<ComponentInstanceProperty> properties = capability.getProperties();
+		assertEquals(properties.size(), 3);
+		assertTrue(!properties.stream().filter(p -> p.getName().equalsIgnoreCase(propertyForTestName)).findAny()
+				.isPresent());
+
+		ComponentInstanceProperty originalProperty = properties.stream()
+				.filter(p -> p.getName().equalsIgnoreCase(minInstances)).findAny().get();
+		assertEquals(originalProperty.getType(), "integer");
+		assertEquals(originalProperty.getDefaultValue(), "1");
+
+		capability = capabilities.get(container).get(0);
+		properties = capability.getProperties();
+		assertEquals(properties.size(), 4);
+	}
+
+	/**
+	 * Capability Definition on VFC / CP / VL - properties can also be defined
+	 * on the capability when the capability is declared. (property definition
+	 * with default value) If the property name (case insensitive) already
+	 * defined on the capability type, it overrides the capability from the
+	 * capability type Import of VFC / CP /VL should support adding properties
+	 * to the capability. when importing, validate name uniqueness between the
+	 * capability's properties
+	 * 
+	 * Acceptance Criteria: import node type with capability definition on it.
+	 * use the attached "myCompute"
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void importNodeTypeWithCapabilityWithPropertiesFromYmlSucceed() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		RestResponse createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails,
+				resourceDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		Map<String, List<CapabilityDefinition>> capabilities = resource.getCapabilities();
+		assertEquals(capabilities.size(), 6);
+
+		CapabilityDefinition capability = capabilities.get(scalable).get(0);
+		List<ComponentInstanceProperty> properties = capability.getProperties();
+		assertEquals(properties.size(), 4);
+
+		ComponentInstanceProperty newProperty = properties.stream()
+				.filter(p -> p.getName().equalsIgnoreCase(propertyForTestName)).findAny().get();
+		assertEquals(newProperty.getType(), "string");
+		assertEquals(newProperty.getDescription(), "test");
+		assertEquals(newProperty.getDefaultValue(), "success");
+
+		ComponentInstanceProperty overriddenProperty = properties.stream()
+				.filter(p -> p.getName().equalsIgnoreCase(minInstances)).collect(Collectors.toList()).get(0);
+		assertEquals(overriddenProperty.getType(), "integer");
+		assertEquals(overriddenProperty.getDefaultValue(), "3");
+
+	}
+
+	/**
+	 * importNodeTypeWithCapabilityWithPropertiesFromYmlFailed
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void importNodeTypeWithCapabilityWithPropertiesFromYmlFailed() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		RestResponse createResource = importUserDefinedNodeType("mycompute_failed.yml", sdncModifierDetails,
+				resourceDetails);
+		BaseRestUtils.checkErrorMessageResponse(createResource, ActionStatus.PROPERTY_NAME_ALREADY_EXISTS);
+	}
+
+	/**
+	 * Capability Assignment (on node_template / resource instance) - should
+	 * support assignment of the property (property value). On the resource
+	 * instance level, value can be assigned to either properties that are
+	 * defined on the capability type or on the capability definition. When
+	 * importing a VF - the node_template can have capability's property value.
+	 * It should be imported and saved on the graph Acceptance Criteria: import
+	 * a VF that assign values to property of capability that was defined on the
+	 * capability type
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesSucceed() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "vf_with_cap_prop_override_cap_type_prop.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		List<ImmutablePair<String, String>> propertyNamesValues = new ArrayList<>();
+		propertyNamesValues.add(new ImmutablePair<String, String>("num_cpus", "2"));
+		propertyNamesValues.add(new ImmutablePair<String, String>("mem_size", "2000 MB"));
+		checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
+
+		ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
+		resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop.csar");
+		resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
+	}
+
+	/**
+	 * importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesFailed
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesFailed() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String payloadName = "vf_with_cap_prop_override_cap_type_prop_failed.csar";
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		Path path = Paths
+				.get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop_failed.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkErrorMessageResponse(createResource, ActionStatus.INVALID_PROPERTY);
+
+		ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
+		resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop_failed.csar");
+		resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+		BaseRestUtils.checkErrorMessageResponse(createResource, ActionStatus.INVALID_PROPERTY);
+
+	}
+
+	/**
+	 * Capability Assignment (on node_template / resource instance) - should
+	 * support assignment of the property (property value). On the resource
+	 * instance level, value can be assigned to either properties that are
+	 * defined on the capability type or on the capability definition. When
+	 * importing a VF - the node_template can have capability's property value.
+	 * It should be imported and saved on the graph Acceptance Criteria: import
+	 * a VF that assign values to property of capability that was defined on the
+	 * capability definition (on the node type)
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void importResourceWithCapabilityWithPropertiesOverridingNodeTypeCapPropertiesSucceed() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		RestResponse createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails,
+				resourceDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource userDefinedNodeType = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
+				Resource.class);
+
+		String payloadName = "vf_with_cap_prop_override_cap_type_prop1.csar";
+		resourceDetails = ElementFactory.getDefaultImportResource();
+		Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop1.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		List<ImmutablePair<String, String>> propertyNamesValues = new ArrayList<>();
+		propertyNamesValues.add(new ImmutablePair<String, String>("num_cpus", "2"));
+		propertyNamesValues.add(new ImmutablePair<String, String>("mem_size", "2000 MB"));
+		checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
+
+		List<ImmutablePair<String, String>> propertyNamesValues1 = new ArrayList<>();
+		propertyNamesValues1.add(new ImmutablePair<String, String>(propertyForTestName, "success_again"));
+		propertyNamesValues1.add(new ImmutablePair<String, String>(minInstances, "4"));
+		checkResource(createResource, 8, scalable, userDefinedNodeType.getName(), propertyNamesValues1);
+
+		ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
+		resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop1.csar");
+		resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
+		checkResource(createResource, 8, scalable, userDefinedNodeType.getName(), propertyNamesValues1);
+
+	}
+
+	/**
+	 * importResourceWithCapabilityWithPropertiesOverridingNodeTypeCapPropertiesFailed
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	public void importResourceWithCapabilityWithPropertiesOverridingNodeTypeCapPropertiesFailed() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		RestResponse createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails,
+				resourceDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+
+		String payloadName = "vf_with_cap_prop_override_cap_type_prop1_failed.csar";
+		resourceDetails = ElementFactory.getDefaultImportResource();
+		Path path = Paths
+				.get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop1_failed.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.PROPERTY_NAME_ALREADY_EXISTS,
+				propertyForTestName);
+
+		ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
+		resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop1_failed.csar");
+		resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+		BaseRestUtils.checkErrorResponse(createResource, ActionStatus.PROPERTY_NAME_ALREADY_EXISTS,
+				propertyForTestName);
+	}
+
+	private RestResponse importUserDefinedNodeType(String payloadName, User sdncModifierDetails,
+			ImportReqDetails resourceDetails) throws Exception {
+
+		Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/" + payloadName);
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VFC.name());
+		return ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+	}
+
+	// TODO Tal: Since Cashing change partial resource returned that causes null
+	// pointer exception
+	// commented out till fixing
+	private void checkResource(RestResponse createResource, int capNum, String capType, String riName,
+			List<ImmutablePair<String, String>> propertyNamesValues) {
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		Map<String, List<CapabilityDefinition>> capabilities = resource.getCapabilities();
+		// TODO Tal: Since Cashing change partial resource returned that causes
+		// null pointer exception
+		/* assertEquals(capabilities.size(), capNum); */
+		/*
+		 * List<CapabilityDefinition> capabilitesContainer =
+		 * capabilities.get(capType);
+		 */
+
+		ComponentInstance resourceRI = resource.getComponentInstances().stream()
+				.filter(ri -> ri.getComponentName().equals(riName)).collect(Collectors.toList()).get(0);
+		// TODO Tal: Since Cashing change partial resource returned that causes
+		// null pointer exception
+		/*
+		 * CapabilityDefinition capabilityFromContainer =
+		 * capabilitesContainer.stream()
+		 * .filter(cap->cap.getOwnerId().equals(resourceRI.getUniqueId())).
+		 * collect(Collectors.toList()).get(0);
+		 */
+
+		CapabilityDefinition capabilityFromRI = resourceRI.getCapabilities().get(capType).get(0);
+		for (ImmutablePair<String, String> propValuePair : propertyNamesValues) {
+			// TODO Tal: Since Cashing change partial resource returned that
+			// causes null pointer exception
+			/*
+			 * Map<String, ComponentInstanceProperty> propertiesFromContainer =
+			 * capabilityFromContainer.getProperties()
+			 * .stream().filter(p->p.getName().equalsIgnoreCase(propValuePair.
+			 * getLeft())) .collect(Collectors.toMap(p->p.getName(), p->p));
+			 */
+
+			List<ComponentInstanceProperty> propertiesFromRI = capabilityFromRI.getProperties().stream()
+					.filter(p -> p.getName().equalsIgnoreCase(propValuePair.getLeft())).collect(Collectors.toList());
+			// TODO Tal: Since Cashing change partial resource returned that
+			// causes null pointer exception
+			/*
+			 * for(ComponentInstanceProperty riProp : propertiesFromRI){
+			 * assertTrue(propertiesFromContainer.containsKey(riProp.getName()))
+			 * ; ComponentInstanceProperty containerProp =
+			 * propertiesFromContainer.get(riProp.getName());
+			 * assertEquals(riProp.getValue(), containerProp.getValue());
+			 * if(riProp.getName().equals(propValuePair.getLeft()))
+			 * assertEquals(riProp.getValue(), propValuePair.getRight());
+			 * 
+			 * }
+			 */
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java
new file mode 100644
index 0000000..8ce8dc5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaResourceTest.java
@@ -0,0 +1,2896 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_CREATED;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.client.ClientProtocolException;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.RelationshipImpl;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Decoder;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.ImportUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ToscaNodeTypeInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import aj.org.objectweb.asm.Attribute;
+
+/**
+ * 
+ * @author Andrey + Pavel + Shay
+ *
+ */
+
+public class ImportToscaResourceTest extends ComponentBaseTest {
+	private static Logger logger = LoggerFactory.getLogger(ImportToscaResourceTest.class.getName());
+	protected Utils utils = new Utils();
+
+	public ImportToscaResourceTest() {
+		super(name, ImportToscaResourceTest.class.getName());
+	}
+
+	public ImportReqDetails importReqDetails;
+	protected static User sdncUserDetails;
+	protected static User testerUser;
+	protected String testResourcesPath;
+	protected ResourceReqDetails resourceDetails;
+	private HashSet<String> capabilitySources;
+	private int actualNumOfReqOrCap;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	@BeforeMethod
+	public void before() throws Exception {
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		testerUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		resourceDetails = ElementFactory.getDefaultResource();
+		String sourceDir = config.getResourceConfigDir();
+		final String workDir = "importToscaResourceByCreateUrl";
+		testResourcesPath = sourceDir + File.separator + workDir;
+		capabilitySources = new HashSet<String>();
+		actualNumOfReqOrCap = 0;
+	}
+
+	@DataProvider
+	private static final Object[][] getYmlWithInValidListProperties() throws IOException, Exception {
+		return new Object[][] { { "ListPropertyFalure02.yml", "[false,\"truee\"]", "boolean" },
+				{ "ListPropertyFalure03.yml", "[false,3]", "boolean" },
+				{ "ListPropertyFalure04.yml", "[false,3.56]", "boolean" },
+				{ "ListPropertyFalure05.yml", "[10000,3.56]", "integer" },
+				{ "ListPropertyFalure06.yml", "[10000,\"aaaa\"]", "integer" },
+				{ "ListPropertyFalure07.yml", "[10000,true]", "integer" },
+				{ "ListPropertyFalure08.yml", "[10.5,true]", "float" },
+				{ "ListPropertyFalure09.yml", "[10.5,\"asdc\"]", "float" }, // type
+																			// float
+				{ "ListPropertyFalure11.yml", "[10.5,\"500.0@\"]", "float" }, // property
+																				// list
+																				// float
+																				// type
+																				// contain
+																				// @
+																				// in
+																				// default
+																				// value
+				{ "ListPropertyFalure12.yml", "[10000,\"3#\"]", "integer" }, // property
+																				// list
+																				// integer
+																				// type
+																				// contain
+																				// #
+																				// in
+																				// default
+																				// value
+				{ "ListPropertyFalure13.yml", "[false,\"true%\"]", "boolean" }, // property
+																				// list
+																				// boolean
+																				// type
+																				// contain
+																				// %
+																				// in
+																				// default
+																				// value
+				{ "ListPropertyFalure14.yml", "[false,\"falsee\",true]", "boolean" },
+				{ "ListPropertyFalure15.yml", "[10.5,\"10.6x\",20.5,30.5]", "float" } // float
+																						// with
+																						// value
+																						// 10.6x
+																						// instead
+																						// 10.6f
+
+		};
+	}
+
+	@DataProvider
+	private static final Object[][] getYmlWithInValidMapProperties() throws IOException, Exception {
+		return new Object[][] { { "MapPropertyFalure02.yml", "[false,\"truee\"]", "boolean" },
+				{ "MapPropertyFalure03.yml", "[false,3]", "boolean" },
+				{ "MapPropertyFalure04.yml", "[false,3.56]", "boolean" },
+				{ "MapPropertyFalure05.yml", "[10000,3.56]", "integer" },
+				{ "MapPropertyFalure06.yml", "[10000,\"aaaa\"]", "integer" },
+				{ "MapPropertyFalure07.yml", "[10000,true]", "integer" },
+				{ "MapPropertyFalure08.yml", "[10.5,true]", "float" },
+				{ "MapPropertyFalure09.yml", "[10.5,\"asdc\"]", "float" }, // type
+																			// float
+				{ "MapPropertyFalure11.yml", "[10.5,\"500.0@\"]", "float" }, // property
+																				// list
+																				// float
+																				// type
+																				// contain
+																				// @
+																				// in
+																				// default
+																				// value
+				{ "MapPropertyFalure12.yml", "[10000,\"3#\"]", "integer" }, // property
+																			// list
+																			// integer
+																			// type
+																			// contain
+																			// #
+																			// in
+																			// default
+																			// value
+				{ "MapPropertyFalure13.yml", "[false,\"true%\"]", "boolean" }, // property
+																				// list
+																				// boolean
+																				// type
+																				// contain
+																				// %
+																				// in
+																				// default
+																				// value
+				{ "MapPropertyFalure14.yml", "[false,\"falsee\",true]", "boolean" },
+				{ "MapPropertyFalure15.yml", "[10.5,\"10.6x\",20.5,30.5]", "float" } // float
+																						// with
+																						// value
+																						// 10.6x
+																						// instead
+																						// 10.6f
+
+		};
+	}
+
+	@DataProvider
+	private static final Object[][] getYmlWithInValidOccurrences() throws IOException, Exception {
+		return new Object[][] { { "occurencyFalure01.yml" }, // requirements [2
+																// , 0]
+				{ "occurencyFalure02.yml" }, // requirements [-1, 2]
+				{ "occurencyFalure03.yml" }, // requirements [1 ,-2]
+				{ "occurencyFalure05.yml" }, // requirements MAX occurrences not
+												// exist [ 1 , ]
+				{ "occurencyFalure06.yml" }, // requirements [ 0 , 0 ]
+				{ "occurencyFalure08.yml" }, // requirements [ 1.0 , 2.0 ]
+				{ "occurencyFalure09.yml" }, // requirements [ "1" , "2" ]
+				{ "occurencyFalure10.yml" }, // requirements [ ]
+				{ "occurencyFalure11.yml" }, // requirements [ UNBOUNDED ,
+												// UNBOUNDED ]
+				{ "occurencyFalure31.yml" }, // capability [ 2, 1]
+				{ "occurencyFalure32.yml" }, // capability [-1, 2]
+				{ "occurencyFalure33.yml" }, // capability [1, -2]
+				{ "occurencyFalure35.yml" }, // capability MAX occurrences not
+												// exist [ 1 , ]
+				{ "occurencyFalure36.yml" }, // capability [ 0 , 0 ]
+				{ "occurencyFalure38.yml" }, // capability [ 1.0 , 2.0 ]
+				{ "occurencyFalure39.yml" }, // capability [ "1" , "2" ]
+				{ "occurencyFalure40.yml" }, // capability [ ]
+				{ "occurencyFalure41.yml" } // capability [ UNBOUNDED ,
+											// UNBOUNDED ]
+		};
+	}
+
+	@DataProvider
+	private static final Object[][] getInvalidYmlWithOccurrences() throws IOException, Exception {
+		return new Object[][] { { "occurencyFalure04.yml" }, // requirements MIN
+																// occurrences
+																// not exist [ ,
+																// 1]
+				{ "occurencyFalure07.yml" }, // requirements [ @ , 1 ]
+				{ "occurencyFalure34.yml" }, // capability MIN occurrences not
+												// exist [ , 1]
+				{ "occurencyFalure37.yml" } // capability [ 0 , # ]
+
+		};
+	}
+
+	// US656928
+	protected final String importMapPropertySuccess = "importMapPropertySuccessFlow.yml";
+	protected final String importAttributeSuccess = "importAttributeSuccessFlow.yml";
+	protected final String importSuccessFile = "myCompute.yml";
+	protected final String derivedFromMyCompute = "derivedFromMyCompute.yml";
+	protected final String importSuccessVFFile = "myComputeVF.yml";
+	protected final String importNoDerivedFromFile = "myComputeDerivedFromNotExists.yml";
+	protected final String importInvalidDefinitionVersionFile = "myComputeIncorrectDefenitionVersionValue.yml";
+	protected final String importIncorrectNameSpaceFormatFile = "myComputeIncorrectNameSpaceFormat.yml";
+	protected final String importNoDefenitionVersionFile = "myComputeNoDefenitionVersion.yml";
+	protected final String importNodeTypesTwiceFile = "myComputeWithNodeTypesTwice.yml";
+	protected final String importTopologyTemplateFile = "myComputeWithTopologyTemplate.yml";
+	protected final String importNoContentFile = "noContent.yml";
+	protected final String importWithOccurrences = "myComputeOccurencySuccess.yml";
+	protected final String importListPropertyBadDefault = "importListPropertyBadDefault.yml";
+	protected final String importListPropertyGoodDefault = "importListPropertyGoodDefault.yml";
+	protected final String importListPropertySuccess = "importListPropertySuccessFlow.yml";
+	// US631462
+	protected final String importDuplicateRequirements = "importDuplicateRequirements.yml";
+	protected final String importDuplicateCapability = "importDuplicateCapability.yml";
+	protected final String importCapabilityNameExistsOnParent = "importCapabilityNameExistsOnParent.yml";
+	protected final String importRequirementNameExistsOnParent = "importRequirementNameExistsOnParent.yml";
+	protected final String importToscaResourceReqCapDerivedFromParent = "derivedFromWebAppDerivedReqCap.yml";
+	protected final String missingCapInReqDef = "missingCapInReqDefinition.yml";
+	protected final String missingCapInCapDef = "missingCapInCapDefinition.yml";
+
+	// US558432 - Support for Capability/Requirement "occurences" Import
+	@Test(dataProvider = "getYmlWithInValidOccurrences")
+	public void importToscaResourceWithOccurrencesFailuresFlow01(String ymlFileWithInvalidCapReqOccurrences)
+			throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFileWithInvalidCapReqOccurrences);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_OCCURRENCES.name(), new ArrayList<String>(),
+				importResourceResponse.getResponse());
+	}
+
+	@Test(dataProvider = "getInvalidYmlWithOccurrences")
+	public void importToscaResourceWithOccurrencesFailuresFlow02(String ymlFileWithInvalidCapReqOccurrences)
+			throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFileWithInvalidCapReqOccurrences);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_YAML_FILE.name(), new ArrayList<String>(),
+				importResourceResponse.getResponse());
+	}
+
+	@Test
+	public void importToscaResource() throws Exception {
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importSuccessFile);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+		AssertJUnit.assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		AssertJUnit.assertTrue("validate toscaResourceName field",
+				resourceJavaObject.getToscaResourceName().equals(parseToscaNodeYaml.getNodeName()));
+		AssertJUnit.assertTrue("validate resourceType field",
+				resourceJavaObject.getResourceType().equals(ResourceTypeEnum.VFC));
+		// find derived from resource details
+		// Validate resource details after import-create resource including
+		// capabilities, interfaces from derived_from resource
+
+		// Validate audit message
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceWithOccurrencesSuccessFlow() throws Exception {
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importWithOccurrences);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+		AssertJUnit.assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		AssertJUnit.assertTrue("validate toscaResourceName field",
+				resourceJavaObject.getToscaResourceName().equals(parseToscaNodeYaml.getNodeName()));
+		AssertJUnit.assertTrue("validate resourceType field",
+				resourceJavaObject.getResourceType().equals(ResourceTypeEnum.VFC));
+		String requirementsType = "tosca.capabilities.Attachment";
+		String capabilitType = "tosca.capabilities.Endpoint.Admin";
+		// Verify Occurrences of requirements and capabilities in resource
+		verifyRequirementsOccurrences(resourceJavaObject, requirementsType);
+		verifyCapabilitiesOccurrences(resourceJavaObject, capabilitType);
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	// ------------------------------Success---------------------------------
+
+	@Test(enabled = false)
+	public void importToscaResourceVFResType() throws Exception {
+
+		String resourceType = ResourceTypeEnum.VF.toString();
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importSuccessVFFile);
+		// importReqDetails.setResourceType(resourceType);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+		assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		assertTrue("validate toscaResourceName field",
+				resourceJavaObject.getToscaResourceName().equals(parseToscaNodeYaml.getNodeName()));
+		assertTrue(
+				"validate resourceType field, expected - " + resourceType + ", actual - "
+						+ resourceJavaObject.getResourceType(),
+				resourceJavaObject.getResourceType().toString().equals(resourceType));
+
+		// Validate audit message
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	// ------------------------------Failure---------------------------------
+
+	@Test
+	public void importToscaResourceDerivedFromNotExist() throws Exception {
+
+		String fileName = importNoDerivedFromFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		// List<String> derivedFrom = new ArrayList<String>() ;
+		// derivedFrom.add("hh");
+		// importReqDetails.setDerivedFrom(derivedFrom);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.PARENT_RESOURCE_NOT_FOUND.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PARENT_RESOURCE_NOT_FOUND.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name());
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceIncorrectDefinitionVersion() throws Exception {
+
+		String fileName = importInvalidDefinitionVersionFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_TOSCA_TEMPLATE.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_TOSCA_TEMPLATE.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceIncorrectSpaceNameFormat() throws Exception {
+
+		String fileName = importIncorrectNameSpaceFormatFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_RESOURCE_NAMESPACE.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_RESOURCE_NAMESPACE.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceNoDefinitionVersion() throws Exception {
+
+		String fileName = importNoDefenitionVersionFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_TOSCA_TEMPLATE.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_TOSCA_TEMPLATE.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceNoContent() throws Exception {
+
+		String fileName = importNoContentFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_RESOURCE_PAYLOAD.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_RESOURCE_PAYLOAD.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceWithTopologyTemplate() throws Exception {
+
+		String fileName = importTopologyTemplateFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.NOT_RESOURCE_TOSCA_TEMPLATE.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_RESOURCE_TOSCA_TEMPLATE.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceWithNodeTypesTwice() throws Exception {
+
+		String fileName = importNodeTypesTwiceFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.NOT_SINGLE_RESOURCE.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_SINGLE_RESOURCE.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	// failed case - uniqueness of toscaResourceName - RESOURCE_ALREADY_EXISTS
+	@Test
+	public void importToscaResourceTwice() throws Exception {
+		String fileName = importSuccessFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+		assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		RestResponse checkInresponse = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertTrue("checkIn resource request returned status:" + checkInresponse.getErrorCode(),
+				checkInresponse.getErrorCode() == 200);
+
+		// Validate audit message
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+
+		// import the same tosca resource with different resourceName
+		DbUtils.cleanAllAudits();
+
+		importReqDetails.setName("kuku");
+		List<String> tags = new ArrayList<String>();
+		tags.add(importReqDetails.getName());
+		importReqDetails.setTags(tags);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_ALREADY_EXISTS.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_ALREADY_EXISTS.name(), variables,
+				importResourceResponse.getResponse());
+
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(importReqDetails.getToscaResourceName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+
+	}
+
+	@Test
+	public void importToscaResourceWithTheSameNameAsCreatedResourceBefore() throws Exception {
+
+		// create resource
+		String fileName = importSuccessFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName(importReqDetails.getName());
+
+		RestResponse response = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
+		int status = response.getErrorCode();
+		assertEquals("create request returned status:" + status, 201, status);
+		assertNotNull("resource uniqueId is null:", resourceDetails.getUniqueId());
+		Resource resourceJavaObject = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		// assertNull("validate toscaResourceName field",
+		// resourceJavaObject.getToscaResourceName());
+
+		// import the same tosca resource
+		DbUtils.cleanAllAudits();
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_ALREADY_EXISTS.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_ALREADY_EXISTS.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+
+	}
+
+	@Test
+	public void importToscaResourceInvalidChecksum() throws Exception {
+		String fileName = importSuccessFile;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), "invalidMd5Sum");
+
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				headersMap);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		assertNotNull("check response object is not null after import tosca resource", importResourceResponse);
+		assertNotNull("check error code exists in response after import tosca resource",
+				importResourceResponse.getErrorCode());
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_RESOURCE_CHECKSUM.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_RESOURCE_CHECKSUM.name(), variables,
+				importResourceResponse.getResponse());
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceInvalidResType() throws Exception {
+
+		String resourceType = "invalidResourceType";
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importSuccessFile);
+		importReqDetails.setResourceType(resourceType);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
+		assertNotNull("check response object is not null after import resouce", importResourceResponse);
+		assertNotNull("check error code exists in response after import resource",
+				importResourceResponse.getErrorCode());
+		assertEquals("Check response code after import resource", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+
+		List<String> variables = new ArrayList<>();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
+				importResourceResponse.getResponse());
+
+		// Validate audit message
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void derivedTemplateImportedSecondResourceAsFirstImportedNodeType() throws Exception {
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importSuccessFile);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+		assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		assertTrue("validate toscaResourceName field",
+				resourceJavaObject.getToscaResourceName().equals(parseToscaNodeYaml.getNodeName()));
+		assertTrue(
+				"validate resourceType field, expected - " + importReqDetails.getResourceType() + ", actual - "
+						+ resourceJavaObject.getResourceType(),
+				resourceJavaObject.getResourceType().toString().equals(importReqDetails.getResourceType()));
+
+		// Validate audit message
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+
+		RestResponse certifyResource = LifecycleRestUtils.certifyResource(importReqDetails);
+		assertTrue("certify resource request returned status:" + certifyResource.getErrorCode(),
+				certifyResource.getErrorCode() == 200);
+
+		// import second resource template derived from first resource
+		DbUtils.cleanAllAudits();
+		importReqDetails.setName("kuku");
+		List<String> tags = new ArrayList<String>();
+		tags.add(importReqDetails.getName());
+		importReqDetails.setTags(tags);
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				derivedFromMyCompute);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+		parseToscaNodeYaml = utils.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		Resource resourceJavaObject2 = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		assertTrue("validate toscaResourceName field",
+				resourceJavaObject2.getToscaResourceName().equals(parseToscaNodeYaml.getNodeName()));
+		assertTrue(
+				"validate resourceType field, expected - " + importReqDetails.getResourceType() + ", actual - "
+						+ resourceJavaObject2.getResourceType(),
+				resourceJavaObject2.getResourceType().toString().equals(importReqDetails.getResourceType()));
+
+		// Validate audit message
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject2 = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject2.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject2.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject2.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject2.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject2,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+
+	}
+
+	@Test
+	public void importToscaResourceListPropertyGoodDefault() throws Exception {
+
+		String fileName = importListPropertyGoodDefault;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		assertTrue("response code is not 201, returned :" + importResourceResponse.getErrorCode(),
+				importResourceResponse.getErrorCode() == 201);
+
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		assertTrue("Properties size : " + resourceJavaObject.getProperties().size(),
+				resourceJavaObject.getProperties().size() == 1);
+		assertTrue("Property type : " + resourceJavaObject.getProperties().get(0).getType(),
+				resourceJavaObject.getProperties().get(0).getType().equals(ToscaPropertyType.LIST.getType()));
+		assertTrue(
+				"actual Default values  : " + resourceJavaObject.getProperties().get(0).getDefaultValue()
+						+ " , expected : " + "[false, true]",
+				resourceJavaObject.getProperties().get(0).getDefaultValue().equals("[\"false\",\"true\"]"));
+
+	}
+
+	@Test
+	public void importToscaResourceListPropertyBadDefault() throws Exception {
+
+		String fileName = importListPropertyBadDefault;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name());
+		assertEquals("Check response code after tosca resource import", errorInfo.getCode(),
+				importResourceResponse.getErrorCode());
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("my_prop");
+		variables.add("list");
+		variables.add("boolean");
+		variables.add("[12,true]");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name(), variables,
+				importResourceResponse.getResponse());
+
+	}
+
+	// Benny US580744 - Add support for TOSCA "list" type - import
+
+	@Test
+	public void importToscaResourceListPropertySuccessFlow() throws Exception {
+		String fileName = importListPropertySuccess;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		ResourceRestUtils.checkCreateResponse(importResourceResponse);
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		// Verify Properties List in resource
+		verifyResourcePropertiesList(resourceJavaObject);
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	// DE198534
+	@Test(dataProvider = "getYmlWithInValidListProperties") // invalid default
+															// values
+	public void importToscaResourceListPropertyFailureFlows(String ymlFileWithInvalidPropertyDefualtValues,
+			String defualtValues, String enterySchemaType) throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFileWithInvalidPropertyDefualtValues);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("my_property");
+		variables.add("list");
+		variables.add(enterySchemaType);
+		variables.add(defualtValues);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name(), variables,
+				importResourceResponse.getResponse());
+	}
+
+	// BUG DE198650
+	@Test
+	public void importToscaResourceListPropertyNonSupportEntrySchemaType() throws Exception {
+		String ymlFile = "ListPropertyFalure01.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFile);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("booolean"); // property entry_schema data type
+		variables.add("my_boolean");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_INNER_TYPE.name(), variables,
+				importResourceResponse.getResponse());
+	}
+
+	// BUG DE198676
+	@Test // (enabled=false)
+	public void importToscaResourceListPropertyNonSupportedPropertyType() throws Exception { // Not
+																								// "list"
+																								// type
+		String ymlFile = "ListPropertyFalure16.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFile);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("koko"); // property data type (koko instead list)
+		variables.add("my_boolean");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_TYPE.name(), variables,
+				importResourceResponse.getResponse());
+	}
+
+	/// US656928 - [BE] - Add support for TOSCA "map" type - Phase 1 import
+	@Test
+	public void importToscaResourceMapPropertySuccessFlow() throws Exception {
+		String fileName = importMapPropertySuccess;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		ResourceRestUtils.checkCreateResponse(importResourceResponse);
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+		// Verify Properties MAP in resource
+		verifyResourcePropertiesMap(resourceJavaObject);
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test(dataProvider = "getYmlWithInValidMapProperties") // invalid default
+															// values
+	public void importToscaResourceMapPropertyFailureFlows(String ymlFileWithInvalidPropertyDefualtValues,
+			String defualtValues, String enterySchemaType) throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFileWithInvalidPropertyDefualtValues);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("my_property");
+		variables.add("map");
+		variables.add(enterySchemaType);
+		variables.add(defualtValues);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name(), variables,
+				importResourceResponse.getResponse());
+	}
+
+	@Test
+	public void importToscaResourceMaptPropertyNonSupportedPropertyType() throws Exception { // Not
+																								// "Map"
+																								// type
+		String ymlFile = "MapPropertyFalure16.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFile);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("koko"); // property data type (koko instead list)
+		variables.add("my_boolean");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_TYPE.name(), variables,
+				importResourceResponse.getResponse());
+	}
+
+	@Test
+	public void importToscaResourceMissingCapabilityInReqDefinition() throws Exception {
+
+		String fileName = missingCapInReqDef;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_CAPABILITY_TYPE.name());
+		String missingCapName = "org.openecomp.capabilities.networkInterfaceNotFound";
+		BaseRestUtils.checkErrorResponse(importResourceResponse, ActionStatus.MISSING_CAPABILITY_TYPE, missingCapName);
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, Arrays.asList(missingCapName));
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType("org.openecomp.resource.vSCP-03-16");
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceMissingCapabilityInCapDefinition() throws Exception {
+
+		String fileName = missingCapInCapDef;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		logger.debug("import tosca resource response: {}", importResourceResponse.getResponseMessage());
+
+		// Validate audit message
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_CAPABILITY_TYPE.name());
+		String missingCapName = "org.openecomp.capabilities.networkInterfaceNotFound";
+		BaseRestUtils.checkErrorResponse(importResourceResponse, ActionStatus.MISSING_CAPABILITY_TYPE, missingCapName);
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, Arrays.asList(missingCapName));
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType("org.openecomp.resource.vSCP-03-16");
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceDuplicateRequirements() throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importDuplicateRequirements);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("requirement");
+		variables.add("local_storage");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.IMPORT_DUPLICATE_REQ_CAP_NAME.name(), variables,
+				importResourceResponse.getResponse());
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.IMPORT_DUPLICATE_REQ_CAP_NAME.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceDuplicateCapabilities() throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importDuplicateCapability);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("capability");
+		variables.add("scalable");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.IMPORT_DUPLICATE_REQ_CAP_NAME.name(), variables,
+				importResourceResponse.getResponse());
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.IMPORT_DUPLICATE_REQ_CAP_NAME.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceRequirementNameExistsOnParent() throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importRequirementNameExistsOnParent);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("requirement");
+		variables.add("local_storage");
+		variables.add("Compute");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED.name(),
+				variables, importResourceResponse.getResponse());
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceCapabilityNameExistsOnParent() throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importCapabilityNameExistsOnParent);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertTrue(importResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("capability");
+		variables.add("binding");
+		variables.add("Compute");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED.name(),
+				variables, importResourceResponse.getResponse());
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgFailure(errorInfo, variables);
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	@Test
+	public void importToscaResourceReqCapDerivedFromParent() throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				importToscaResourceReqCapDerivedFromParent);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		BaseRestUtils.checkCreateResponse(importResourceResponse);
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType("org.openecomp.resource.MyWebApp");
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	/************************ Shay ************************/
+
+	@Test
+	public void caseRequirementInsensitiveTest() throws Exception {
+		String fileName = "CaseInsensitiveReqTest_1.yml";
+		int expectedNumOfRequirements = 2;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+		importReqDetails.setRequirements(testResourcesPath, fileName, sdncUserDetails, null);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String fileName2 = "CaseInsensitiveReqTest_2.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName2);
+		importReqDetails.setName("secondImportedResource");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails, null);
+		requirements = importReqDetails.getRequirements();
+		requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		checkImportedAssetAssociated(importReqDetails);
+
+	}
+
+	private void checkImportedAssetAssociated(ImportReqDetails importDetails) throws IOException, Exception {
+		RestResponse importResourceResponse;
+		ImportReqDetails importReqDetails2 = ElementFactory.getDefaultImportResource();
+		importReqDetails2 = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails2, testResourcesPath,
+				"BindingAsset.yml");
+		importReqDetails2.setName("bindingAsset");
+		importReqDetails2.setTags(Arrays.asList(importReqDetails2.getName()));
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails2, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		ResourceReqDetails vf = ElementFactory.getDefaultResourceByType("VF100", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncUserDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		RestResponse createResourceResponse = ResourceRestUtils.createResource(vf, sdncUserDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceResponse);
+
+		LifecycleRestUtils.changeResourceState(importDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		LifecycleRestUtils.changeResourceState(importReqDetails2, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+
+		RestResponse response = ResourceRestUtils.createResourceInstance(importDetails, sdncUserDetails,
+				vf.getUniqueId());
+		ResourceRestUtils.checkCreateResponse(response);
+		ComponentInstance riCap = ResponseParser.parseToObject(response.getResponse(), ComponentInstance.class);
+
+		response = ResourceRestUtils.createResourceInstance(importReqDetails2, sdncUserDetails, vf.getUniqueId());
+		ResourceRestUtils.checkCreateResponse(response);
+		ComponentInstance riReq = ResponseParser.parseToObject(response.getResponse(), ComponentInstance.class);
+
+		RestResponse getResourceBeforeAssociate = ComponentRestUtils
+				.getComponentRequirmentsCapabilities(sdncUserDetails, vf);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceBeforeAssociate.getResponse(), CapReqDef.class);
+
+		String capbilityUid = capReqDef.getCapabilities().get("tosca.capabilities.network.Bindable").get(0)
+				.getUniqueId();
+		String requirementUid = capReqDef.getRequirements().get("tosca.capabilities.network.Bindable").get(0)
+				.getUniqueId();
+
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		requirementDef.setFromNode(riReq.getUniqueId());
+		requirementDef.setToNode(riCap.getUniqueId());
+
+		RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair();
+		pair.setRequirementOwnerId(riReq.getUniqueId());
+		pair.setCapabilityOwnerId(riCap.getUniqueId());
+		pair.setRequirement("VirtualBinding");
+		RelationshipImpl relationship = new RelationshipImpl();
+		relationship.setType("tosca.capabilities.network.Bindable");
+		pair.setRelationships(relationship);
+		pair.setCapabilityUid(capbilityUid);
+		pair.setRequirementUid(requirementUid);
+		List<RequirementAndRelationshipPair> relationships = new ArrayList<>();
+		relationships.add(pair);
+		requirementDef.setRelationships(relationships);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncUserDetails,
+				vf.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+	}
+
+	@Test
+	public void caseCapabilitiesInsensitiveTest() throws Exception {
+		String fileName = "CaseInsensitiveCapTest_1.yml";
+		int expectedNumOfCapabilities = 6;
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setCapabilities(testResourcesPath, fileName, sdncUserDetails, null);
+		Map<String, Object> capabilities = importReqDetails.getCapabilities();
+		Map<String, Object> capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String fileName2 = "CaseInsensitiveCapTest_2.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName2);
+		importReqDetails.setName("secondImportedResource");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setCapabilities(testResourcesPath, fileName2, sdncUserDetails, null);
+		capabilities = importReqDetails.getCapabilities();
+		capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+
+	}
+
+	@Test
+	public void fatherAndChildHaveDifferentRequirementsTest() throws Exception {
+		String fileName = "DifferentReqFromCompute.yml";
+		int expectedNumOfRequirements = 3;
+
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, fileName, sdncUserDetails, "Compute");
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		checkImportedAssetAssociated(importReqDetails);
+	}
+
+	@Test
+	public void fatherHasNoRequirementsTest() throws Exception {
+		String fatherFileName = "CPHasNoReqCap.yml";
+		String childFileName = "DerivedFromCPWithOwnReq.yml";
+		int expectedNumOfRequirements = 3;
+
+		importReqDetails.setName("father");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String derivedFromResourceName = importReqDetails.getName();
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromResourceName);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+	}
+
+	@Test
+	public void childHasSameReqNameAndTypeLikeFatherTest() throws Exception {
+		String childFileName = "SameReqAsCompute.yml";
+		int expectedNumOfRequirements = 2;
+
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails, null);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+	}
+
+	@Test
+	public void childHasSameCapNameAndTypeLikeFatherTest() throws Exception {
+		String childFileName = "SameCapAsCompute.yml";
+		int expectedNumOfCapabilities = 6;
+
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setCapabilities(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				"Compute");
+		Map<String, Object> capabilities = importReqDetails.getCapabilities();
+		Map<String, Object> capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+	}
+
+	@Test
+	public void childGetsAllRequirementsOfFatherAndGrandfatherTest() throws Exception {
+		int expectedNumOfRequirements = 4;
+
+		String fatherFileName = "DifferentReqFromCompute.yml";
+		importReqDetails.setName("father");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String derivedFromName = importReqDetails.getName();
+		String childFileName = "DifferentReqCapFromCompute1.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+	}
+
+	@Test
+	public void childOverridesGrandfatherRequirementsTest() throws Exception {
+		int expectedNumOfRequirements = 3;
+
+		String fatherFileName = "DifferentReqFromCompute.yml";
+		importReqDetails.setName("father");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String derivedFromName = importReqDetails.getName();
+		String childFileName = "SameReqAsCompute_DerivedFromMyCompute1.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+	}
+
+	@Test
+	public void childAndGrandfatherHaveDifferenetReqiurementTypeTest() throws Exception {
+		int expectedNumOfRequirements = 3;
+		int expectedNumOfCapabilities = 6;
+
+		String fatherName = "father";
+		String fatherFileName = "DifferentReqFromCompute.yml";
+		importReqDetails.setName(fatherName);
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String fatherUniqueId = importReqDetails.getUniqueId();
+		ImportReqDetails importReqDetailsFather = importReqDetails;
+
+		String childFileName = "importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_INVALID_CONTENT, importResourceResponse.getErrorCode().intValue());
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("requirement");
+		variables.add("local_storage");
+		variables.add(fatherName);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED.name(),
+				variables, importResourceResponse.getResponse());
+
+		importReqDetails.setUniqueId(fatherUniqueId);
+
+		importReqDetailsFather.setRequirements(testResourcesPath, fatherFileName, sdncUserDetails, "Compute");
+		Map<String, Object> requirements = importReqDetailsFather.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetailsFather,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetailsFather.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		importReqDetailsFather.setCapabilities(testResourcesPath, fatherFileName, sdncUserDetails, "Compute");
+		Map<String, Object> capabilities = importReqDetailsFather.getCapabilities();
+		Map<String, Object> capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetailsFather,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetailsFather.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+	}
+
+	@Test
+	public void childHasNoReqCapTest() throws Exception {
+		int expectedNumOfRequirements = 3;
+		int expectedNumOfCapabilities = 6;
+
+		String fatherFileName = "DifferentReqFromCompute.yml";
+		importReqDetails.setName("father");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String derivedFromName = importReqDetails.getName();
+		String childFileName = "CPHasNoReqCap_DerivedFromMyCompute1.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		importReqDetails.setCapabilities(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> capabilities = importReqDetails.getCapabilities();
+		Map<String, Object> capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+	}
+
+	@Test
+	public void fatherAndChildGetReqCapFromGrandfatherTest() throws Exception {
+		int expectedNumOfRequirements = 2;
+		int expectedNumOfCapabilities = 6;
+
+		String fatherFileName = "MyFatherCompute_NoReqCap.yml";
+		importReqDetails.setName("father");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String derivedFromName = importReqDetails.getName();
+		String childFileName = "myChildCompute_NoReqCap.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		importReqDetails.setCapabilities(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> capabilities = importReqDetails.getCapabilities();
+		Map<String, Object> capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+	}
+
+	@Test
+	public void reverseInheritanceTest() throws Exception {
+		int expectedNumOfRequirements = 2;
+		int expectedNumOfCapabilities = 2;
+
+		String fatherName = "father";
+		String fatherFileName = "myFatherWebApp_derviedFromDocker.yml";
+		importReqDetails.setName(fatherName);
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String fatherUniqueId = importReqDetails.getUniqueId();
+		ImportReqDetails importReqDetailsFather = importReqDetails;
+		String childFileName = "myChildWebApp_DerivedFromContainer.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_INVALID_CONTENT, importResourceResponse.getErrorCode().intValue());
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("requirement");
+		variables.add("host");
+		variables.add(fatherName);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED.name(),
+				variables, importResourceResponse.getResponse());
+
+		importReqDetails.setUniqueId(fatherUniqueId);
+		importReqDetailsFather.setRequirements(testResourcesPath, fatherFileName, sdncUserDetails, "Root");
+		Map<String, Object> requirements = importReqDetailsFather.getRequirements();
+		Map<String, Object> requirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetailsFather,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), requirementsFromResponse.keySet().size());
+		importReqDetailsFather.compareRequirementsOrCapabilities(requirements, requirementsFromResponse);
+
+		importReqDetailsFather.setCapabilities(testResourcesPath, fatherFileName, sdncUserDetails, "Root");
+		Map<String, Object> capabilities = importReqDetailsFather.getCapabilities();
+		Map<String, Object> capabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetailsFather,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), capabilitiesFromResponse.keySet().size());
+		importReqDetailsFather.compareRequirementsOrCapabilities(capabilities, capabilitiesFromResponse);
+	}
+
+	// DE202329
+	@Test(enabled = false)
+	public void requirementWithMissingTypeTest() throws Exception {
+		String fatherName = "father";
+		String fatherFileName = "DerivedFromWebApplication_HasNoReqType.yml";
+		importReqDetails.setName(fatherName);
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_INVALID_CONTENT, importResourceResponse.getErrorCode().intValue());
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("diff");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_CAPABILITY_TYPE.name(), variables,
+				importResourceResponse.getResponse());
+
+	}
+
+	@Test
+	public void TwinBrothersHaveSameReqCapTest() throws Exception {
+		int expectedNumOfRequirements = 4;
+		int expectedNumOfCapabilities = 7;
+
+		String derivedFromName = "father";
+		String fatherFileName = "DifferentReqFromCompute.yml";
+		importReqDetails.setName(derivedFromName);
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fatherFileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		RestResponse changeResourceState1 = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState1.getErrorCode().intValue());
+		RestResponse changeResourceState2 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState2.getErrorCode().intValue());
+		RestResponse changeResourceState3 = LifecycleRestUtils.changeResourceState(importReqDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState3.getErrorCode().intValue());
+
+		String childFileName = "DifferentReqCapFromCompute1.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("child");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				childFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		Map<String, Object> childRequirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		Map<String, Object> childCapabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities - 1);
+
+		String twinFileName = "DifferentReqCapFromCompute2.yml";
+		importReqDetails = ElementFactory.getDefaultImportResource();
+		importReqDetails.setName("twin");
+		importReqDetails.setTags(Arrays.asList(importReqDetails.getName()));
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				twinFileName);
+		importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails, null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+
+		importReqDetails.setRequirements(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> requirements = importReqDetails.getRequirements();
+		Map<String, Object> twinRequirementsFromResponse = parseReqOrCapFromResponse("requirements", importReqDetails,
+				expectedNumOfRequirements);
+		assertEquals(requirements.keySet().size(), twinRequirementsFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(requirements, twinRequirementsFromResponse);
+
+		importReqDetails.setCapabilities(testResourcesPath, importReqDetails.getPayloadName(), sdncUserDetails,
+				derivedFromName);
+		Map<String, Object> capabilities = importReqDetails.getCapabilities();
+		Map<String, Object> twinCapabilitiesFromResponse = parseReqOrCapFromResponse("capabilities", importReqDetails,
+				expectedNumOfCapabilities);
+		assertEquals(capabilities.keySet().size(), twinCapabilitiesFromResponse.keySet().size());
+		importReqDetails.compareRequirementsOrCapabilities(capabilities, twinCapabilitiesFromResponse);
+
+		assertEquals(childRequirementsFromResponse.keySet().size(), twinRequirementsFromResponse.keySet().size());
+		assertEquals(childCapabilitiesFromResponse.keySet().size(), twinCapabilitiesFromResponse.keySet().size());
+	}
+
+	/*
+	 * invariantUUID - US672129
+	 */
+
+	private void checkInvariantUuidIsImmutableInDifferentAction(ImportReqDetails importReqDetails) throws Exception {
+		// create resource
+		importReqDetails.setName("import");
+		String invariantUuidDefinedByUser = "abcd1234";
+		RestResponse importResourceResponse = importResourceWithRequestedInvariantUuid(importReqDetails,
+				invariantUuidDefinedByUser);
+		String invariantUUIDcreation = ResponseParser.getInvariantUuid(importResourceResponse);
+		assertFalse(checkInvariantUuidEqual(invariantUuidDefinedByUser, importResourceResponse));
+
+		// get resource
+		RestResponse getResource = ResourceRestUtils.getResource(importReqDetails.getUniqueId());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, getResource));
+
+		// checkin resource
+		RestResponse changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// checkout resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// checkin resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// checkout resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// checkin resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// certification request
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// start certification
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// certify
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, testerUser,
+				LifeCycleStatesEnum.CERTIFY);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+		String certifiedUniqueId = importReqDetails.getUniqueId();
+
+		// update resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceReqDetails updatedResourceReqDetails = new ResourceReqDetails(importReqDetails,
+				importReqDetails.getVersion());
+		updatedResourceReqDetails.setDescription("updatedDescription");
+		updatedResourceReqDetails.setVendorRelease("1.2.3.4");
+		RestResponse updateResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceReqDetails,
+				sdncUserDetails, importReqDetails.getUniqueId());
+		assertEquals(STATUS_CODE_SUCCESS, updateResponse.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, updateResponse));
+
+		// certification request
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// checkout resource
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// certification request
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// start certification
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// cancel certification
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, testerUser,
+				LifeCycleStatesEnum.CANCELCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// start certification
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// failure
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, testerUser,
+				LifeCycleStatesEnum.FAILCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// upload artifact
+		changeResourceState = LifecycleRestUtils.changeResourceState(importReqDetails, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultArtifact();
+		ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails, sdncUserDetails,
+				importReqDetails.getUniqueId());
+		assertEquals(STATUS_CODE_SUCCESS, changeResourceState.getErrorCode().intValue());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, changeResourceState));
+
+		// create instance
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.toString());
+		ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
+		importReqDetails.setUniqueId(certifiedUniqueId);
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(importReqDetails);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncUserDetails, resourceDetails.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals(STATUS_CODE_CREATED, createResourceInstanceResponse.getErrorCode().intValue());
+		getResource = ResourceRestUtils.getResource(importReqDetails.getUniqueId());
+		assertTrue(checkInvariantUuidEqual(invariantUUIDcreation, getResource));
+	}
+
+	private boolean checkInvariantUuidEqual(String expectedInvariantUuid, RestResponse response) {
+		String invariantUUIDFromResponse = ResponseParser.getInvariantUuid(response);
+		return expectedInvariantUuid.equals(invariantUUIDFromResponse);
+	}
+
+	@Test
+	public void checkCPHasImmutableInvariantUuidTest() throws Exception {
+		String filename = "FatherHasNoReqCap.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				filename);
+		checkResourceHasImmutableInvariantUuidTest(importReqDetails);
+	}
+
+	@Test
+	public void checkVFCHasImmutableInvariantUuidTest() throws Exception {
+		String filename = "computeCap11.yml";
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				filename);
+		checkResourceHasImmutableInvariantUuidTest(importReqDetails);
+	}
+
+	public void checkResourceHasImmutableInvariantUuidTest(ImportReqDetails importReqDetails) throws Exception {
+		// invariantUuid is null
+		importReqDetails.setName("first");
+		RestResponse importResourceResponse = importResourceWithRequestedInvariantUuid(importReqDetails, null);
+		String invariantUUIDcreation = ResponseParser.getInvariantUuid(importResourceResponse);
+		assertNotNull(invariantUUIDcreation);
+
+		ResourceRestUtils.deleteResource(importReqDetails.getUniqueId(), sdncUserDetails.getUserId());
+
+		// invariantUuid is empty
+		importReqDetails.setName("second");
+		String invariantUuidDefinedByUser = "";
+		importResourceResponse = importResourceWithRequestedInvariantUuid(importReqDetails, invariantUuidDefinedByUser);
+		invariantUUIDcreation = ResponseParser.getInvariantUuid(importResourceResponse);
+		assertNotNull(invariantUUIDcreation);
+
+		ResourceRestUtils.deleteResource(importReqDetails.getUniqueId(), sdncUserDetails.getUserId());
+
+		checkInvariantUuidIsImmutableInDifferentAction(importReqDetails);
+	}
+
+	private static RestResponse importResourceWithRequestedInvariantUuid(ImportReqDetails importDetails,
+			String invariantUuid) throws Exception {
+		importDetails.setInvariantUUID(invariantUuid);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importDetails, sdncUserDetails,
+				null);
+		assertEquals(STATUS_CODE_CREATED, importResourceResponse.getErrorCode().intValue());
+		return importResourceResponse;
+	}
+
+	private Map<String, Object> parseReqOrCapFromResponse(String parsedFieldName, ImportReqDetails importReqDetails,
+			int expectedNumOfReqCap) throws ClientProtocolException, IOException {
+		RestResponse getResource = ResourceRestUtils.getResource(importReqDetails.getUniqueId());
+		assertTrue(getResource.getErrorCode().equals(STATUS_CODE_SUCCESS));
+		Map<String, Object> parsedFieldFromResponseToMap = ResponseParser.getJsonValueAsMap(getResource,
+				parsedFieldName);
+		Iterator<String> iterator = parsedFieldFromResponseToMap.keySet().iterator();
+		actualNumOfReqOrCap = 0;
+		while (iterator.hasNext()) {
+			String next = iterator.next();
+			List<Object> object = (List<Object>) parsedFieldFromResponseToMap.get(next);
+			actualNumOfReqOrCap += object.size();
+		}
+		assertEquals(expectedNumOfReqCap, actualNumOfReqOrCap);
+		return parsedFieldFromResponseToMap;
+	}
+
+	// ---------------------------------
+
+	private void verifyResourcePropertiesList(Resource resourceJavaObject) { // use
+																				// importListPropertySuccessFlow.yml
+		boolean isPropertyAppear = false;
+		List<PropertyDefinition> propertiesList = resourceJavaObject.getProperties();
+		for (PropertyDefinition pro : propertiesList) {
+			switch (pro.getName()) {
+			case "my_boolean":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[false,true]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "my_boolean_array":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[true,false]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "duplicate_boolean_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[true,false,true]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_values_Insensitive":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[true,false,true]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "my_integers":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[0,1000,-1000,50]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "my_integers_array":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[10,-1000,0]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "duplicate_integers_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[10,10,-1000,0]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "my_string":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("[\"asdc\",\"$?^@ecomp$!#%()_-~@+*^...;;/w#\",\"uc\"]"));
+				// assertTrue("Check Property default values ",
+				// pro.getDefaultValue().equals("[\"asdc\",\"@=~!@#$%^&*()_+=?><:-w\",\"uc\"]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "my_string_array":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("[\"AAA\",\"~$~#bbb%^*_-\",\"qwe\",\"1.3\",\"500\",\"true\"]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "duplicate_string_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("[\"asdc\",\"asdc\",\"uc\"]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_null_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[\"asdc\",\"uc\"]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_space_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[\"asdc\",\"uc\"]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_array_null_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("[\"aaa\",\"bbb\",\"500\"]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "my_float":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[6,1000.000001,-3.0]"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "my_float_array":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[0.01,-5.0,2.1]"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "duplicate_float_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[0.0,0.0,4.555555]"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_no_default_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "integer_no_default_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "string_no_default_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_no_default_values":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "integer_null_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[1000,2000]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_null_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[true,false]"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "float_null_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[6,-3.0]"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_space_value":
+				assertTrue("Check Property Type ", pro.getType().equals("list"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("[6,-3.0]"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+
+			}
+			assertTrue(isPropertyAppear);
+			isPropertyAppear = false;
+		}
+
+	}
+
+	private void verifyRequirementsOccurrences(Resource resourceJavaObject, String requirementsType) {
+		boolean isRequirementAppear = false;
+		// List<RequirementDefinition> requerments =
+		// resourceJavaObject.getRequirements().get("tosca.capabilities.Attachment");
+		List<RequirementDefinition> requerments = resourceJavaObject.getRequirements().get(requirementsType);
+
+		for (RequirementDefinition req : requerments) {
+			switch (req.getName()) {
+			case "local_storage100":
+				assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals("1"));
+				assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals("UNBOUNDED"));
+				isRequirementAppear = true;
+				break;
+			case "local_storage200":
+				assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals("1"));
+				assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals("1"));
+				isRequirementAppear = true;
+				break;
+			case "local_storage300":
+				assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals("1"));
+				assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals("10"));
+				isRequirementAppear = true;
+				break;
+			case "local_storage400":
+				assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals("1"));
+				assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals("10000000"));
+				isRequirementAppear = true;
+				break;
+			case "local_storage500":
+				assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals("2"));
+				assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals("3"));
+				isRequirementAppear = true;
+				break;
+			case "local_storageNoOccurrences600":
+				assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals("1"));
+				assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals("1"));
+				isRequirementAppear = true;
+				break;
+			}
+			assertTrue(isRequirementAppear);
+			isRequirementAppear = false;
+		}
+
+	}
+
+	private void verifyCapabilitiesOccurrences(Resource resourceJavaObject, String capabilitType) {
+		boolean isCapabilityAppear = false;
+		// List<CapabilityDefinition> capabilities =
+		// resourceJavaObject.getCapabilities().get("tosca.capabilities.Endpoint.Admin");
+		List<CapabilityDefinition> capabilities = resourceJavaObject.getCapabilities().get(capabilitType);
+
+		for (CapabilityDefinition cap : capabilities) {
+			switch (cap.getName()) {
+			case "endpointNoOccurrence":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("1"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("UNBOUNDED"));
+				isCapabilityAppear = true;
+				break;
+			case "endpoint200":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("1"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("2"));
+				isCapabilityAppear = true;
+				break;
+			case "endpoint300":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("1"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("1"));
+				isCapabilityAppear = true;
+				break;
+			case "endpoint400":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("1"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("10"));
+				isCapabilityAppear = true;
+				break;
+			case "endpoint500":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("1"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("10000000"));
+				isCapabilityAppear = true;
+				break;
+			case "endpoint600":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("1"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("UNBOUNDED"));
+				isCapabilityAppear = true;
+				break;
+			case "endpoint700":
+				assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals("2"));
+				assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals("4"));
+				isCapabilityAppear = true;
+				break;
+
+			}
+			assertTrue(isCapabilityAppear);
+			isCapabilityAppear = false;
+		}
+
+	}
+
+	private void verifyResourcePropertiesMap(Resource resourceJavaObject) { // use
+																			// importMapPropertySuccessFlow.yml
+		boolean isPropertyAppear = false;
+		List<PropertyDefinition> propertiesList = resourceJavaObject.getProperties();
+		for (PropertyDefinition pro : propertiesList) {
+			switch (pro.getName()) {
+			case "string_prop01":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"val1\",\"keyB\":\"val2\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop02":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"val1\",\"keyB\":\"val2\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop03":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"val1\",\"keyB\":\"val2\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop04":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"10\",\"keyB\":\"true\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop05":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":\"Big\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop06":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"aaaA\",\"keyB\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop07":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop08":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"\",\"keyB\":\"abcd\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop09":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\" \",\"keyB\":\"abcd\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop10":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\" aaaa\",\"keyB\":\" bbbb\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop11":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\"aaaa \",\"keyB\":\"bbbb \"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop12":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":\" aaaa \",\"keyB\":\" bbbb ccccc \"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop13":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\"aaaa\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop14":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\" aaaa \"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop15":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\"AbcD\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop16":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\"AbcD\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop17":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\"AbcD\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop18":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\"AbcD\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop19":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":\"AbcD\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop20":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue()
+						.equals("{\"keyA\":\"aaaa\",\"keya\":\"aaaa\",\"Keya\":\"Aaaa\",\"KEYA\":\"nnnn\"}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop21":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "string_prop22":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("string"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop01":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":1,\"keyB\":1000}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop02":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop03":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":800,\"keyB\":-600}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop04":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":-600}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop05":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":100,\"keyB\":0}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop06":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":100,\"keyB\":0}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop07":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":100,\"keyB\":100}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop08":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":100,\"keyB\":200}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop09":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":100,\"keyB\":200}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop10":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":2222}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop11":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null,\"keyD\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop12":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "integer_prop13":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":200}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("integer"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop01":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":true,\"keyB\":false,\"keyC\":false}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop02":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":true,\"keyB\":false,\"keyC\":false}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop03":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null,\"keyD\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop04":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null,\"keyD\":null}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop05":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":true,\"keyB\":false,\"keyC\":false}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop06":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":true,\"keyB\":true,\"keyC\":false}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop07":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop08":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":true,\"keyB\":false}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "boolean_prop09":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":false,\"keyB\":true}"));
+				assertTrue("Check entrySchema Property Type ",
+						pro.getSchema().getProperty().getType().equals("boolean"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop01":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":1.2,\"keyB\":3.56,\"keyC\":33}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop02":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":0.0,\"keyB\":0.0,\"keyC\":0}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop03":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null,\"keyD\":null}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop04":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":1.2,\"keyB\":3.56,\"keyC\":33}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop05":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":33,\"keyB\":1.2,\"keyC\":3.607,\"keyD\":0}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop06":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":33,\"keyB\":1.2,\"keyC\":3.607}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop07":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":null,\"keyB\":null,\"keyC\":null,\"keyD\":null}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop08":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertEquals("Check Property  default values ", pro.getDefaultValue(), null);
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop09":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":0.01,\"keyB\":null}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop10":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ", pro.getDefaultValue().equals("{\"keyA\":0.00020}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			case "float_prop11":
+				assertTrue("Check Property Type ", pro.getType().equals("map"));
+				assertTrue("Check Property  default values ",
+						pro.getDefaultValue().equals("{\"keyA\":3.56,\"keyB\":33}"));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType().equals("float"));
+				isPropertyAppear = true;
+				break;
+			}
+			assertTrue(isPropertyAppear);
+			isPropertyAppear = false;
+		}
+
+	}
+
+	@Test
+	public void importToscaResourceAttributeSuccessFlow() throws Exception {
+
+		String fileName = importAttributeSuccess;
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				fileName);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, sdncUserDetails,
+				null);
+		ResourceRestUtils.checkCreateResponse(importResourceResponse);
+		Resource resourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		ToscaNodeTypeInfo parseToscaNodeYaml = utils
+				.parseToscaNodeYaml(Decoder.decode(importReqDetails.getPayloadData()));
+
+		HashMap<String, PropertyDefinition> attr = new HashMap<>();
+
+		PropertyDefinition newAttr2 = new PropertyDefinition();
+		newAttr2.setName("networks");
+		newAttr2.setType("map");
+		newAttr2.setDefaultValue("{\"keyA\" : val1 , \"keyB\" : val2}");
+		SchemaDefinition schema = new SchemaDefinition();
+		PropertyDataDefinition prop = new PropertyDataDefinition();
+		prop.setType("string");
+		schema.setProperty(prop);
+		newAttr2.setSchema(schema);
+		attr.put("networks", newAttr2);
+
+		PropertyDefinition newAttr1 = new PropertyDefinition();
+		newAttr1.setName("public_address");
+		newAttr1.setType("string");
+		attr.put("public_address", newAttr1);
+
+		PropertyDefinition newAttr3 = new PropertyDefinition();
+		newAttr3.setName("ports");
+		newAttr3.setDescription("this is my description");
+		attr.put("ports", newAttr3);
+
+		PropertyDefinition newAttr = new PropertyDefinition();
+		newAttr.setDefaultValue("myDefault");
+		newAttr.setName("private_address");
+		newAttr.setStatus("supported");
+		newAttr.setType("string");
+		attr.put("private_address", newAttr);
+
+		// verify Resource Attributes
+		validateResourceAttribute(resourceJavaObject, attr);
+
+		// TO DO
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory
+				.getDefaultImportResourceAuditMsgSuccess();
+		expectedResourceAuditJavaObject.setResourceName(importReqDetails.getName());
+		expectedResourceAuditJavaObject.setModifierName(sdncUserDetails.getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		expectedResourceAuditJavaObject.setToscaNodeType(parseToscaNodeYaml.getNodeName());
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+				AuditingActionEnum.IMPORT_RESOURCE.getName(), null, false);
+	}
+
+	private void validateResourceAttribute(Resource resource, Map<String, PropertyDefinition> attr) {
+		List<PropertyDefinition> resList = resource.getAttributes();
+		int size = resList.size();
+		String attributeName;
+		for (int i = 0; i < size; i++) {
+			attributeName = resList.get(i).getName();
+			assertEquals(attr.get(attributeName).getDefaultValue(), resList.get(i).getDefaultValue());
+			assertEquals(attr.get(attributeName).getName(), resList.get(i).getName());
+			assertEquals(attr.get(attributeName).getDescription(), resList.get(i).getDescription());
+			assertEquals(attr.get(attributeName).getStatus(), resList.get(i).getStatus());
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java
new file mode 100644
index 0000000..464ebe1
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportUpdateResourseCsarTest.java
@@ -0,0 +1,283 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.imports;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.common.api.Constants;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class ImportUpdateResourseCsarTest extends ComponentBaseTest {
+	@Rule
+	public static TestName name = new TestName();
+
+	Gson gson = new Gson();
+	public static String userDefinedNodeYaml = "mycompute2.yml";
+	public static String rootPath = System.getProperty("user.dir");
+	public static String csarFolderPath = "/src/test/resources/CI/csars/";
+
+	public ImportUpdateResourseCsarTest() {
+		super(name, ImportUpdateResourseCsarTest.class.getName());
+	}
+
+	@Test
+	public void createUpdateImportResourceFromCsarTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		RestResponse updateResource = null;
+		RestResponse createResource = null;
+		Resource resource = null;
+		String payloadName = "orig2G.csar";
+		String rootPath = System.getProperty("user.dir");
+		Path path = Paths.get(rootPath + csarFolderPath + "orig2G.csar");
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setName("TEST01");
+		resourceDetails.setCsarUUID("orig2G.csar");
+		resourceDetails.setCsarVersion("1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		// create new resource from Csar
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		// update scar with new artifacts
+		path = Paths.get(rootPath + csarFolderPath + "orig2G_update.csar");
+		data = Files.readAllBytes(path);
+		payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setDescription("update");
+		resourceDetails.setCsarVersion("2");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+	}
+
+	@Test
+	public void createUpdateImportResourceFromCsarWithArtifactsGroupNamingTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes;
+		ResourceReqDetails resourceDetails;
+		RestResponse updateResource;
+		RestResponse createResource;
+		Resource resource;
+
+		// back original scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"VF_RI2_G4_withArtifacts_group_naming_a.csar", "VF_RI2_G4_withArtifacts_group_naming.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("TEST01");
+		resourceDetails.setCsarUUID("VF_RI2_G4_withArtifacts_group_naming.csar");
+		resourceDetails.setCsarVersion("1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		// create new resource from Csar
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		List<GroupDefinition> groups = resource.getGroups();
+		assertTrue(groups != null && groups.size() == 6);
+		assertTrue(groups.stream()
+				.filter(g -> g.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)
+						&& !Pattern.compile(Constants.MODULE_NEW_NAME_PATTERN).matcher(g.getName()).matches())
+				.count() == 0);
+		// update scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"VF_RI2_G4_withArtifacts_group_naming_delete_update.csar", "VF_RI2_G4_withArtifacts_group_naming.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		resourceDetails.setDescription("BLA BLA BLA");
+		resourceDetails.setCsarVersion("2");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		groups = resource.getGroups();
+		assertTrue(groups != null && groups.size() == 5);
+		// back original scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"VF_RI2_G4_withArtifacts_group_naming_a.csar", "VF_RI2_G4_withArtifacts_group_naming.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		resourceDetails.setDescription("BLA BLA BLA");
+		resourceDetails.setCsarVersion("3");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		groups = resource.getGroups();
+		assertTrue(groups != null && groups.size() == 6);
+		assertTrue(groups.stream()
+				.filter(g -> g.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)
+						&& !Pattern.compile(Constants.MODULE_NEW_NAME_PATTERN).matcher(g.getName()).matches())
+				.count() == 0);
+	}
+
+	@Test
+	public void createUpdateDeleteAllRequiredArtifactsTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes;
+		ResourceReqDetails resourceDetails;
+		RestResponse updateResource;
+		RestResponse createResource;
+		Resource resource;
+		String artifactName = "heatnested7";
+
+		ImportReqDetails resourceDetails0 = ElementFactory.getDefaultImportResource();
+		createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails, resourceDetails0);
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+
+		// back original scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails, "orig2GV001_a.csar", "orig2GV001.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("TEST01");
+		resourceDetails.setCsarUUID("orig2GV001.csar");
+		resourceDetails.setCsarVersion("1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		// create new resource from Csar
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertTrue(resource.getDeploymentArtifacts().get(artifactName).getRequiredArtifacts().size() == 2);
+		List<GroupDefinition> groups = resource.getGroups();
+		// update scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"orig2GV006-remove-all-nested-artifacts.csar", "orig2GV001.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		resourceDetails.setDescription("BLA BLA BLA");
+		resourceDetails.setCsarVersion("2");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertTrue(resource.getDeploymentArtifacts().get(artifactName).getRequiredArtifacts().size() == 0);
+		groups = resource.getGroups();
+		// back original scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails, "orig2GV001_a.csar", "orig2GV001.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+	}
+
+	// First create from orig2GV006-remove-all-nested-artifacts.csar (without
+	// requiredArtifact)
+	// Submit for testing
+	// Login as tester -> Certification
+	// Login as designer
+	// then update to orig2GV008-change-nested-oam-fileContent.csar (with
+	// requiredArtifact)
+	// Expected: requiredArtifact: ["hot-nimbus-psm_v1.0.yaml",
+	// "hot-nimbus-swift-container_v1.0.yaml"]
+	// Actual: no requiredArtifact
+	@Test
+	public void createUpdateAddRequiredArtifactsTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse copyRes;
+		ResourceReqDetails resourceDetails;
+		RestResponse updateResource;
+		RestResponse createResource;
+		Resource resource;
+		String artifactName = "heatnested7";
+
+		ImportReqDetails resourceDetails0 = ElementFactory.getDefaultImportResource();
+		createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails, resourceDetails0);
+		BaseRestUtils.checkCreateResponse(createResource);
+		createResource = LifecycleRestUtils.certifyResource(resourceDetails0);
+		BaseRestUtils.checkSuccess(createResource);
+
+		// back original scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"orig2GV006-remove-all-nested-artifacts.csar", "orig2GV001.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+
+		resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("TEST01");
+		resourceDetails.setCsarUUID("orig2GV001.csar");
+		resourceDetails.setCsarVersion("1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		// create new resource from Csar
+		createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		createResource = LifecycleRestUtils.certifyResource(resourceDetails);
+		BaseRestUtils.checkSuccess(createResource);
+
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		assertTrue(resource.getDeploymentArtifacts().get(artifactName).getRequiredArtifacts().size() == 0);
+		List<GroupDefinition> groups = resource.getGroups();
+		// update scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails,
+				"orig2GV008-change-nested-oam-fileContent.csar", "orig2GV001.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+		resourceDetails.setDescription("BLA BLA BLA");
+		resourceDetails.setCsarVersion("2");
+		updateResource = ResourceRestUtils.updateResource(resourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(updateResource);
+		resource = ResponseParser.parseToObjectUsingMapper(updateResource.getResponse(), Resource.class);
+		assertTrue(resource.getDeploymentArtifacts().get(artifactName).getRequiredArtifacts().size() == 2);
+		groups = resource.getGroups();
+		// back original scar
+		copyRes = ImportCsarResourceTest.copyCsarRest(sdncModifierDetails, "orig2GV001_a.csar", "orig2GV001.csar");
+		BaseRestUtils.checkSuccess(copyRes);
+	}
+
+	private RestResponse importUserDefinedNodeType(String payloadName, User sdncModifierDetails,
+			ImportReqDetails resourceDetails) throws Exception {
+
+		Path path = Paths.get(rootPath + csarFolderPath + payloadName);
+		byte[] data = Files.readAllBytes(path);
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(ResourceTypeEnum.VFC.name());
+		return ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java
new file mode 100644
index 0000000..345b81e
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java
@@ -0,0 +1,225 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.inputs;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstInputsMap;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.InputsRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+import fj.data.Either;
+
+/**
+ * CI-Tests for inputs 
+ * @author il0695
+ *
+ */
+public class InputsApiTests extends ComponentBaseTest {
+
+	private static String inputCsar1 = "FCGI_with_inputs.csar";
+	private static String inputCsar2 = "LDSA1_with_inputs.csar";
+	private static User  sdncDesignerDetails = null;
+	
+	@Rule
+	public static TestName name = new TestName();
+	
+	/**
+	 * Constructor
+	 */
+	public InputsApiTests() {
+		super(name, InputsApiTests.class.getName());
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	}
+	
+	/**
+	 * Create VF with inputs from CSAR file
+	 * 
+	 * @throws Exception 
+	 */
+	@Test
+	public void testCreateResourceInstanceWithInputsFromCsar() throws Exception {
+		Resource vf = AtomicOperationUtils.importResourceFromCSAR(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, inputCsar1);
+		assertTrue("Success creating VF from CSAR", !vf.getInputs().isEmpty());
+	}
+	
+	/**
+	 * Create service and add to it VF instance with inputs
+	 * 
+	 * @throws Exception 
+	 */
+	@Test
+	public void testAddVfInstanceWithInputsToService() throws Exception {
+		createServiceWithVFInstanceWithInputs();
+	}
+	
+	/**
+	 * General test to check most functionality of inputs
+	 * <ul>
+	 * 	<li>Create service with VF instance that has inputs)</li>
+	 * 	<li>Get all inputs of VF instance</li>
+	 * 	<li>Add inputs to service</li>
+	 * 	<li>Get service inputs</li>
+	 * 	<li>Delete service inputs</li>
+	 * </ul>
+	 * 
+	 * @throws Exception 
+	 */
+	@Test
+	public void testInputsMainFunctionality() throws Exception {
+		Service service = createServiceWithVFInstanceWithInputs();
+		int totalInputsBeforeAdd = service.getInputs().size();
+		
+		// Get component instances
+		RestResponse getInstancesResponse = ComponentInstanceRestUtils.getComponentInstances(ComponentTypeEnum.SERVICE, service.getUniqueId(), sdncDesignerDetails);
+		BaseValidationUtils.checkSuccess(getInstancesResponse);
+		List<ComponentInstance> serviceInstances = new Gson().fromJson(getInstancesResponse.getResponse(), new TypeToken<ArrayList<ComponentInstance>>(){}.getType());
+		
+		// Get all inputs of first instance
+		ComponentInstance vfInstance = serviceInstances.get(0);
+		RestResponse getComponentInstanceInputsResponse = InputsRestUtils.getComponentInstanceInputs(service, vfInstance);
+		BaseValidationUtils.checkSuccess(getComponentInstanceInputsResponse);
+		List<InputDefinition> instanceInputs = new Gson().fromJson(getComponentInstanceInputsResponse.getResponse(), new TypeToken<ArrayList<InputDefinition>>(){}.getType());
+		
+		// Take only the 2 first inputs
+		List<InputDefinition> inputsToAdd = instanceInputs.stream().limit(2).collect(Collectors.toList());
+		
+		// Build component instances input map to add to server
+		ComponentInstInputsMap buildComponentInstInputsMap = buildComponentInstInputsMap(vfInstance.getUniqueId(), inputsToAdd);
+		RestResponse addInputResponse = InputsRestUtils.addInput(service, buildComponentInstInputsMap, UserRoleEnum.DESIGNER);
+		BaseValidationUtils.checkSuccess(addInputResponse);
+		
+		// Get service inputs count
+		RestResponse getComponentInputsResponse = InputsRestUtils.getComponentInputs(service);
+		BaseValidationUtils.checkSuccess(getComponentInputsResponse);
+		List<InputDefinition> serviceInputsAfterAdd = new Gson().fromJson(getComponentInputsResponse.getResponse(), new TypeToken<ArrayList<InputDefinition>>(){}.getType());
+		if (serviceInputsAfterAdd.size()-totalInputsBeforeAdd!=2) {
+			assertTrue("Error adding inputs to service (service should have 2 inputs)", false);
+		}
+		
+		// Delete 1 input from service
+		RestResponse deleteInputFromComponentResponse = InputsRestUtils.deleteInputFromComponent(service, serviceInputsAfterAdd.get(0).getUniqueId());
+		BaseValidationUtils.checkSuccess(deleteInputFromComponentResponse);
+		
+		// Get service inputs count after delete
+		RestResponse getComponentInputsResponseAfterDelete = InputsRestUtils.getComponentInputs(service);
+		BaseValidationUtils.checkSuccess(getComponentInputsResponseAfterDelete);
+		List<InputDefinition> serviceInputsAfterDelete = new Gson().fromJson(getComponentInputsResponseAfterDelete.getResponse(), new TypeToken<ArrayList<InputDefinition>>(){}.getType());
+		if (serviceInputsAfterDelete.size()-totalInputsBeforeAdd!=1) {
+			assertTrue("Error deleting inputs from service (service should have 1 input)", false);
+		}
+		
+		assertTrue("Success testing inputs main functionality", true);
+	}
+
+	/**
+	 * Private method to create service with VF instance that has inputs
+	 * This is private method to be used by multiple tests
+	 * 
+	 * @return {@link org.openecomp.sdc.be.model}
+	 * @throws Exception
+	 * @throws IOException
+	 */
+	private Service createServiceWithVFInstanceWithInputs() throws Exception, IOException {
+		// Create default service
+		Either<Service, RestResponse> createDefaultServiceEither = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		if (createDefaultServiceEither.isRight()){
+			assertTrue("Error creating default service", false);
+		}
+		Service service = createDefaultServiceEither.left().value();
+		
+		// Create VF from CSAR file
+		Resource vfWithInputs = AtomicOperationUtils.importResourceFromCSAR(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, inputCsar2);
+
+		// Certify VF
+		Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(vfWithInputs, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		assertTrue("response code is BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + changeComponentState.getRight().getErrorCode(), changeComponentState.getRight().getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		
+		// Add VF instance to service
+		Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainerEither = AtomicOperationUtils.addComponentInstanceToComponentContainer(vfWithInputs, service, UserRoleEnum.DESIGNER, true);
+		if (addComponentInstanceToComponentContainerEither.isRight()){
+			assertTrue("Error adding VF to service", false);
+		}
+				
+		// Get service response
+		ServiceReqDetails serviceDetails = new ServiceReqDetails(service);
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		
+		// Get VF instance from service
+		ComponentInstance vfInstance = service.getComponentInstances().get(0);
+		if (vfInstance!=null){
+			assertTrue("Success creating service with VF instance", true);
+		} else {
+			assertTrue("Error creating service with VF instance", false);
+		}
+		return service;
+	}
+	
+	/**
+	 * Return default ComponentInstInputsMap
+	 * 
+	 * @param addToInput
+	 * @param inputs
+	 * @return {@link org.openecomp.sdc.be.model.ComponentInstInputsMap}
+	 */
+	private ComponentInstInputsMap buildComponentInstInputsMap (String addToInput, List<InputDefinition> inputs) {
+		Map<String, List<InputDefinition>> map = new HashMap<>();
+		map.put(addToInput, inputs);
+		ComponentInstInputsMap componentInstInputsMap = new ComponentInstInputsMap();
+		componentInstInputsMap.setComponentInstanceInputsMap(map);		
+		return componentInstInputsMap;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
new file mode 100644
index 0000000..e15652d
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
@@ -0,0 +1,274 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.lifecycle;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.annotations.BeforeMethod;
+
+/**
+ * 
+ * @author al714h
+ * 
+ *         resourceDetails - create, Add Heat, certify resourceDetails1 - create
+ *         resource, LCS - CheckOut serviceDetails - create, add RI from
+ *         resourceDetails serviceDetails2 - create, add RI from resourceDetails
+ *         serviceDetailsEmpty - create, LCS - CheckOut serviceDetailsEmpty2 -
+ *         create, LCS - CheckOut
+ *
+ */
+public abstract class LCSbaseTest extends ComponentBaseTest {
+
+	protected ResourceReqDetails resourceDetails;
+	protected ResourceReqDetails resourceDetails1;
+	protected ServiceReqDetails serviceDetails;
+	protected ServiceReqDetails serviceDetails2;
+	protected ServiceReqDetails serviceDetailsEmpty;
+	protected ServiceReqDetails serviceDetailsEmpty2;
+	protected ComponentInstanceReqDetails componentInstanceReqDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails2;
+	protected User sdncDesignerDetails1;
+	protected User sdncDesignerDetails2;
+	protected static User sdncTesterDeatails1;
+	protected User sdncAdminDetails1;
+	protected ArtifactReqDetails heatArtifactDetails;
+	protected ArtifactReqDetails heatVolArtifactDetails;
+	protected ArtifactReqDetails heatNetArtifactDetails;
+
+	protected ArtifactReqDetails defaultArtifactDetails;
+	protected ResourceUtils resourceUtils;
+	protected ArtifactUtils artifactUtils;
+
+	// protected static ServiceUtils serviceUtils = new ServiceUtils();
+	public LCSbaseTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+
+		initializeMembers();
+
+		createComponents();
+
+	}
+
+	public void initializeMembers() throws IOException, Exception {
+		resourceDetails = ElementFactory.getDefaultResource();
+		// resourceDetails =
+		// ElementFactory.getDefaultResource("myNewResource1234567890",
+		// NormativeTypesEnum.ROOT, ResourceServiceCategoriesEnum.ROUTERS,
+		// UserRoleEnum.DESIGNER.getUserId());
+		resourceDetails1 = ElementFactory.getDefaultResource("secondResource", NormativeTypesEnum.ROOT);
+		serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails2 = ElementFactory.getDefaultService("newTestService2", ServiceCategoriesEnum.MOBILITY, "al1976");
+		serviceDetailsEmpty = ElementFactory.getDefaultService("newEmptyService", ServiceCategoriesEnum.MOBILITY,
+				"al1976");
+		serviceDetailsEmpty2 = ElementFactory.getDefaultService("newEmptyService2", ServiceCategoriesEnum.MOBILITY,
+				"al1976");
+		sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
+		sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		heatNetArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType());
+		heatVolArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_VOL.getType());
+		componentInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
+		resourceInstanceReqDetails2 = ElementFactory.getDefaultComponentInstance();
+
+	}
+
+	protected void createComponents() throws Exception {
+
+		RestResponse response = ResourceRestUtils.createResource(resourceDetails1, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetails1.getUniqueId());
+
+		response = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetails.getUniqueId());
+
+		response = ServiceRestUtils.createService(serviceDetails, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1,
+				resourceDetails.getUniqueId());
+		assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		// certified resource
+		response = LCSbaseTest.certifyResource(resourceDetails, sdncDesignerDetails1);
+		assertTrue("certify resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		// add resource instance with HEAT deployment artifact to the service
+		componentInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails, sdncDesignerDetails1,
+				serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
+
+		response = ServiceRestUtils.createService(serviceDetails2, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("service uniqueId is null:", serviceDetails2.getUniqueId());
+
+		componentInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails, sdncDesignerDetails1,
+				serviceDetails2.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
+
+		response = ServiceRestUtils.createService(serviceDetailsEmpty, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("service uniqueId is null:", serviceDetailsEmpty.getUniqueId());
+
+		response = ServiceRestUtils.createService(serviceDetailsEmpty2, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("service uniqueId is null:", serviceDetailsEmpty2.getUniqueId());
+
+		DbUtils.cleanAllAudits();
+
+	}
+
+	public static RestResponse certifyResource(ResourceReqDetails resourceDetails, User user) throws Exception {
+		RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user.getUserId(),
+				LifeCycleStatesEnum.CHECKIN);
+		// if (restResponseResource.getErrorCode() == 200){
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user.getUserId(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		// }else
+		// return restResponseResource;
+		sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		if (restResponseResource.getErrorCode() == 200) {
+			restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
+					sdncTesterDeatails1.getUserId(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponseResource;
+		if (restResponseResource.getErrorCode() == 200) {
+			restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
+					sdncTesterDeatails1.getUserId(), LifeCycleStatesEnum.CERTIFY);
+		}
+		return restResponseResource;
+	}
+
+	public static RestResponse certifyService(ServiceReqDetails serviceDetails, User user) throws Exception {
+		RestResponse restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, user,
+				LifeCycleStatesEnum.CHECKIN);
+		// if (restResponseService.getErrorCode() == 200){
+		restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, user,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		// }else
+		// return restResponseService;
+
+		sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		if (restResponseService.getErrorCode() == 200) {
+			restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDeatails1,
+					LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponseService;
+		if (restResponseService.getErrorCode() == 200) {
+			restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDeatails1,
+					LifeCycleStatesEnum.CERTIFY);
+		}
+		return restResponseService;
+	}
+
+	protected static RestResponse raiseResourceToTargetVersion(ResourceReqDetails resourceDetails, String targetVersion,
+			User user) throws Exception {
+		return raiseResourceToTargetVersion(resourceDetails, targetVersion, null, user);
+	}
+
+	protected static RestResponse raiseResourceToTargetVersion(ResourceReqDetails resourceDetails, String targetVersion,
+			RestResponse prevResponse, User user) throws Exception {
+
+		String[] splitParts = targetVersion.split("\\.");
+
+		int version = Integer.parseInt(splitParts[1]);
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+
+		if (prevResponse != null) {
+			Resource resourceRespJavaObject = ResponseParser
+					.convertResourceResponseToJavaObject(prevResponse.getResponse());
+			if (resourceRespJavaObject.getLifecycleState().equals(LifecycleStateEnum.CERTIFIED)) {
+				RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
+						user.getUserId(), LifeCycleStatesEnum.CHECKOUT);
+			}
+		}
+
+		RestResponse restResponseResource = null;
+		for (int i = 0; i < (version - 1); i++) {
+
+			restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, null,
+					LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+			if (restResponseResource.getErrorCode() == 200) {
+				restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user.getUserId(),
+						LifeCycleStatesEnum.CHECKOUT);
+				if (restResponseResource.getErrorCode() == 200) {
+
+				} else
+					break;
+
+			} else
+				break;
+
+		}
+
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, null,
+				LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+		assertEquals("Check response code ", 200, restResponseResource.getErrorCode().intValue());
+		return restResponseResource;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ChangeServiceInstanceVersionTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ChangeServiceInstanceVersionTest.java
new file mode 100644
index 0000000..6a4fa3b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ChangeServiceInstanceVersionTest.java
@@ -0,0 +1,1478 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_MISSING_INFORMATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_NOT_FOUND;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS_DELETE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class ChangeServiceInstanceVersionTest extends ComponentInstanceBaseTest {
+
+	protected ArtifactReqDetails heatArtifactDetails;
+	public String firstVfInstanceUniqueId;
+	public String firstVfInstanceName;
+	public String secondVfInstanceUniqueId;
+	public String secoundVfInstanceName;
+	public String serviceInstanceToReplaceUniqueId;
+	public String expectedServiceName;
+	public String expectedPosX;
+	public String expectedPosY;
+	public String actualServiceInstanceName;
+	public String actualPosX;
+	public String actualPosY;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ChangeServiceInstanceVersionTest() {
+		super(name, ChangeServiceInstanceVersionTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+		firstVfInstanceName = null;
+		secoundVfInstanceName = null;
+		firstVfInstanceUniqueId = null;
+		secondVfInstanceUniqueId = null;
+		serviceInstanceToReplaceUniqueId = null;
+		expectedServiceName = null;
+		expectedPosX = null;
+		expectedPosY = null;
+		actualServiceInstanceName = null;
+		actualPosX = null;
+		actualPosY = null;
+		init();
+		createComponents();
+	}
+
+	private void createComponents() throws Exception {
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		createAtomicResource(resourceDetailsVFC_01);
+		changeResourceStateToCertified(resourceDetailsVFC_01);
+		createAtomicResource(resourceDetailsCP_01);
+		changeResourceStateToCertified(resourceDetailsCP_01);
+		createAtomicResource(resourceDetailsVL_01);
+		changeResourceStateToCertified(resourceDetailsVL_01);
+		createAtomicResource(resourceDetailsVFC_02);
+		changeResourceStateToCertified(resourceDetailsVFC_02);
+		createAtomicResource(resourceDetailsCP_02);
+		changeResourceStateToCertified(resourceDetailsCP_02);
+		createAtomicResource(resourceDetailsVL_02);
+		changeResourceStateToCertified(resourceDetailsVL_02);
+		createVF(resourceDetailsVF_02);
+		createVF(resourceDetailsVF_01);
+		// create check-In services
+		createService(serviceDetails_01);
+		createService(serviceDetails_02);
+		createService(serviceDetails_03);
+		createProduct(productDetails_01);
+		createProduct(productDetails_02);
+
+		// add resourceDetailsCP_01 ,resourceDetailsVFC_01 and
+		// resourceDetailsCP_01 to resourceDetailsVF_01 and certify
+		// resourceDetailsVF_01
+		certifyVf(resourceDetailsVF_01, resourceDetailsVFC_02, resourceDetailsCP_01);
+		// add resourceDetailsCP_02 ,resourceDetailsVFC_02 and
+		// resourceDetailsVL_02 to resourceDetailsVF_02 and certify
+		// resourceDetailsVF_02
+		certifyVf(resourceDetailsVF_02, resourceDetailsVFC_02, resourceDetailsCP_02);
+		RestResponse createVFInstanceResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails); // serviceDetails_01 has certified
+										// resourceDetailsVF_01
+		firstVfInstanceName = ResponseParser.getNameFromResponse(createVFInstanceResponse);
+		createVFInstanceResponse = createVFInstanceDuringSetup(serviceDetails_02, resourceDetailsVF_02,
+				sdncDesignerDetails); // serviceDetails_01 has certified
+										// resourceDetailsVF_02
+		secoundVfInstanceName = ResponseParser.getUniqueIdFromResponse(createVFInstanceResponse);
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_02, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+	}
+
+	@Test
+	public void changeServiceInstanceVersionByPm() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// get the new VF instance uniqueId after checkout service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	@Test
+	public void changeServiceInstanceVersionByAdmin() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// get the new VF instance uniqueId after checkout service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// service [0.2] state to CERTIFICATIONREQUEST
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncAdminDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncAdminDetails, ComponentTypeEnum.PRODUCT,
+				true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncAdminDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	@Test
+	public void changeServiceInstanceToOlderVersion() throws Exception {
+		// Get VF Instance UniquId [Service version 0.1]
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		ComponentInstance actualComponentInstance = service.getComponentInstances().get(0);
+		firstVfInstanceUniqueId = actualComponentInstance.getUniqueId();
+		String serviceOlderVersionUniquId = ResponseParser.getUniqueIdFromResponse(getServiceResponse);
+
+		// Checkout service [0.2]
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01,
+				sdncDesignerDetails, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// get the new VF instance uniqueId after checkout service
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// Adding service instance (serviceDetails_01 V0.2) to product without
+		// saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to Older version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceOlderVersionUniquId, sdncPmDetails1, ComponentTypeEnum.PRODUCT,
+				true);
+		// RestResponse changeServiceInstanceVersionResponse =
+		// changeServiceInstanceVersion(productDetails_01.getUniqueId(),
+		// serviceInstanceToReplaceUniqueId , serviceNewUniqueUid,
+		// sdncPmDetails1, ComponentTypeEnum.PRODUCT , true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	// DE190201
+	@Test
+	public void changeServiceInstanceVersionToCertifiedVersion() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		/*
+		 * String serviceNewUniqueUid =
+		 * ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		 * serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		 */
+		// get the new VF instance uniqueId after checkout service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.CERTIFY);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		// RestResponse changeServiceInstanceVersionResponse =
+		// changeServiceInstanceVersion(productDetails_01.getUniqueId(),
+		// serviceInstanceToReplaceUniqueId , serviceNewUniqueUid,
+		// sdncPmDetails1, ComponentTypeEnum.PRODUCT , true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	// DE191927
+	@Test(enabled = false)
+	public void changeServiceInstanceVersionThenReCheckInProduct() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// get the new VF instance uniqueId after checkout service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		/////////////////////
+		productOldUniqueId = productDetails_01.getUniqueId();
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		/////////////////////////////////////////////
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	@Test
+	public void changeServiceInstanceToHisVersion() throws Exception {
+		// Get VF Instance UniquId [Service version 0.1]
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		String serviceOlderVersionUniquId = ResponseParser.getUniqueIdFromResponse(getServiceResponse);
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// get the new VF instance uniqueId after checkout service
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceOlderVersionUniquId, sdncPmDetails1, ComponentTypeEnum.PRODUCT,
+				true);
+		// RestResponse changeServiceInstanceVersionResponse =
+		// changeServiceInstanceVersion(productDetails_01.getUniqueId(),
+		// serviceInstanceToReplaceUniqueId , serviceNewUniqueUid,
+		// sdncPmDetails1, ComponentTypeEnum.PRODUCT , true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	@Test
+	public void changeServiceInstanceVersionByAdminNotByProductOwner() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncAdminDetails, ComponentTypeEnum.PRODUCT,
+				true);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+
+	}
+
+	@Test
+	public void changeServiceInstanceVersionByPmNotByProductOwner() throws Exception {
+		// Adding service instance (serviceDetails_01) to product AND --->
+		// saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// change uniqueId after product check-out in expected Req&Cap
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		updateNewComponentInstanceId(createServiceInstanceResp, productNewUniqueId);
+		// CHANGE Service Instance VERSION BY NON PRODUCT OWNER (sdncPmDetails1
+		// instead sdncPmDetails1)
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(
+				productDetails_01.getUniqueId(), serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails2,
+				ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void changeServiceInstanceVersionByTester() throws Exception {
+		// Adding service instance (serviceDetails_01) to product AND --->
+		// saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceToReplaceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// change uniqueId after product check-out in expected Req&Cap
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// CHANGE Service Instance VERSION BY NON PRODUCT OWNER (sdncPmDetails1
+		// instead sdncPmDetails1)
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(
+				productDetails_01.getUniqueId(), serviceInstanceToReplaceUniqueId, serviceNewUniqueUid,
+				sdncTesterDetails, ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void changeServiceInstanceVersionProductIsNotCheckOut() throws Exception {
+		// Adding service instance (serviceDetails_01) to product AND --->
+		// saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceToReplaceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// CHANGE Service Instance VERSION for Non checkedOut product
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productOldUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeServiceInstanceVersionResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	// DE191727
+	@Test(enabled = false)
+	public void changeServiceInstanceVersionServiceIsInCheckOutState() throws Exception {
+		// Adding service instance (serviceDetails_01) to product AND --->
+		// saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceToReplaceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// change uniqueId after product check-out in expected Req&Cap
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// CHANGE Service Instance VERSION to service in checkOut state
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(
+				productDetails_01.getUniqueId(), serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1,
+				ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(serviceNewUniqueUid);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), varibales,
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+
+	}
+
+	@Test
+	public void changeServiceInstanceVersionServiceInstanceDoesNotExist() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// change service instance to newer version
+		String serviceUniqueUidNotExist = "1234567890";
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceUniqueUidNotExist, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(serviceUniqueUidNotExist);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND.name(), varibales,
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	// DE189392
+	@Test(enabled = false)
+	public void changeServiceInstanceNonExistingProduct() throws Exception {
+		// Adding service instance (serviceDetails_01) to product saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// change service instance to newer version - Non existing Product
+		String productNewUniqueIdNotExist = "1234567890";
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueIdNotExist,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(productNewUniqueIdNotExist);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_NOT_FOUND.name(), varibales,
+				changeServiceInstanceVersionResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void changeServiceInstanceVersionToNonExisitingServiceVersion() throws Exception {
+		// Adding service instance (serviceDetails_01) to product saving Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		updateNewComponentInstanceId(createServiceInstanceResp, productNewUniqueId);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// change service instance to Non-existing version
+		String serviceUniqueUidNotExist = "1234567890";
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceUniqueUidNotExist, sdncPmDetails1, ComponentTypeEnum.PRODUCT,
+				true);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(serviceUniqueUidNotExist);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), varibales,
+				changeServiceInstanceVersionResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void changeServiceInstanceComponentTypeIsNotProduct() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version for NON-Component Type =
+		// Product (e.g. service)
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.SERVICE, true);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), varibales,
+				changeServiceInstanceVersionResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void changeServiceInstanceComponentTypeNotSupported() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version for NON-Component Type =
+		// Product (e.g. service)
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1,
+				ComponentTypeEnum.SERVICE_INSTANCE, true);
+		assertEquals("Check response code ", STATUS_CODE_UNSUPPORTED_ERROR,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("null");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.UNSUPPORTED_ERROR.name(), varibales,
+				changeServiceInstanceVersionResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void SeveralServiceInstanceFromSameServiceVersionChangeVersionOnlyForOneServiceInstance() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstanceDuringSetup(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		serviceDetails_01.setUniqueId(serviceNewUniqueUid);
+		// get the new VF instance uniqueId after checkout service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01.getUniqueId(), sdncPmDetails1);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		List<ComponentInstance> serviceComponentInstances = service.getComponentInstances();
+		for (ComponentInstance component : serviceComponentInstances) {
+			if (component.getName().equals(firstVfInstanceName)) {
+				firstVfInstanceUniqueId = component.getUniqueId();
+			}
+		}
+		assertTrue(firstVfInstanceUniqueId != null);
+		// delete resource instance (resourceDetailsVF_01) from Service
+		RestResponse deleteVfFromServiceResponse = deleteVFInstanceDuringSetup(firstVfInstanceUniqueId,
+				serviceDetails_01, sdncDesignerDetails);
+		assertTrue(deleteVfFromServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Add different VF instance (resourceDetailsVF_02) to Service
+		RestResponse restResponse = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(restResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get service instance new uniqueId , name and position after checkout
+		// product
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, sdncPmDetails1, ComponentTypeEnum.PRODUCT, true);
+		ProductRestUtils.checkSuccess(changeServiceInstanceVersionResponse);
+		actualServiceInstanceName = ResponseParser.getNameFromResponse(changeServiceInstanceVersionResponse);
+		actualPosX = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posX");
+		actualPosY = ResponseParser.getValueFromJsonResponse(changeServiceInstanceVersionResponse.getResponse(),
+				"posY");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(changeServiceInstanceVersionResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Verify that Service instance name and position didn't change after
+		// changing service instance version
+		assertTrue(actualServiceInstanceName.equals(expectedServiceName));
+		assertTrue(actualPosX.equals(expectedPosX));
+		assertTrue(actualPosY.equals(expectedPosY));
+	}
+
+	@Test
+	public void changeServiceInstanceVersionByNonAsdcUser() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		nonAsdcUser.setUserId("bt760h");
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, nonAsdcUser, ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void changeServiceInstanceVersionEmptyUserId() throws Exception {
+		// Adding service instance (serviceDetails_01) to product without saving
+		// Req&Cap
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01,
+				sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Adding service instance (serviceDetails_02) to product AND ---> Save
+		// Req&Cap
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// check-in product
+		RestResponse changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productOldUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Checkout service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		String serviceNewUniqueUid = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		// Check-In service [0.2]
+		changeStatusResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeStatusResponse);
+		// check-out product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(changeStatusResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		nonAsdcUser.setUserId("");
+		// change service instance to newer version
+		RestResponse changeServiceInstanceVersionResponse = changeServiceInstanceVersion(productNewUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceNewUniqueUid, nonAsdcUser, ComponentTypeEnum.PRODUCT, true);
+		assertEquals("Check response code ", STATUS_CODE_MISSING_INFORMATION,
+				changeServiceInstanceVersionResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), new ArrayList<String>(),
+				changeServiceInstanceVersionResponse.getResponse());
+		// Check-in product
+		changeStatusResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeStatusResponse);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	////////////////////////////////////
+	private void updateNewComponentInstanceId(RestResponse createServiceInstanceResp, String productNewUniqueId)
+			throws Exception {
+		String firstServiceInstanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		RestResponse getProductResponse = ProductRestUtils.getProduct(productNewUniqueId, sdncPmDetails1.getUserId());
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductResponse.getResponse(), Product.class);
+		List<ComponentInstance> componentInstances = product.getComponentInstances();
+		for (ComponentInstance component : componentInstances) {
+			if (component.getNormalizedName().equals(firstServiceInstanceNormalizedName)) {
+				serviceInstanceToReplaceUniqueId = component.getUniqueId();
+				expectedServiceName = component.getName();
+				expectedPosX = component.getPosX();
+				expectedPosY = component.getPosY();
+			}
+		}
+		assertTrue(serviceInstanceToReplaceUniqueId != null);
+	}
+
+	private RestResponse changeResourceStateToCertified(ResourceReqDetails resourceDetails) throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterDetails,
+					LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponse;
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterDetails,
+					LifeCycleStatesEnum.CERTIFY);
+			if (restResponse.getErrorCode() == 200) {
+				String newVersion = ResponseParser.getVersionFromResponse(restResponse);
+				resourceDetails.setVersion(newVersion);
+				resourceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
+				resourceDetails.setLastUpdaterUserId(sdncTesterDetails.getUserId());
+				resourceDetails.setLastUpdaterFullName(sdncTesterDetails.getFullName());
+				String uniqueIdFromRresponse = ResponseParser.getValueFromJsonResponse(restResponse.getResponse(),
+						"uniqueId");
+				resourceDetails.setUniqueId(uniqueIdFromRresponse);
+			}
+		}
+		return restResponse;
+	}
+
+	private void certifyVf(ResourceReqDetails resource, ResourceReqDetails computeResource,
+			ResourceReqDetails cpResource) throws Exception {
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, cpResource,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, computeResource,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails,
+				sdncDesignerDetails, resource.getUniqueId());
+		ResourceRestUtils.checkSuccess(response);
+
+		String capOwnerId = toCompInstId;
+		User user = sdncDesignerDetails;
+		ComponentTypeEnum containerCompType = ComponentTypeEnum.RESOURCE;
+
+		fulfillCpRequirement(resource, fromCompInstId, toCompInstId, capOwnerId, user, containerCompType);
+
+		RestResponse changeResourceStateToCertified = changeResourceStateToCertified(resource);
+		ResourceRestUtils.checkSuccess(changeResourceStateToCertified);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java
new file mode 100644
index 0000000..623b29b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java
@@ -0,0 +1,200 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.PRODUCT_COMPONENT_TYPE;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.testng.annotations.BeforeMethod;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+public abstract class ProductBaseTest extends ComponentBaseTest {
+	User productStrategistUser1;
+	User productStrategistUser2;
+	User productStrategistUser3;
+	User productManager1;
+	User productManager2;
+	User adminUser;
+	User designerUser;
+
+	// Category1->Subcategory1->Grouping1
+	protected List<CategoryDefinition> defaultCategories;
+
+	protected static String auditAction;
+	protected static ComponentOperationEnum operation;
+
+	public ProductBaseTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	@BeforeMethod
+	public void beforeProductTest() throws IOException, Exception {
+		productStrategistUser1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+		productStrategistUser2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST2);
+		productStrategistUser3 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST3);
+		productManager1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		productManager2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER2);
+		adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		createDefaultChain();
+	}
+
+	private void createDefaultChain() throws Exception {
+		CategoryDefinition productCategoryDefinition = ElementFactory.getDefaultCategory();
+		SubCategoryDefinition productSubCategoryDefinition = ElementFactory.getDefaultSubCategory();
+		GroupingDefinition productGroupingDefinition = ElementFactory.getDefaultGroup();
+		productCategoryDefinition.addSubCategory(productSubCategoryDefinition);
+		productSubCategoryDefinition.addGrouping(productGroupingDefinition);
+		List<CategoryDefinition> definitionsList = new ArrayList<>();
+		definitionsList.add(productCategoryDefinition);
+		defaultCategories = createCategoriesChain(definitionsList);
+	}
+
+	private List<CategoryDefinition> createCategoriesChain(List<CategoryDefinition> categoryDefinitions)
+			throws Exception {
+		for (CategoryDefinition categoryDefinition : categoryDefinitions) {
+			RestResponse createCategory = CategoryRestUtils.createCategory(categoryDefinition, productStrategistUser1,
+					PRODUCT_COMPONENT_TYPE);
+			int status = createCategory.getErrorCode().intValue();
+			if (status == BaseRestUtils.STATUS_CODE_CREATED) {
+				String categoryId = ResponseParser.getUniqueIdFromResponse(createCategory);
+				categoryDefinition.setUniqueId(categoryId);
+			}
+			List<SubCategoryDefinition> subcategories = categoryDefinition.getSubcategories();
+			for (SubCategoryDefinition subCategoryDefinition : subcategories) {
+				RestResponse createSubCategory = CategoryRestUtils.createSubCategory(subCategoryDefinition,
+						categoryDefinition, productStrategistUser1, PRODUCT_COMPONENT_TYPE);
+				status = createSubCategory.getErrorCode().intValue();
+				if (status == BaseRestUtils.STATUS_CODE_CREATED) {
+					String subCategoryId = ResponseParser.getUniqueIdFromResponse(createSubCategory);
+					subCategoryDefinition.setUniqueId(subCategoryId);
+				}
+				List<GroupingDefinition> groupings = subCategoryDefinition.getGroupings();
+				for (GroupingDefinition groupingDefinition : groupings) {
+					RestResponse createGroupingRest = CategoryRestUtils.createGrouping(groupingDefinition,
+							subCategoryDefinition, categoryDefinition, productStrategistUser1, PRODUCT_COMPONENT_TYPE);
+					status = createGroupingRest.getErrorCode().intValue();
+					if (status == BaseRestUtils.STATUS_CODE_CREATED) {
+						String groupingId = ResponseParser.getUniqueIdFromResponse(createGroupingRest);
+						groupingDefinition.setUniqueId(groupingId);
+					}
+				}
+			}
+		}
+		RestResponse allCategories = CategoryRestUtils.getAllCategories(productStrategistUser1, PRODUCT_COMPONENT_TYPE);
+		Gson gson = new Gson();
+		List<CategoryDefinition> res = gson.fromJson(allCategories.getResponse(),
+				new TypeToken<List<CategoryDefinition>>() {
+				}.getType());
+		return res;
+	}
+
+	// Category1->Subcategory1->[Grouping1, Grouping11]
+	protected List<CategoryDefinition> addSecondGroupingToDefaultCategory() throws Exception {
+		GroupingDefinition productGroupingDefinition = ElementFactory.getDefaultGroup();
+		productGroupingDefinition.setName("Grouping11");
+		defaultCategories.get(0).getSubcategories().get(0).addGrouping(productGroupingDefinition);
+		return createCategoriesChain(defaultCategories);
+	}
+
+	// Category1->[Subcategory1->[Grouping1,
+	// Grouping11],Subcategory2->[Grouping12]]
+	protected List<CategoryDefinition> addSubcategoryAndGroupingToDefaultCategory() throws Exception {
+		GroupingDefinition groupingDefinition1 = ElementFactory.getDefaultGroup();
+		groupingDefinition1.setName("Grouping11");
+		defaultCategories.get(0).getSubcategories().get(0).addGrouping(groupingDefinition1);
+
+		SubCategoryDefinition subCategory2 = ElementFactory.getDefaultSubCategory();
+		subCategory2.setName("Subcategory2");
+		GroupingDefinition groupingDefinition2 = ElementFactory.getDefaultGroup();
+		groupingDefinition2.setName("Grouping12");
+		subCategory2.addGrouping(groupingDefinition2);
+		defaultCategories.get(0).addSubCategory(subCategory2);
+		return createCategoriesChain(defaultCategories);
+	}
+
+	// [Category1->[Subcategory1->[Grouping1,
+	// Grouping11],Subcategory2->[Grouping12]],
+	// Category2->[Subcategory1->[Grouping1],Subcategory2->[Grouping1]],
+	// Category3->[Subcategory1->[Grouping11],Subcategory2->[Grouping11,
+	// Grouping22]]]
+	protected List<CategoryDefinition> addManyGroupingsDiffCategories() throws Exception {
+		CategoryDefinition category2 = ElementFactory.getDefaultCategory();
+		category2.setName("Category2");
+		CategoryDefinition category3 = ElementFactory.getDefaultCategory();
+		category3.setName("Category3");
+		SubCategoryDefinition subCategory1 = ElementFactory.getDefaultSubCategory();
+		subCategory1.setName("Subcategory1");
+		SubCategoryDefinition subCategory2 = ElementFactory.getDefaultSubCategory();
+		subCategory2.setName("Subcategory2");
+		SubCategoryDefinition subCategory1_2 = ElementFactory.getDefaultSubCategory();
+		subCategory1_2.setName("Subcategory1");
+		SubCategoryDefinition subCategory2_2 = ElementFactory.getDefaultSubCategory();
+		subCategory2_2.setName("Subcategory2");
+		SubCategoryDefinition subCategory1_3 = ElementFactory.getDefaultSubCategory();
+		subCategory1_3.setName("Subcategory1");
+		SubCategoryDefinition subCategory2_3 = ElementFactory.getDefaultSubCategory();
+		subCategory2_3.setName("Subcategory2");
+
+		GroupingDefinition groupingDefinition1 = ElementFactory.getDefaultGroup();
+		groupingDefinition1.setName("Grouping1");
+		GroupingDefinition groupingDefinition11 = ElementFactory.getDefaultGroup();
+		groupingDefinition11.setName("Grouping11");
+		GroupingDefinition groupingDefinition12 = ElementFactory.getDefaultGroup();
+		groupingDefinition12.setName("Grouping12");
+		GroupingDefinition groupingDefinition22 = ElementFactory.getDefaultGroup();
+		groupingDefinition22.setName("Grouping22");
+
+		defaultCategories.get(0).getSubcategories().get(0).addGrouping(groupingDefinition11);
+		subCategory2.addGrouping(groupingDefinition12);
+		defaultCategories.get(0).addSubCategory(subCategory2);
+
+		defaultCategories.add(category2);
+		defaultCategories.add(category3);
+		category2.addSubCategory(subCategory1_2);
+		category2.addSubCategory(subCategory2_2);
+		subCategory1_2.addGrouping(groupingDefinition1);
+		subCategory2_2.addGrouping(groupingDefinition1);
+		category3.addSubCategory(subCategory1_3);
+		category3.addSubCategory(subCategory2_3);
+		subCategory1_3.addGrouping(groupingDefinition11);
+		subCategory2_3.addGrouping(groupingDefinition11);
+		subCategory2_3.addGrouping(groupingDefinition22);
+		return createCategoriesChain(defaultCategories);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java
new file mode 100644
index 0000000..1820315
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java
@@ -0,0 +1,199 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.enums.AuditJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class ProductCheckinTest extends ProductLifecycleTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ProductCheckinTest() {
+		super(name, ProductCheckinTest.class.getName());
+	}
+
+	@BeforeClass
+	public static void staticInit() {
+		auditAction = CHECKIN_ACTION;
+		operation = ComponentOperationEnum.CHANGE_STATE_CHECKIN;
+	}
+
+	@Test
+	public void checkInProductByCreator() throws Exception {
+
+		String checkinComment = "good checkin";
+		RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN, checkinComment);
+		assertEquals("Check response code after checkin resource", 200, checkInResponse.getErrorCode().intValue());
+		Product checkedInProduct = ResponseParser.parseToObjectUsingMapper(checkInResponse.getResponse(),
+				Product.class);
+
+		expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedInProduct, operation);
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedInProduct,
+				auditAction, productManager1, ActionStatus.OK, "0.1", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, checkedInProduct.getUUID());
+		expectedProductAudit.setCOMMENT(checkinComment);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction, AuditJsonKeysEnum.COMMENT);
+	}
+
+	@Test
+	public void checkInProductByPM() throws Exception {
+
+		String checkinComment = "good checkin";
+		RestResponse response = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN, checkinComment);
+		assertEquals("Check response code after checkin resource", 200, response.getErrorCode().intValue());
+
+		User checkoutUser = productManager2;
+		response = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkin resource", 200, response.getErrorCode().intValue());
+		expectedProduct = ResponseParser.parseToObjectUsingMapper(response.getResponse(), Product.class);
+
+		DbUtils.cleanAllAudits();
+		checkinComment = "good checkin no 2";
+		response = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKIN,
+				checkinComment);
+		assertEquals("Check response code after checkin resource", 200, response.getErrorCode().intValue());
+
+		Product checkedInProduct = ResponseParser.parseToObjectUsingMapper(response.getResponse(), Product.class);
+
+		expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		expectedProduct.setVersion("0.2");
+		expectedProduct.setLastUpdaterUserId(checkoutUser.getUserId());
+		expectedProduct.setLastUpdaterFullName(checkoutUser.getFullName());
+
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedInProduct, operation);
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedInProduct,
+				auditAction, checkoutUser, ActionStatus.OK, "0.2", "0.2", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, checkedInProduct.getUUID());
+		expectedProductAudit.setCOMMENT(checkinComment);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction, AuditJsonKeysEnum.COMMENT);
+	}
+
+	@Test
+	public void checkInProductByAdmin() throws Exception {
+
+		String checkinComment = "good checkin";
+		RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, adminUser,
+				LifeCycleStatesEnum.CHECKIN, checkinComment);
+		assertEquals("Check response code after checkin resource", 200, checkInResponse.getErrorCode().intValue());
+		Product checkedInProduct = ResponseParser.parseToObjectUsingMapper(checkInResponse.getResponse(),
+				Product.class);
+
+		expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		expectedProduct.setLastUpdaterUserId(adminUser.getUserId());
+		expectedProduct.setLastUpdaterFullName(adminUser.getFullName());
+
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedInProduct, operation);
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedInProduct,
+				auditAction, adminUser, ActionStatus.OK, "0.1", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, checkedInProduct.getUUID());
+		expectedProductAudit.setCOMMENT(checkinComment);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction, AuditJsonKeysEnum.COMMENT);
+	}
+
+	@Test
+	public void checkInProductByPMNotOwner() throws Exception {
+
+		RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager2,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 403, checkInResponse.getErrorCode().intValue());
+		String[] auditParameters = new String[] { expectedProduct.getName(), "product", productManager1.getFirstName(),
+				productManager1.getLastName(), productManager1.getUserId() };
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, productManager2, ActionStatus.COMPONENT_CHECKOUT_BY_ANOTHER_USER, "0.1", "0.1",
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				expectedProduct.getUUID(), auditParameters);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	@Test
+	public void checkInProductByPsRoleNotAllowed() throws Exception {
+
+		RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productStrategistUser1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 409, checkInResponse.getErrorCode().intValue());
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, productStrategistUser1, ActionStatus.RESTRICTED_OPERATION, "0.1", "0.1",
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				expectedProduct.getUUID());
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	@Test
+	public void checkInProductNotExist() throws Exception {
+		String notExisitingUuid = "1234";
+		expectedProduct.setUniqueId(notExisitingUuid);
+		RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 404, checkInResponse.getErrorCode().intValue());
+		String[] auditParameters = new String[] { "", "product" };
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, productManager1, ActionStatus.PRODUCT_NOT_FOUND, Constants.EMPTY_STRING,
+				Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, auditParameters);
+		expectedProductAudit.setCURR_STATE(Constants.EMPTY_STRING);
+		expectedProductAudit.setRESOURCE_NAME(notExisitingUuid);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	@Test
+	public void checkInProductAlreadyCheckedIn() throws Exception {
+		RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 200, checkInResponse.getErrorCode().intValue());
+		DbUtils.cleanAllAudits();
+		checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager2,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 409, checkInResponse.getErrorCode().intValue());
+		String[] auditParameters = new String[] { expectedProduct.getName(), "product", productManager1.getFirstName(),
+				productManager1.getLastName(), productManager1.getUserId() };
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, productManager2, ActionStatus.COMPONENT_ALREADY_CHECKED_IN, "0.1", "0.1",
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
+				expectedProduct.getUUID(), auditParameters);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java
new file mode 100644
index 0000000..efb4a15
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java
@@ -0,0 +1,147 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.FileNotFoundException;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class ProductCheckoutTest extends ProductLifecycleTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	@BeforeClass
+	public static void staticInit() {
+		auditAction = CHECKOUT_ACTION;
+		operation = ComponentOperationEnum.CHANGE_STATE_CHECKOUT;
+	}
+
+	public ProductCheckoutTest() {
+		super(name, ProductCheckoutTest.class.getName());
+	}
+
+	@Test
+	public void checkOutProductByPmNotInContacts() throws Exception {
+		checkOutProductSuccess(productManager2);
+	}
+
+	@Test
+	public void checkOutProductByPmInContacts() throws Exception {
+		checkOutProductSuccess(productManager1);
+	}
+
+	@Test
+	public void checkOutProductByAdmin() throws Exception {
+		checkOutProductSuccess(adminUser);
+	}
+
+	@Test
+	public void checkOutProductByPs() throws Exception {
+		// Changed in 1604 patch - now it's restricted
+		checkOutProductRestricted(productStrategistUser3);
+		// checkOutProductSuccess(productStrategistUser3);
+	}
+
+	@Test
+	public void checkOutProductByDesignerRoleNotAllowed() throws Exception {
+		checkOutProductRestricted(designerUser);
+	}
+
+	@Test
+	public void checkOutProductAlreadyCheckedOut() throws Exception {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
+		Product checkedOutProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+
+		DbUtils.cleanAllAudits();
+
+		lcsResponse = LifecycleRestUtils.changeProductState(checkedOutProduct, productManager2, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkin resource", 403, lcsResponse.getErrorCode().intValue());
+		String[] auditParameters = new String[] { checkedOutProduct.getName(), "product", productManager1.getFirstName(), productManager1.getLastName(), productManager1.getUserId() };
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedOutProduct, auditAction, productManager2, ActionStatus.COMPONENT_IN_CHECKOUT_STATE, "0.2", "0.2", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, checkedOutProduct.getUUID(), auditParameters);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	private void checkOutProductSuccess(User checkoutUser) throws Exception, FileNotFoundException {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
+
+		// 0.1 is not highest now
+		RestResponse prevVersionProductResp = ProductRestUtils.getProduct(expectedProduct.getUniqueId(), productStrategistUser1.getUserId());
+		Product prevVersionProduct = ResponseParser.parseToObjectUsingMapper(prevVersionProductResp.getResponse(), Product.class);
+		Boolean falseParam = false;
+		assertEquals(falseParam, prevVersionProduct.isHighestVersion());
+
+		Product checkedOutProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+
+		expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+		expectedProduct.setVersion("0.2");
+		expectedProduct.setLastUpdaterUserId(checkoutUser.getUserId());
+		expectedProduct.setLastUpdaterFullName(checkoutUser.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedOutProduct, operation);
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedOutProduct, auditAction, checkoutUser, ActionStatus.OK, "0.1", "0.2", LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, checkedOutProduct.getUUID());
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	private void checkOutProductRestricted(User checkoutUser) throws Exception, FileNotFoundException {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkin resource", 409, lcsResponse.getErrorCode().intValue());
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct, auditAction, checkoutUser, ActionStatus.RESTRICTED_OPERATION, "0.1", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, expectedProduct.getUUID());
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductComponentInstanceCRUDTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductComponentInstanceCRUDTest.java
new file mode 100644
index 0000000..5968258
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductComponentInstanceCRUDTest.java
@@ -0,0 +1,1175 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_ALREADY_EXISTS;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_MISSING_INFORMATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_NOT_FOUND;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS_DELETE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class ProductComponentInstanceCRUDTest extends ComponentInstanceBaseTest {
+
+	protected ArtifactReqDetails heatArtifactDetails;
+	@Rule
+	public static TestName name = new TestName();
+
+	public ProductComponentInstanceCRUDTest() {
+		super(name, ProductComponentInstanceCRUDTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+		init();
+		createComponents();
+	}
+
+	private void createComponents() throws Exception {
+
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		createAtomicResource(resourceDetailsVFC_01);
+		changeResourceStateToCertified(resourceDetailsVFC_01);
+		createAtomicResource(resourceDetailsCP_01);
+		changeResourceStateToCertified(resourceDetailsCP_01);
+		createAtomicResource(resourceDetailsVL_01);
+		changeResourceStateToCertified(resourceDetailsVL_01);
+		createAtomicResource(resourceDetailsVFC_02);
+		changeResourceStateToCertified(resourceDetailsVFC_02);
+		createAtomicResource(resourceDetailsCP_02);
+		changeResourceStateToCertified(resourceDetailsCP_02);
+		createAtomicResource(resourceDetailsVL_02);
+		changeResourceStateToCertified(resourceDetailsVL_02);
+		createVF(resourceDetailsVF_02);
+		createVF(resourceDetailsVF_01);
+		// create check-In services
+		createService(serviceDetails_01);
+		createService(serviceDetails_02);
+		createService(serviceDetails_03);
+		createProduct(productDetails_01);
+		createProduct(productDetails_02);
+
+		// addresourceDetailsCP_02 ,resourceDetailsVFC_02 and
+		// resourceDetailsVL_02 to resourceDetailsVF_02 check-in VF
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resourceDetailsVF_02, resourceDetailsVFC_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resourceDetailsVF_02, resourceDetailsCP_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resourceDetailsVF_02, resourceDetailsVL_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		resourceDetailsVF_02.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		// addresourceDetailsCP_01 ,resourceDetailsVFC_01 and
+		// resourceDetailsVL_01 to resourceDetailsVF_01 and certify
+		// resourceDetailsVF_01
+		certifyVf(resourceDetailsVF_01);
+		createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails); // serviceDetails_01
+																									// has
+																									// certified
+																									// VF
+		createVFInstanceDuringSetup(serviceDetails_02, resourceDetailsVF_02, sdncDesignerDetails); // serviceDetails_02
+																									// has
+																									// check-in
+																									// VF
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_02, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+	}
+
+	// pass
+	@Test
+	public void createServiceInstanceTest() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	// DE189427
+	@Test(enabled = false)
+	public void createServiceInstanceFromCheckedOutState() throws Exception {
+		// can't create instance of checked-out component
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceInToAnotherServiceInstance() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String uniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, uniqueIdFromResponse, ComponentTypeEnum.PRODUCT);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_NOT_FOUND);
+	}
+
+	@Test
+	public void createSeveralServiceInstanceFromSameServices() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void createSeveralServiceInstanceFromDifferentServices() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void createCertifiedServiceInstance() throws Exception {
+		changeServiceStateToCertified(serviceDetails_01);
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceByPm() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceWithoutVf() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails_03, sdncAdminDetails, "0.1", LifeCycleStatesEnum.CHECKIN);
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_02, serviceDetails_03, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_02, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceByNonProductOwner() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails2);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceByNonAsdcUser() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		User nonExistingSdncUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		;
+		nonExistingSdncUser.setUserId("bt1234");
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, nonExistingSdncUser);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceToNotCheckOutProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	// pass
+	@Test
+	public void createServiceInstanceNameIsEmpty() throws Exception {
+		String expectedServiceInstanceName = serviceDetails_01.getName() + " 1";
+		String expectedServiceInstancenormalizedName = serviceDetails_01.getName() + "1";
+		serviceDetails_01.setName("");
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (expectedServiceInstancenormalizedName).toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", expectedServiceInstanceName, instanceName);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(expectedServiceInstanceName, actualComponentInstance.getName());
+		assertEquals((expectedServiceInstancenormalizedName).toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	// pass
+	@Test
+	public void createServiceInstanceNameIsNull() throws Exception {
+		serviceDetails_01.setName(null);
+		String expectedServiceInstanceName = (serviceDetails_01.getName() != null ? serviceDetails_01.getName() : "resourceInstanceName") + " 1";
+		String expectedServiceInstancenormalizedName = (serviceDetails_01.getName() != null ? serviceDetails_01.getName() : "resourceInstanceName") + "1";
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (expectedServiceInstancenormalizedName).toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", expectedServiceInstanceName, instanceName);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(expectedServiceInstanceName, actualComponentInstance.getName());
+		assertEquals((expectedServiceInstancenormalizedName).toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	@Test(enabled = false)
+	public void createServiceInstanceToNonExistingProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, "blabla", ComponentTypeEnum.PRODUCT);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, createServiceInstanceResp.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("blabla");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PRODUCT_NOT_FOUND.name(), varibales, createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceToNonSupportedComponentType() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.RESOURCE_INSTANCE);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_UNSUPPORTED_ERROR);
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("null");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.UNSUPPORTED_ERROR.name(), varibales, createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	// pass
+	@Test
+	public void createServiceInstancePositionIsEmpty() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		serviceInstanceReqDetails.setPosX("");
+		serviceInstanceReqDetails.setPosY("");
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		ComponentInstance componentInstance = ResponseParser.parseToObjectUsingMapper(createServiceInstanceResp.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstancePositionIsNull() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		serviceInstanceReqDetails.setPosX(null);
+		serviceInstanceReqDetails.setPosY(null);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		ComponentInstance componentInstance = ResponseParser.parseToObjectUsingMapper(createServiceInstanceResp.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.PRODUCT);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceByDesigner() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncDesignerDetails);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void createServiceInstanceUserIdIsEmpty() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		User nonSdncDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		nonSdncDetails.setUserId("");
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, nonSdncDetails);
+		assertTrue(createServiceInstanceResp.getErrorCode() == STATUS_CODE_MISSING_INFORMATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), new ArrayList<String>(), createServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	//// Update Service instance
+
+	@Test
+	public void updateServiceInstanceNameByPm() throws Exception {
+		// Check-in Product by PM and Check-out by PM
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create service instance by PM
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "abcD";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (newName).toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", newName, instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(newName, actualComponentInstance.getName());
+		assertEquals((newName).toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	@Test
+	public void updateServiceInstanceNewNameAndLocation() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "updaatedName100";
+		serviceInstanceReqDetails.setPosX("100");
+		serviceInstanceReqDetails.setPosY("100");
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(serviceInstanceReqDetails.getPosX(), actualComponentInstance.getPosX());
+		assertEquals(serviceInstanceReqDetails.getPosY(), actualComponentInstance.getPosY());
+		assertEquals(newName, actualComponentInstance.getName());
+		assertEquals(newName.toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	@Test(enabled = false)
+	public void updateServiceInstanceNameRemoveSpacesFromBiginningAndEnd() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "  Abcd   ";
+		String expectedNewName = "  Abcd   ";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (expectedNewName).toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", expectedNewName, instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(expectedNewName, actualComponentInstance.getName());
+		assertEquals((expectedNewName).toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	// pass
+	@Test
+	public void updateServiceInstanceNameAllowedCharacters() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "cier-TYUIOP_asd_0987654321.Abcd";
+		String ExpectedNormalizName = "ciertyuiop_asd_0987654321abcd";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", ExpectedNormalizName, instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", newName, instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(newName, actualComponentInstance.getName());
+		assertEquals(ExpectedNormalizName, actualComponentInstance.getNormalizedName());
+
+	}
+
+	@Test
+	public void updateInstanceNameInvalidCharacters() throws Exception {
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/', '|', '\\', ',' };
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "Abcd1";
+		String updateName;
+		for (int i = 0; i < invalidChars.length; i++) {
+			updateName = newName + invalidChars[i];
+			serviceInstanceReqDetails.setName(updateName);
+			RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+			assertEquals("Check response code ", STATUS_CODE_INVALID_CONTENT, updateServiceInstanceResponse.getErrorCode().intValue());
+			ArrayList<String> varibales = new ArrayList<String>();
+			varibales.add("Service Instance");
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPONENT_NAME.name(), varibales, updateServiceInstanceResponse.getResponse());
+		}
+	}
+
+	// pass
+	@Test
+	public void updateInstanceNameMaxLength() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "Qwertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl12345";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (newName).toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", newName, instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(newName, actualComponentInstance.getName());
+		assertEquals((newName).toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	@Test
+	public void updateInstanceNameExceedMaxLength() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String expectedName = ResponseParser.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "name");
+		String expectedNormalizedName = ResponseParser.getValueFromJsonResponse(createServiceInstanceResp.getResponse(), "normalizedName");
+		String newName = "Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ciertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456Ahjklzxcvbnmasdfghjkl123456";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		assertEquals("Check response code ", STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT, updateServiceInstanceResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("Service Instance");
+		varibales.add("1024");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name(), varibales, updateServiceInstanceResponse.getResponse());
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(expectedName, actualComponentInstance.getName());
+		assertEquals(expectedNormalizedName, actualComponentInstance.getNormalizedName());
+	}
+
+	@Test
+	public void updateServiceInstanceNameEmpty() throws Exception {
+		// see US534663 In case a PS/PM removes the current service instance
+		// name then BE has to generate again the "default" service instance
+		// name
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (serviceDetails_01.getName() + "2").toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance normalizedName ", (serviceDetails_01.getName() + " 2"), instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(instanceName, actualComponentInstance.getName());
+		assertEquals(instanceNormalizedName, actualComponentInstance.getNormalizedName());
+	}
+
+	// pass
+	@Test
+	public void updateServiceInstanceNameNull() throws Exception {
+		// see US534663 In case a PS/PM removes the current service instance
+		// name then BE has to generate again the "default" service instance
+		// name
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = null;
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (serviceDetails_01.getName() + "1").toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance normalizedName ", (serviceDetails_01.getName() + " 1"), instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(instanceName, actualComponentInstance.getName());
+		assertEquals(instanceNormalizedName, actualComponentInstance.getNormalizedName());
+	}
+
+	@Test
+	public void updateServiceInstanceCheckedByOtherUser() throws Exception {
+		// see US534663 In case a PS/PM removes the current service instance
+		// name then BE has to generate again the "default" service instance
+		// name
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "blabla";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails2, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION, updateServiceInstanceResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), updateServiceInstanceResponse.getResponse());
+	}
+
+	@Test
+	public void updateServiceInstance_UserIdIsNonAsdcUser() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "blabla";
+		serviceInstanceReqDetails.setName(newName);
+		User nonSdncUserDetails = new User();
+		nonSdncUserDetails.setUserId("bt4567");
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, nonSdncUserDetails, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION, updateServiceInstanceResponse.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), updateServiceInstanceResponse.getResponse());
+	}
+
+	@Test
+	public void updateServiceInstanceNameToAlreadyExisting() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String ServiceName1 = ResponseParser.getNameFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// Update service instance2 name to service instance1
+		serviceInstanceReqDetails.setName(ServiceName1);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		assertEquals("Check response code ", STATUS_CODE_ALREADY_EXISTS, updateServiceInstanceResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("Service Instance");
+		varibales.add(ServiceName1);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name(), varibales, updateServiceInstanceResponse.getResponse());
+	}
+
+	@Test
+	public void updateServiceInstanceForNonExistingProduct() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "blabla";
+		serviceInstanceReqDetails.setName(newName);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, "blablabla", ComponentTypeEnum.PRODUCT);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, updateServiceInstanceResponse.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PRODUCT_NOT_FOUND.name(), varibales, updateServiceInstanceResponse.getResponse());
+
+	}
+
+	@Test
+	public void updateNonExistingServiceInstance() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String newName = "blabla";
+		serviceInstanceReqDetails.setName(newName);
+		serviceInstanceReqDetails.setUniqueId("11111111");
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(newName);
+		varibales.add("service instance");
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, updateServiceInstanceResponse.getErrorCode().intValue());
+		// need to change ActionStatus.RESOURCE_INSTANCE_NOT_FOUND.name() to
+		// ActionStatus.SERVICE_INSTANCE_NOT_FOUND.name()
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND.name(), varibales, updateServiceInstanceResponse.getResponse());
+	}
+
+	@Test
+	public void updateServiceInstanceLocation() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		serviceInstanceReqDetails.setPosX("50");
+		serviceInstanceReqDetails.setPosY("100");
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(serviceInstanceReqDetails.getPosX(), actualComponentInstance.getPosX());
+		assertEquals(serviceInstanceReqDetails.getPosY(), actualComponentInstance.getPosY());
+	}
+
+	@Test
+	public void updateServiceInstanceToNonExistingLocation() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		String nameFromResponse = ResponseParser.getNameFromResponse(createServiceInstanceResp);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		serviceInstanceReqDetails.setPosX("-50");
+		serviceInstanceReqDetails.setPosY("-100");
+		serviceInstanceReqDetails.setName(nameFromResponse);
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(serviceInstanceReqDetails.getPosX(), actualComponentInstance.getPosX());
+		assertEquals(serviceInstanceReqDetails.getPosY(), actualComponentInstance.getPosY());
+		assertEquals(nameFromResponse, actualComponentInstance.getName());
+	}
+
+	@Test (enabled = false)
+	public void updateServiceInstanceLocationNameIsEmpty() throws Exception {
+		String expectedServiceInstanceName = serviceDetails_01.getName() + " 2";
+		String expectedServiceInstancenormalizedName = serviceDetails_01.getName() + "2";
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		serviceInstanceReqDetails.setPosX("100");
+		serviceInstanceReqDetails.setPosY("200");
+		serviceInstanceReqDetails.setName("");
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String nameFromResponse = ResponseParser.getNameFromResponse(updateServiceInstanceResponse);
+		String postX = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "posX");
+		String postY = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "posY");
+		assertEquals(nameFromResponse, expectedServiceInstanceName);
+		assertEquals(postX, "100");
+		assertEquals(postY, "200");
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(serviceInstanceReqDetails.getPosX(), actualComponentInstance.getPosX());
+		assertEquals(serviceInstanceReqDetails.getPosY(), actualComponentInstance.getPosY());
+		assertEquals(nameFromResponse, actualComponentInstance.getName());
+		assertEquals(expectedServiceInstancenormalizedName.toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	// pass
+	@Test
+	public void updateServiceInstanceNameToProductName() throws Exception {
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_01);
+		RestResponse createServiceInstanceResp = ComponentInstanceRestUtils.createComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// ComponentInstance componentInstance =
+		// ResponseParser.parseToObjectUsingMapper(createServiceInstanceResp.getResponse(),
+		// ComponentInstance.class);
+		// addCompInstReqCapToExpected(componentInstance,
+		// ComponentTypeEnum.PRODUCT);
+		serviceInstanceReqDetails.setName(productDetails_01.getName());
+		RestResponse updateServiceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ResourceRestUtils.checkSuccess(updateServiceInstanceResponse);
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateServiceInstanceResponse.getResponse(), "name");
+		assertEquals("check Resource Instance normalizedName ", (serviceInstanceReqDetails.getName()).toLowerCase(), instanceNormalizedName);
+		assertEquals("check Resource Instance Name ", serviceInstanceReqDetails.getName(), instanceName);
+		// get product and verify that service instanceName is correct
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		assertEquals(serviceInstanceReqDetails.getName(), actualComponentInstance.getName());
+		assertEquals((serviceInstanceReqDetails.getName()).toLowerCase(), actualComponentInstance.getNormalizedName());
+	}
+
+	//// Delete Service Instance
+
+	@Test
+	public void deleteAllServiceInstanceFromProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails1);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 0, 0);
+	}
+
+	@Test
+	public void deleteServiceWhileServiceInstanceExistInProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		// Delete service while service instance of it exist in product
+		RestResponse deleteServiceResponse = ServiceRestUtils.deleteServiceById(serviceDetails_01.getUniqueId(), sdncDesignerDetails.getUserId());
+		assertTrue(deleteServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		// Get product and verify that service instance still exists
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		// ComponentInstance actualComponentInstance =
+		// actualProduct.getComponentInstances().get(0);
+		// assertTrue(serviceInstanceUniqueIdFromResponse ==
+		// actualComponentInstance.getUniqueId());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	// pass
+	@Test
+	public void deleteServiceInstanceByPm() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails1);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceByPmCreatedByPm() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		productDetails_01.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails1);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceByPmWhichIsCheckedOutByAnotherPm() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails2);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	// DE190189
+	@Test
+	public void deleteServiceInstanceByPmCreatedByPs() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		String productOldUniqueId = productDetails_01.getUniqueId();
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(restResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get product and get service instance new uniquId
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPmDetails1.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		String serviceInstanceUniqueId = actualComponentInstance.getUniqueId();
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails1);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 0, 0);
+	}
+
+	// DE190189
+	@Test
+	public void deleteServiceInstanceByAdminCreatedByPs() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		String productOldUniqueId = productDetails_01.getUniqueId();
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncAdminDetails, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		String productNewUniqueId = ResponseParser.getUniqueIdFromResponse(restResponse);
+		updateExpectedReqCapAfterChangeLifecycleState(productOldUniqueId, productNewUniqueId);
+		// get product and get service instance new uniquId
+		RestResponse getActualProductResponse = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncAdminDetails.getUserId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getActualProductResponse.getResponse(), Product.class);
+		ComponentInstance actualComponentInstance = actualProduct.getComponentInstances().get(0);
+		String serviceInstanceUniqueId = actualComponentInstance.getUniqueId();
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncAdminDetails);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 0, 0);
+	}
+
+	@Test
+	public void createAndDeleteServiceInstanceByAdmin() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncAdminDetails, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// productDetails_01.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncAdminDetails);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncAdminDetails);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncAdminDetails);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceFromNonCheckOutProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		RestResponse restResponse = LifecycleRestUtils.changeProductState(productDetails_01, sdncPmDetails1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails1);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceByDesigner() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncDesignerDetails);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceByTester() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncTesterDetails);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceByPsWhichIsCheckedOutByAnotherPs() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPsDetails2);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	// pass
+	@Test
+	public void deleteServiceInstanceByNonAsdcUser() throws Exception {
+		User nonExistingSdncUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		;
+		nonExistingSdncUser.setUserId("bt1234");
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, nonExistingSdncUser);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceFromNonExistingProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(sdncPmDetails1, "1234567890", serviceInstanceUniqueId, ComponentTypeEnum.PRODUCT);
+		assertTrue(deleteResourceInstanceResponse.getErrorCode() == STATUS_CODE_NOT_FOUND);
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PRODUCT_NOT_FOUND.name(), varibales, deleteResourceInstanceResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteNonExistingServiceInstanceFromProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		// String serviceInstanceUniqueId =
+		// ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(sdncPmDetails1, productDetails_01.getUniqueId(), "1234567890123456unExistingServiceInstance", ComponentTypeEnum.PRODUCT);
+		assertTrue(deleteResourceInstanceResponse.getErrorCode() == STATUS_CODE_NOT_FOUND);
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("1234567890123456unExistingServiceInstance");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PRODUCT_NOT_FOUND.name(), varibales, deleteResourceInstanceResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceFromNonSupportedComponentType() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(sdncPmDetails1, productDetails_01.getUniqueId(), serviceInstanceUniqueId, ComponentTypeEnum.RESOURCE_INSTANCE);
+		assertTrue(deleteResourceInstanceResponse.getErrorCode() == STATUS_CODE_UNSUPPORTED_ERROR);
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("null");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.UNSUPPORTED_ERROR.name(), varibales, deleteResourceInstanceResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceComponentTypeIsNotProduct() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(sdncPmDetails1, productDetails_01.getUniqueId(), serviceInstanceUniqueId, ComponentTypeEnum.SERVICE);
+		assertTrue(deleteResourceInstanceResponse.getErrorCode() == STATUS_CODE_NOT_FOUND);
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), varibales, deleteResourceInstanceResponse.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteServiceInstanceUserIdIsEmpty() throws Exception {
+		User nonSdncDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		nonSdncDetails.setUserId("");
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, nonSdncDetails);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_MISSING_INFORMATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), new ArrayList<String>(), deleteServiceInstanceResp.getResponse());
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	@Test
+	public void deleteCertifiedServiceInstance() throws Exception {
+		changeServiceStateToCertified(serviceDetails_01);
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(serviceInstanceUniqueId, productDetails_01, sdncPmDetails1);
+		assertTrue(deleteServiceInstanceResp.getErrorCode() == STATUS_CODE_SUCCESS_DELETE);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+	}
+
+	////////////////////////////////////
+
+	private void certifyVf(ResourceReqDetails resource) throws Exception {
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String cpCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, resourceDetailsVFC_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String computeCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String vlCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		// Fixing Vl/Cp req/cap
+		ComponentTypeEnum containerCompType = ComponentTypeEnum.RESOURCE;
+		User user = sdncDesignerDetails;
+		fulfillCpRequirement(resource, cpCompInstId, computeCompInstId, computeCompInstId, user, containerCompType);
+		consumeVlCapability(resource, cpCompInstId, vlCompInstId, cpCompInstId, user, containerCompType);
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails, resource.getUniqueId());
+		ResourceRestUtils.checkSuccess(response);
+		RestResponse changeResourceStateToCertified = changeResourceStateToCertified(resource);
+		ResourceRestUtils.checkSuccess(changeResourceStateToCertified);
+	}
+
+	private RestResponse changeResourceStateToCertified(ResourceReqDetails resourceDetails) throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterDetails, LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponse;
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterDetails, LifeCycleStatesEnum.CERTIFY);
+			if (restResponse.getErrorCode() == 200) {
+				String newVersion = ResponseParser.getVersionFromResponse(restResponse);
+				resourceDetails.setVersion(newVersion);
+				resourceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
+				resourceDetails.setLastUpdaterUserId(sdncTesterDetails.getUserId());
+				resourceDetails.setLastUpdaterFullName(sdncTesterDetails.getFullName());
+				String uniqueIdFromRresponse = ResponseParser.getValueFromJsonResponse(restResponse.getResponse(), "uniqueId");
+				resourceDetails.setUniqueId(uniqueIdFromRresponse);
+			}
+		}
+		return restResponse;
+	}
+
+	private RestResponse changeServiceStateToCertified(ServiceReqDetails serviceDetails) throws Exception {
+		/*
+		 * RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN); ResourceRestUtils.checkSuccess(restResponse);
+		 */
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDetails, LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponse;
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDetails, LifeCycleStatesEnum.CERTIFY);
+			if (restResponse.getErrorCode() == 200) {
+				serviceDetails.setVersion("1.0");
+				serviceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
+				serviceDetails.setLastUpdaterUserId(sdncTesterDetails.getUserId());
+				serviceDetails.setLastUpdaterFullName(sdncTesterDetails.getFullName());
+				String uniqueIdFromRresponse = ResponseParser.getValueFromJsonResponse(restResponse.getResponse(), "uniqueId");
+				serviceDetails.setUniqueId(uniqueIdFromRresponse);
+			}
+		}
+		return restResponse;
+	}
+
+	@Test
+	public void deleteServiceInstanceTest() throws Exception {
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+
+		createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_02, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 2, 0);
+		String compInstId2 = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+
+		RestResponse deleteServiceInstanceResp = deleteServiceInstance(compInstId, productDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkDeleteResponse(deleteServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 1, 0);
+
+		deleteServiceInstanceResp = deleteServiceInstance(compInstId2, productDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkDeleteResponse(deleteServiceInstanceResp);
+		getComponentAndValidateRIs(productDetails_01, 0, 0);
+	}
+
+	@Test
+	public void returnedServiceInstanceTypeAttributeTest() throws Exception {
+		String expectedServiceType = ComponentTypeEnum.SERVICE.getValue().toUpperCase();
+
+		RestResponse createServiceInstanceResp = createServiceInstance(productDetails_01, serviceDetails_01, sdncPmDetails1);
+		ResourceRestUtils.checkCreateResponse(createServiceInstanceResp);
+		String serviceUniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(createServiceInstanceResp);
+		ComponentInstanceRestUtils.checkComponentInstanceType(createServiceInstanceResp, expectedServiceType);
+
+		RestResponse getProductResp = ProductRestUtils.getProduct(productDetails_01.getUniqueId(), sdncPsDetails1.getUserId());
+		ProductRestUtils.checkSuccess(getProductResp);
+		Product productObject = ResponseParser.parseToObjectUsingMapper(getProductResp.getResponse(), Product.class);
+		List<ComponentInstance> productComponentInstances = productObject.getComponentInstances();
+		for (ComponentInstance comp : productComponentInstances) {
+			String actualOriginType = comp.getOriginType().getValue().toUpperCase();
+			assertTrue(expectedServiceType.equals(actualOriginType));
+		}
+
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory.getComponentResourceInstance(serviceDetails_02);
+		serviceInstanceReqDetails.setUniqueId(serviceUniqueIdFromResponse);
+		serviceInstanceReqDetails.setComponentUid(serviceDetails_01.getUniqueId());
+		RestResponse updateResourceInstance = ComponentInstanceRestUtils.updateComponentInstance(serviceInstanceReqDetails, sdncPmDetails1, productDetails_01.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		ComponentInstanceRestUtils.checkSuccess(updateResourceInstance);
+		ComponentInstanceRestUtils.checkComponentInstanceType(updateResourceInstance, expectedServiceType);
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java
new file mode 100644
index 0000000..45d3b23
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java
@@ -0,0 +1,1718 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.Arrays;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.testng.annotations.Test;
+
+public class ProductCreateWithValidationsTest extends ProductBaseTest {
+	@Rule
+	public static TestName name = new TestName();
+
+	public static String INITIAL_PRODUCT_VERSION = "0.1";
+	public static String CREATE_AUDIT_ACTION = "Create";
+	public String normalizedName;
+
+	public ProductCreateWithValidationsTest() {
+		super(name, ProductCreateWithValidationsTest.class.getName());
+	}
+
+	@Test // (enabled = false)
+	public void createProductSuccessValidation() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNotByPmUser() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productStrategistUser1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				productStrategistUser1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productStrategistUser1, ActionStatus.RESTRICTED_OPERATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNotByAsdcUser() throws Exception {
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		nonAsdcUser.setUserId("bt750k");
+		nonAsdcUser.setFirstName(null);
+		nonAsdcUser.setLastName(null);
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, nonAsdcUser);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				nonAsdcUser);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, nonAsdcUser, ActionStatus.RESTRICTED_OPERATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductUserIdIsEmpty() throws Exception {
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		nonAsdcUser.setUserId("");
+		nonAsdcUser.setFirstName(null);
+		nonAsdcUser.setLastName(null);
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, nonAsdcUser);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_MISSING_INFORMATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				nonAsdcUser);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, nonAsdcUser, ActionStatus.MISSING_INFORMATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNameValidationLessThanMinCharacters() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("Pro");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
+				null, null, Constants.EMPTY_STRING, "Product", "abbreviated");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductNameValidationMaxLength() throws Exception {
+		// Max length = 25
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+//		productReqDetails.setName("Qwertyuiop1234567890asdfA");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNameValidationExceedMaxLength() throws Exception {
+		// Max length = 25
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("Qwertyuiop1234567890asdfAa");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
+				null, null, Constants.EMPTY_STRING, "Product", "abbreviated");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNameValidationEmptyName() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
+				"abbreviated");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductNameAlreadyExist() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		// // productReqDetails.setName("CIProduct1");
+		DbUtils.deleteFromEsDbByPattern("_all");
+		createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_ALREADY_EXISTS,
+				createProduct.getErrorCode().intValue());
+		productReqDetails.setVersion("0.1");
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_NAME_ALREADY_EXIST,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
+				productReqDetails.getName());
+		constructFieldsForAuditValidation.setCURR_VERSION("0.1");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		constructFieldsForAuditValidation.setCURR_STATE("NOT_CERTIFIED_CHECKOUT");
+		constructFieldsForAuditValidation.setSERVICE_INSTANCE_ID(null);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNameValidationNameIsNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName(null);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
+				"abbreviated");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	// DE193857
+	@Test (enabled = false)
+	public void createProductNameValidationAllowedCharacters() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("Ci_2@3:4& m=n+b-u.j-u'g#b"); // Bug @:&=+'#
+		normalizedName = "ci234mnbujugb";
+		String expectedProductName = "Ci_2@3:4& M=n+b-u.j-u'g#b";
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		productReqDetails.setName(expectedProductName);
+		productReqDetails.setName("Ci_2@3:4& M=n+b-u.j-u'g#b");
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setNormalizedName(normalizedName);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	// DE193857
+	@Test
+	public void createProductNameValidationREmoveExtraNonAlphanumericChars() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("Ci____222----333......asd");
+//		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setName("Ci_222-333.asd");
+		normalizedName = "ci222333asd";
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNameValidationNotAllowedCharacters() throws Exception {
+		ExpectedProductAudit constructFieldsForAuditValidation;
+		char invalidChars[] = { '~', '!', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/', '|',
+				'\\', ',', '$' };
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+			productReqDetails.setName("abc" + invalidChars[i]);
+			RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+			assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+					createProduct.getErrorCode().intValue());
+			Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "",
+					productManager1);
+			constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(expectedProduct,
+					CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT,
+					Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
+					"abbreviated");
+			constructFieldsForAuditValidation.setCURR_VERSION("");
+			constructFieldsForAuditValidation.setCURR_STATE("");
+			AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+		}
+	}
+
+	@Test
+	public void createProductFullNameContainSpecialCharacters() throws Exception {
+		char invalidChars[] = { '~', '!', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/', '|',
+				'\\', ',', '$' };
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		for (int i = 0; i < invalidChars.length; i++) {
+			DbUtils.deleteFromEsDbByPattern("_all");
+			productReqDetails.setFullName("abc" + invalidChars[i]);
+			RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+			assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_CREATED,
+					createProduct.getErrorCode().intValue());
+			RestResponse deleteProduct = ProductRestUtils.deleteProduct(productReqDetails.getUniqueId(),
+					productManager1.getUserId());
+			assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
+					deleteProduct.getErrorCode().intValue());
+		}
+	}
+
+	// Already enabled = false
+	@Test
+	public void createProductNameValidationRemoveSpaceFromBeginning() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("         Ciertyuiop1234567890asdfA");
+//		productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
+		normalizedName = productReqDetails.getName().trim().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		productReqDetails.setName("         Ciertyuiop1234567890asdfA".trim());
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	// Already enabled = false
+	@Test
+	public void createProductNameValidationRemoveSpaceFromTheEnd() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("Ciertyuiop1234567890asdfA        ");
+//		productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
+		normalizedName = productReqDetails.getName().trim().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		productReqDetails.setName("Ciertyuiop1234567890asdfA        ".trim());
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductNameValidationStartWithNumber() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("1Qwert");
+//		productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
+		normalizedName = productReqDetails.getName().trim().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+		productReqDetails.setName("Ci1Qwert");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		
+	}
+
+	@Test
+	public void createProductNameValidationStartWithNonAlphaNumeric() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("_Qwert");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
+		normalizedName = productReqDetails.getName().trim().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
+				null, null, Constants.EMPTY_STRING, "Product", "abbreviated");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductNameValidationFirstLetterOfKeyWordsCapitalized() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		// productReqDetails.setTags(Arrays.asList("abba"));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		// // productReqDetails.setName("Abba");
+		/*
+		 * String actualNormalizedNameFromResponse =
+		 * ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
+		 * "normalizedName");
+		 * assertTrue(actualNormalizedNameFromResponse.equals(normalizedName));
+		 */
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductFullNameValidationIsEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setFullName("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "full");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductFullNameValidationIsNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setFullName("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "full");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductFullNameLessThanMinLength() throws Exception {
+		// Min is 4 characters
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setFullName("abc");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
+				null, null, Constants.EMPTY_STRING, "Product", "full");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductFullNameHasMinLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setFullName("abcd");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductFullNameHasMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setFullName(
+				"Abba1234567890asdfghjk l123zxcvbnm432adfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductFullNameExceedMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setFullName(
+				"Abba1234567890asdfghjk l123zxcvbnm432adfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.123");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1,
+				ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
+				null, null, Constants.EMPTY_STRING, "Product", "full");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductFullNameRemoveExtraSpaces() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setFullName("Abbaaa  a1");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setFullName("Abbaaa a1");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductDescriptionValidationIsEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setDescription("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_DESCRIPTION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductDescriptionValidationIsNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setDescription(null);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_DESCRIPTION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductDescriptionValidCharacters01() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription("qwertyuiopasdfghjklzxcvbnm1234567890<b>Bold<</b>");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setDescription("qwertyuiopasdfghjklzxcvbnm1234567890Bold&lt;");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductDescriptionValidCharacters02() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription("~!@#$%^&*()_+<>?qwertyuiopasdfghjklzxcvbnm1234567890#");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setDescription("~!@#$%^&amp;*()_+&lt;&gt;?qwertyuiopasdfghjklzxcvbnm1234567890#");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductDescriptionInValidCharacters() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription("מה");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_DESCRIPTION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductDescriptionRemoveSpacesFromBeginning() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription("   abcd12345");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setDescription("abcd12345");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductDescriptionRemoveSpacesFromTheEnd() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription("abcd 12345 xcvb    ");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setDescription("abcd 12345 xcvb");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductDescriptionMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription(
+				"Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12asdfghjklzxcvbnmqwertyui");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductDescriptionExceedMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("Abba");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setDescription(
+				"Abxba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12asdfghjklzxcvbnmqwertyui");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "1024");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductTagIsEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setName("Product");
+		productReqDetails.setTags(Arrays.asList(""));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_FIELD_FORMAT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "tag");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	// DE192351
+	@Test // (enabled = false)
+	public void createProductTagValidationAllowedCharacters() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName(), "Acde2@3:4& m=n+b-u.j-u'g#b"));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductTagsNameValidationProductNameIsNotInTag() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+//		productReqDetails.setName("Qwertyuiop1234567890asdfA");
+		productReqDetails.setTags(Arrays.asList("Abc"));
+		normalizedName = productReqDetails.getName().trim().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductSingleTagMaxLength() throws Exception {
+		// SingleTagMaxLength = 50
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345678"));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductSingleTagExceedMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Axbba1234567890asdfghjkl123zxcvbnm432asdfgh12345678"));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "50");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductAllTagsMaxLength() throws Exception {
+		// AllTagsMaxLength = 1024
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345601",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345602",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345603",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345604",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345605",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345606",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345607",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345608",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh1234569",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345610",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345611",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345612",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345613",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345614",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345615",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345616",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345617",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345618",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345619",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345"));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductAllTagsExceedMaxLength() throws Exception {
+		// AllTagsMaxLength = 1024
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345601",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345602",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345603",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345604",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345605",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345606",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345607",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345608",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh1234569",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345610",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345611",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345612",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345613",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345614",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345615",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345616",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345617",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345618",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345619",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh123456"));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "1024");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductDuplicateTagRemoved() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName(), productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductContactsIsEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		productReqDetails.setContacts(Arrays.asList(""));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_CONTACT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductContactsInvalidFormat() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		productReqDetails.setContacts(Arrays.asList("bt750345"));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_CONTACT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductConvertContactsToLowerCase() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		productReqDetails.setContacts(Arrays.asList(productManager1.getUserId().toUpperCase()));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setContacts(Arrays.asList(productManager1.getUserId().toLowerCase()));
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductContactsDoexNotContainTheProductCreator() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		productReqDetails.setContacts(Arrays.asList(productManager2.getUserId()));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setContacts(Arrays.asList(productManager2.getUserId(), productManager1.getUserId()));
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductContactsNotAllowedAsdcUsers() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		productReqDetails.setContacts(Arrays.asList(designerUser.getUserId()));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PRODUCT_CONTACT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING,
+				designerUser.getUserId());
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductContactsNotAsdcUser() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase();
+		String nonAsdcUser = "bh1234";
+		productReqDetails.setContacts(Arrays.asList(nonAsdcUser));
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PRODUCT_CONTACT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, nonAsdcUser);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeIsEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_PROJECT_CODE,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeIsNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode(null);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_PROJECT_CODE,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeIsNotNumeric() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode("asdfgh");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PROJECT_CODE,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeHasnMinCharacters() throws Exception {
+		// Min =5
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode("12345");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeHasnMaxCharacters() throws Exception {
+		// Max =10
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode("1234567890");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeExceedMaxCharacters() throws Exception {
+		// Max =10
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode("12345678901");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PROJECT_CODE,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductProjectCodeLessThanMinCharacters() throws Exception {
+		// Max =10
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setProjectCode("1234");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PROJECT_CODE,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIconIsEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setIcon("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_ICON,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIconIsNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setIcon(null);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_ICON,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIconMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setIcon("asdfghjklqwertyuiozxcvbfv");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIconExceedMaxLength() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setIcon("asdfghjklqwertyuiozxcvbf12");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "25");
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIconAllowedCharacters() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setIcon("a--s-fghjk_q__r1234567890");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test (enabled = false)
+	public void createProductIconInValidCharacters() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		String icon = "asdfg";
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
+				'|', '\\', ',' };
+		RestResponse createProduct;
+		for (int i = 0; i < invalidChars.length; i++) {
+			productReqDetails.setIcon(icon + invalidChars[i]);
+			createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+			assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+					createProduct.getErrorCode().intValue());
+			Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "",
+					productManager1);
+			ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+					expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_ICON,
+					Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
+			constructFieldsForAuditValidation.setCURR_VERSION("");
+			constructFieldsForAuditValidation.setCURR_STATE("");
+			AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+		}
+	}
+
+	@Test // (enabled = false)
+	public void createProductIsActiveisEmpty() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setActive("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setActive("false");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIsActiveisNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setActive("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		productReqDetails.setActive("false");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIsActiveisFalse() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setActive("false");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test
+	public void createProductIsActiveisHasInvalidValue() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setActive("xfalse");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_CONTENT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		constructFieldsForAuditValidation.setRESOURCE_NAME("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled = false)
+	public void createProductIsActiveisTrue() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		// productReqDetails.setName("CIProduct1");
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		productReqDetails.setActive("true");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	//////////////////////////////////////////////
+	// DE192424
+	@Test // (enabled = false)
+	public void createProductNameValidationNormalizationNameWithSpaces() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+//		productReqDetails.setName("Abba Emma");
+		// productReqDetails.setName("abba emma");
+		// productReqDetails.setTags(Arrays.asList("abba emma"));
+		normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		String actualNormalizedNameFromResponse = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
+				"normalizedName");
+		assertTrue(actualNormalizedNameFromResponse.equals(normalizedName));
+		// productReqDetails.setName("Abba Emma");
+		String productUuid = ResponseParser.getUuidFromResponse(createProduct);
+		compareExpectedAndActualProducts(productReqDetails, createProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProductRes);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	private void compareExpectedAndActualProducts(ProductReqDetails productReqDetails, RestResponse createProduct)
+			throws JSONException {
+		String productName = ResponseParser.getNameFromResponse(createProduct);
+		assertTrue(productReqDetails.getName().equals(productName));
+		String productIcon = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "icon");
+		assertTrue(productReqDetails.getIcon().equals(productIcon));
+		String productFullName = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "fullName");
+		assertTrue(productReqDetails.getFullName().equals(productFullName));
+		String productProjectCode = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "projectCode");
+		assertTrue(productReqDetails.getProjectCode().equals(productProjectCode));
+		String productIsActive = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "isActive");
+		String expectedIsActive = (productReqDetails.getActive() != null ? productReqDetails.getActive() : "false");
+		assertTrue(productIsActive.equals(expectedIsActive));
+		String productdescription = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "description");
+		assertTrue(productReqDetails.getDescription().equals(productdescription));
+		String productNormalizedName = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
+				"normalizedName");
+		assertTrue(normalizedName.equals(productNormalizedName));
+		String productContacts = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "contacts");
+		JSONArray reciviedContacts = new JSONArray(productContacts);
+		String actualContact = null;
+		for (int i = 0; i < reciviedContacts.length(); i++) {
+			actualContact = reciviedContacts.getString(i);
+			assertEquals(productReqDetails.getContacts().get(i), actualContact);
+		}
+		String productTags = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "tags");
+		JSONArray reciviedTages = new JSONArray(productTags);
+		String actualTag = null;
+		for (int i = 0; i < reciviedTages.length(); i++) {
+			actualTag = reciviedTages.getString(i);
+			assertEquals(productReqDetails.getTags().get(i), actualTag);
+		}
+	}
+
+	// END
+	///////////////////////////////////////////////////////
+	@Test
+	public void createProductSuccessFlow() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting created Product", BaseRestUtils.STATUS_CODE_SUCCESS,
+				getProductRes.getErrorCode().intValue());
+
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(false));
+	}
+
+	@Test
+	public void createProductSetIsActive() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setActive("true");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting created Product", BaseRestUtils.STATUS_CODE_SUCCESS,
+				getProductRes.getErrorCode().intValue());
+
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+		assertEquals(actualProduct.getIsActive(), new Boolean(true));
+	}
+
+	@Test
+	public void createProductNoIcon() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setIcon(null);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_MISSING_DATA,
+				createProduct.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createProductNoProjectCode() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		productReqDetails.setProjectCode(null);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_MISSING_DATA,
+				createProduct.getErrorCode().intValue());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCrudTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCrudTest.java
new file mode 100644
index 0000000..2044d21
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCrudTest.java
@@ -0,0 +1,2551 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public class ProductCrudTest extends ProductBaseTest {
+	private static Logger log = LoggerFactory.getLogger(ProductCrudTest.class.getName());
+	@Rule
+	public static TestName name = new TestName();
+
+	public static String INITIAL_PRODUCT_VERSION = "0.1";
+	public static String CREATE_AUDIT_ACTION = "Create";
+	public static String UPDATE_AUDIT_ACTION = "Update";
+	public static String COMPONENT_TYPE = "Product";
+
+	private ProductReqDetails productReqDetails;
+	private RestResponse createProduct;
+	private Product product;
+
+	public ProductCrudTest() {
+		super(name, ProductCrudTest.class.getName());
+	}
+
+	@Test // (enabled=false)
+	public void createAndGetAll() throws Exception {
+		createProductAndGet(UserRoleEnum.DESIGNER);
+	}
+
+	private void createProductAndGet(UserRoleEnum user) throws Exception, IOException {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		RestResponse catalog = CatalogRestUtils.getCatalog(user.getUserId());
+		assertEquals("Check response code after get catalog", BaseRestUtils.STATUS_CODE_SUCCESS,
+				catalog.getErrorCode().intValue());
+
+		try {
+			JsonElement jElement = new JsonParser().parse(catalog.getResponse());
+			JsonObject jObject = jElement.getAsJsonObject();
+			JsonArray products = (JsonArray) jObject.get("products");
+			assertEquals("Check product array size", 1, products.size());
+			Iterator<JsonElement> iter = products.iterator();
+			while (iter.hasNext()) {
+				JsonElement next = iter.next();
+				Product product = ResponseParser.parseToObjectUsingMapper(next.toString(), Product.class);
+				assertNotNull(product);
+				assertEquals("Check product name", productReqDetails.getName(), product.getName());
+				// Map<String, String> allVersions = product.getAllVersions();
+				// assertEquals("Check product name", 1, allVersions.size());
+			}
+
+		} catch (Exception e) {
+			log.debug("exception", e);
+		}
+	}
+
+	@Test
+	public void getAllNoProcduts() throws Exception {
+
+		RestResponse catalog = CatalogRestUtils.getCatalog();
+		assertEquals("Check response code after get catalog", BaseRestUtils.STATUS_CODE_SUCCESS,
+				catalog.getErrorCode().intValue());
+
+		try {
+			JsonElement jElement = new JsonParser().parse(catalog.getResponse());
+			JsonObject jObject = jElement.getAsJsonObject();
+			JsonArray products = (JsonArray) jObject.get("products");
+			assertEquals("Check product array size", 0, products.size());
+		} catch (Exception e) {
+			log.debug("exception", e);
+		}
+
+	}
+
+	@Test
+	public void getAllNoAttHeader() throws Exception {
+		String url = String.format(Urls.GET_CATALOG_DATA, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		List<String> headersToRemove = new ArrayList<String>();
+		headersToRemove.add(HttpHeaderEnum.USER_ID.getValue());
+
+		RestResponse catalog = CatalogRestUtils.sendGetAndRemoveHeaders(url, null, headersToRemove);
+		assertEquals("Check response code after get catalog", BaseRestUtils.STATUS_CODE_MISSING_INFORMATION,
+				catalog.getErrorCode().intValue());
+
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), new ArrayList<String>(),
+				catalog.getResponse());
+	}
+
+	@Test
+	public void getAllWrongUser() throws Exception {
+		RestResponse catalog = CatalogRestUtils.getCatalog("kj8976");
+		assertEquals("Check response code after get catalog", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				catalog.getErrorCode().intValue());
+
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				catalog.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void getAllWithProductStrategist_User() throws Exception {
+		createProductAndGet(UserRoleEnum.PRODUCT_STRATEGIST1);
+	}
+
+	@Test // (enabled=false)
+	public void getAllWithProductManager_User() throws Exception {
+		createProductAndGet(UserRoleEnum.PRODUCT_MANAGER1);
+	}
+
+	@Test // (enabled=false)
+	public void createProductNoCategories() throws Exception {
+		createProductWithCategories(null);
+	}
+
+	@Test // (enabled=false)
+	public void createProductOneGrouping() throws Exception {
+		// Category1->[Subcategory1->[Grouping1]]
+		createProductWithCategories(defaultCategories);
+	}
+
+	@Test // (enabled=false)
+	public void createProductTwoGroupingsSameSubCategory() throws Exception {
+		// Category1->Subcategory1->[Grouping1, Grouping11]
+		List<CategoryDefinition> addSecondGroupingToDefaultCategory = addSecondGroupingToDefaultCategory();
+		createProductWithCategories(addSecondGroupingToDefaultCategory);
+	}
+
+	@Test // (enabled=false)
+	public void createProductTwoSubsDifferentGroupings() throws Exception {
+		// Category1->[Subcategory1->[Grouping1,
+		// Grouping11],Subcategory2->[Grouping12]]
+		List<CategoryDefinition> addSubcategoryAndGroupingToDefaultCategory = addSubcategoryAndGroupingToDefaultCategory();
+		createProductWithCategories(addSubcategoryAndGroupingToDefaultCategory);
+	}
+
+	@Test // (enabled=false)
+	public void createManyGroupingsDiffCategories() throws Exception {
+		// [Category1->[Subcategory1->[Grouping1,
+		// Grouping11],Subcategory2->[Grouping12]],
+		// Category2->[Subcategory1->[Grouping1],Subcategory2->[Grouping1]],
+		// Category3->[Subcategory1->[Grouping11],Subcategory2->[Grouping11,
+		// Grouping22]]]
+		List<CategoryDefinition> addSubcategoryAndGroupingToDefaultCategory = addManyGroupingsDiffCategories();
+		createProductWithCategories(addSubcategoryAndGroupingToDefaultCategory);
+	}
+
+	@Test // (enabled=false)
+	public void createProductEmptyUserId() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		User emptyUser = new User();
+		emptyUser.setUserId("");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, emptyUser);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_MISSING_INFORMATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				emptyUser);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, emptyUser, ActionStatus.MISSING_INFORMATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled=false)
+	public void createProductNonExistingUserId() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		User notExistingUser = new User();
+		notExistingUser.setUserId("jj6444");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, notExistingUser);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				notExistingUser);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, notExistingUser, ActionStatus.RESTRICTED_OPERATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled=false)
+	public void createProductInvalidJson() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct_Invalid_Json(productManager1.getUserId());
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				productManager1);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_CONTENT,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setRESOURCE_NAME("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled=false)
+	public void createProductAdminRoleNotAllowed() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		User wrongRole = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, wrongRole);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				wrongRole);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, wrongRole, ActionStatus.RESTRICTED_OPERATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled=false)
+	public void createProductProductStrategistRoleNotAllowed() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		User wrongRole = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST3);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, wrongRole);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				createProduct.getErrorCode().intValue());
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				wrongRole);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, wrongRole, ActionStatus.RESTRICTED_OPERATION,
+				Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
+		constructFieldsForAuditValidation.setCURR_VERSION("");
+		constructFieldsForAuditValidation.setCURR_STATE("");
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	@Test // (enabled=false)
+	public void getProductSuccessFlow() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting created Product", BaseRestUtils.STATUS_CODE_SUCCESS,
+				getProductRes.getErrorCode().intValue());
+
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void getNonExistedProduct() throws Exception {
+
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting created Product", BaseRestUtils.STATUS_CODE_SUCCESS,
+				getProductRes.getErrorCode().intValue());
+
+		Product product = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
+		assertEquals("Assert on product icon", productReqDetails.getName(), product.getName());
+
+		RestResponse deleteProductRes = ProductRestUtils.deleteProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code for deletign Product", BaseRestUtils.STATUS_CODE_SUCCESS,
+				deleteProductRes.getErrorCode().intValue());
+
+		RestResponse getProductAfterDeleteRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting deleted Product", BaseRestUtils.STATUS_CODE_NOT_FOUND,
+				getProductAfterDeleteRes.getErrorCode().intValue());
+	}
+
+	@Test // (enabled=false)
+	public void getProductMissingHeader() throws Exception {
+
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		productManager1.setUserId(null);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting created Producuct with userId extracted from header",
+				BaseRestUtils.STATUS_CODE_MISSING_INFORMATION, getProductRes.getErrorCode().intValue());
+
+	}
+
+	@Test // (enabled=false)
+	public void getProductNonExistingUser() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+
+		productManager1.setUserId("bt1111");
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		assertEquals("Check response code after getting created Producuct with non exsisting user",
+				BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION, getProductRes.getErrorCode().intValue());
+	}
+
+	@Test // (enabled=false)
+	public void createProductAndGetProductWithDifferentUser() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+		User sdncProductStrategistUserAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				sdncProductStrategistUserAdminDetails.getUserId());
+		assertEquals("Check response code after getting created Product different user role",
+				BaseRestUtils.STATUS_CODE_SUCCESS, getProductRes.getErrorCode().intValue());
+	}
+
+	// US594753 - Update Product metadata
+
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductAllFieldsByPM() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		// Update product
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("NewProductName");
+		List<CategoryDefinition> addSecondGroupingToDefaultCategory = addSecondGroupingToDefaultCategory();
+		productReqDetails.setFullName("New Full name");
+		productReqDetails.setActive("false");
+		productReqDetails.setContacts(
+				Arrays.asList(productManager2.getUserId().toLowerCase(), productManager1.getUserId().toLowerCase()));
+		productReqDetails.setDescription("New Product Description");
+		productReqDetails.setIcon("asdfghjklqwertyuiozxcvbfv");
+		productReqDetails.setProjectCode("98765");
+		productReqDetails.setCategories(addSecondGroupingToDefaultCategory);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// productReqDetails.setTags(Arrays.asList(productReqDetails.getName(),
+		// productOldName));
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(productReqDetails.getName().toLowerCase());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductByPS() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("New discription");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productStrategistUser1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void updateProductByAdmin() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("New discription");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, designerUser);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void updateProductByNonPmUser() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		// Update product name
+		productReqDetails.setDescription("New discription");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, designerUser);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void updateProductByNonAsdcUser() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		// Update product name
+		productReqDetails.setDescription("New discription");
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		nonAsdcUser.setUserId("bt789k");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, nonAsdcUser);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void updateProductUserIdIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		// Update product name
+		productReqDetails.setDescription("New discription");
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		nonAsdcUser.setUserId("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, nonAsdcUser);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_MISSING_INFORMATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void updateProductByNonProductOwner() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct(defaultCategories);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		Product product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("New discription");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager2);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.GET_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNotInCheckoutState() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct(defaultCategories);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		Product product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		// Update product name
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		String valueFromJsonResponse = ResponseParser.getValueFromJsonResponse(changeProductLifeCycle.getResponse(),
+				"lastUpdateDate");
+		expectedProduct.setLastUpdateDate(Long.parseLong(valueFromJsonResponse));
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNameIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("abbreviated");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNameIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager2,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		// List<String> tags = productReqDetails.getTags();
+		// tags.removeAll(tags);
+		productReqDetails.setTags(new ArrayList<>());
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName(null); // no update will be performed
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager2);
+		ProductRestUtils.checkSuccess(updateProduct);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager2);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(product.getName().toLowerCase());
+		expectedProduct.setName(product.getName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNameLessThanMinLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("ABC"); // no update will be performed
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("abbreviated");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH.name(),
+				varibales, updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductNameHasMinLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager2,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("NewP");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager2);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		productReqDetails.setLastUpdaterUserId(productManager2.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager2.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager2);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(productReqDetails.getName().toLowerCase());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	// DE193857 - Normalized Name is not removing special characters
+	@Test(enabled = false)
+	public void updateProductNameMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		// Update product name
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("Ac_2B3U4k mSKnob-u.j-uGgP");
+		String newNormalizedName = "ac2b3u4kmsknobujuggp";
+		String newName = "Ac_2B3U4k MSKnob-u.j-uGgP";
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setTags(Arrays.asList(newName));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(newNormalizedName);
+		expectedProduct.setName(newName);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNameExceedMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("Ac_2B3U4k mSKnob-u.j-uGgPx");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("abbreviated");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH.name(),
+				varibales, updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNameAlreadyExist() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct(defaultCategories);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager2);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		Product product1 = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product1, productManager2,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setName("Product2000");
+		// productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		createProduct = ProductRestUtils.createProduct(productReqDetails, productManager2);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		Product product2 = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product2, productManager2,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product2, productManager2,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product2.getUniqueId());
+		productReqDetails.setUUID(product2.getUUID());
+		productReqDetails.setName(product1.getName());
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager2);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_ALREADY_EXISTS,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add(product1.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager2.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product2.getUniqueId());
+		expectedProduct.setVersion(product2.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// DE193857 - Normalized Name is not removing special characters
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductNameAllowedCharacters() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		// Update product name
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("A_BU4k m&K=o#b-u.j-uG'g+P"); // Allowed
+																// characters
+																// [a-z,A-Z,0-9]
+																// , ‘ ‘
+																// (space),
+																// ampersand
+																// "&", dash
+																// “-“, plus
+																// "+", period
+																// ".",
+																// apostrophe
+																// "'", hashtag
+																// "#", equal
+																// "=", period
+																// ":", at "@",
+																// and
+																// underscore
+																// "_"
+		String newNormalizedName = "abu4km&kobujuggp";
+		String newName = "A_BU4k M&K=o#b-u.j-uG'g+P";
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setTags(Arrays.asList(newName));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(newNormalizedName);
+		expectedProduct.setName(newName);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductNameRemoveSpaceFromBeginning() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("      asdfg");
+		String newNormalizedName = "asdfg";
+		String newName = "Asdfg";
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// productReqDetails.setTags(Arrays.asList(newName, productOldName));
+		productReqDetails.setTags(Arrays.asList(newName));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(newNormalizedName);
+		expectedProduct.setName(newName);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductNameRemoveSpaceFromEnd() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("asdfg fc        ");
+		String newNormalizedName = "asdfgfc";
+		String newName = "Asdfg Fc";
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// productReqDetails.setTags(Arrays.asList(newName, productOldName));
+		productReqDetails.setTags(Arrays.asList(newName));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(newNormalizedName);
+		expectedProduct.setName(newName);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	//// DE193857 - Normalized Name is not removing special characters
+	// If user update "product name" we need to remove the old product name from
+	//// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductNameRemoveExtraNonAlphanumericChars() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("A__k &&==##---u..hG'''+++");
+		String newNormalizedName = "akhg";
+		String newName = "A_k &=#-u.hG'+";
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// productReqDetails.setTags(Arrays.asList(newName, productOldName));
+		productReqDetails.setTags(Arrays.asList(newName));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(newNormalizedName);
+		expectedProduct.setName(newName);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// If user update "product name" we need to remove the old product name from
+	// "Tags" and add the new product name instead - will handled in mew US
+	@Test(enabled = false)
+	public void updateProductNameValidationStartWithNumber() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("1000Ab");
+		String newNormalizedName = productReqDetails.getName().toLowerCase();
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
+		// productReqDetails.setTags(Arrays.asList(productReqDetails.getName(),
+		// productOldName));
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setNormalizedName(newNormalizedName);
+		expectedProduct.setName(productReqDetails.getName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductNameValidationStartWithNonAlphaNumeric() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setName("_1000Ab");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("abbreviated");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT.name(),
+				varibales, updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("full");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setNormalizedName(product.getNormalizedName());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setFullName(product.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameHasMinLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName("asdc");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setNormalizedName(product.getNormalizedName());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setFullName(productReqDetails.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameHasMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName(
+				"1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setNormalizedName(product.getNormalizedName());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setFullName(productReqDetails.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNamelessThanMinLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName("123");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("full");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH.name(),
+				varibales, updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameExceedMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName(
+				"1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjkx");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("full");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH.name(),
+				varibales, updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	// DE193947
+	@Test
+	public void updateProductFullNameWithSpecialCharacters() throws Exception {
+		char invalidChars[] = { '~', '!', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/', '|',
+				'\\', ',', '$', '#', '@', '+' };
+		String fullName = "avbng";
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		for (int i = 0; i < invalidChars.length; i++) {
+			productReqDetails.setFullName(fullName + invalidChars[i]);
+			RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+			assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
+					updateProduct.getErrorCode().intValue());
+		}
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameValidCharactersCharacters01() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName("qwertyuiopasdfghjklzxcvbnm1234567890<b>Bold<</b>");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setNormalizedName(product.getNormalizedName());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setFullName("qwertyuiopasdfghjklzxcvbnm1234567890Bold&lt;");
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductFullNameRemoveExtraSpaces() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setFullName("Abbaaa  a1");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setNormalizedName(product.getNormalizedName());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setFullName("Abbaaa a1");
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test(enabled = false)
+	public void updateProductDescriptionValidCharacters01() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("~!@#$%^&*()_+<>?qwertyuiopasdfghjklzxcvbnm1234567890#");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setDescription("~!@#$%^&amp;*()_+&lt;&gt;?qwertyuiopasdfghjklzxcvbnm1234567890#");
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionValidCharacters02() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("qwertyuiopasdfghjklzxcvbnm1234567890<b>Bold<</b>");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setDescription("qwertyuiopasdfghjklzxcvbnm1234567890Bold<");
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionInValidCharacters() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("מה");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_DESCRIPTION.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionRemoveSpacesFromBeginning() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("   abcd12345 g");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setDescription(" abcd12345 g");
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionRemoveSpacesFromTheEnd() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setDescription("abcd12345  gdf     ");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setDescription("abcd12345 gdf ");
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		String description = "1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfg";
+		productReqDetails.setDescription(description);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setDescription(description);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductDescriptionExceedMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		String description = "01234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjk aa1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfg";
+		productReqDetails.setDescription(description);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("1024");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT.name(),
+				varibales, updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductTagIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(Arrays.asList(""));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		varibales.add("tag");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductTagIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setTags(product.getTags());
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductTagsNameValidationProductNameIsNotInTag() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(Arrays.asList("Abc"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME.name(),
+				new ArrayList<String>(), updateProduct.getResponse());
+	}
+
+	@Test // (enabled=false)
+	public void createProductSingleTagMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345678"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setTags(productReqDetails.getTags());
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductSingleTagExceedMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName(),
+				"123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("1024");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductAllTagsMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345601",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345602",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345603",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345604",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345605",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345606",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345607"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setTags(productReqDetails.getTags());
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductAllTagsExceedMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(
+				Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345601",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345602",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345603",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345604",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345605",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345606",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345607",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345608",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh1234569",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345610",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345611",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345612",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345613",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345614",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345615",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345616",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345617",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345618",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345619",
+						"Abba1234567890asdfghjkl123zxcvbnm432asdfgh123456"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add("1024");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductTagsDuplicateTagRemoved() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setTags(Arrays.asList(productReqDetails.getName(), "KoKo", "KoKo"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata updated
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setTags(Arrays.asList(productReqDetails.getName(), "KoKo"));
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductContactsIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setContacts(Arrays.asList(""));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductContactsIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setContacts(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductContactsInvalidFormat() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setContacts(Arrays.asList("bt750345"));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(COMPONENT_TYPE);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductConvertContactsToLowerCase() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setContacts(Arrays.asList(productManager2.getUserId().toUpperCase()));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct
+				.setContacts(Arrays.asList(productManager2.getUserId().toLowerCase(), productManager1.getUserId()));
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductContactsNotAllowedAsdcUsers() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setContacts(Arrays.asList(productStrategistUser1.getUserId()));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(productStrategistUser1.getUserId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PRODUCT_CONTACT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductContactsNotAsdcUser() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		String nonAsdcUserUserId = "bt567h";
+		productReqDetails.setContacts(Arrays.asList(nonAsdcUserUserId));
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(nonAsdcUserUserId);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PRODUCT_CONTACT.name(), varibales,
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_PROJECT_CODE.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setProjectCode(product.getProjectCode());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeLessThanMinCharacters() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode("9870");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROJECT_CODE.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeHasnMinCharacters() throws Exception { // min
+																				// =5
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode("98700");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setProjectCode(productReqDetails.getProjectCode());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeHasnMaxCharacters() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode("1234567890");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setProjectCode(productReqDetails.getProjectCode());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeExceedMaxCharacters() throws Exception {// Max
+		// =10
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode("12345678901");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROJECT_CODE.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setProjectCode(product.getProjectCode());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductProjectCodeIsNotNumeric() throws Exception {
+		// Max =10
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setProjectCode("1234a");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROJECT_CODE.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setProjectCode(product.getProjectCode());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIconIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setIcon("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> variables = new ArrayList<String>();
+		variables.add(COMPONENT_TYPE);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), variables,
+				updateProduct.getResponse());
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIcon(product.getIcon());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIconIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setIcon(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		// Get Product and verify that metadata didn't change
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIcon(product.getIcon());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIconMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setIcon("A_a-1-2--b__BB1234567890A"); // Max length =
+																// 25
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIcon(productReqDetails.getIcon());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIconExceedMaxLength() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setIcon("A_a-1-2--b__BB1234567890A_");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ArrayList<String> variables = new ArrayList<String>();
+		variables.add(COMPONENT_TYPE);
+		variables.add("25");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT.name(), variables,
+				updateProduct.getResponse());
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIcon(product.getIcon());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIconInValidCharacters() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		String icon = "asdfg"; // Allowed characters [a-zA-Z0-9], dash (‘-‘),
+								// underscore (‘_’).
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
+				'|', '\\', ',' };
+		RestResponse updateProduct;
+		for (int i = 0; i < invalidChars.length; i++) {
+			productReqDetails.setIcon(icon + invalidChars[i]);
+			updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+			assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+					updateProduct.getErrorCode().intValue());
+			ArrayList<String> variables = new ArrayList<String>();
+			variables.add(COMPONENT_TYPE);
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_ICON.name(), variables,
+					updateProduct.getResponse());
+		}
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIcon(product.getIcon());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIsActiveIsEmpty() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setActive("");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIsActive(false);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIsActiveIsTrue() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setActive("true");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIsActive(true);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIsActiveIsNull() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct(defaultCategories);
+		productReqDetails.setActive("true");
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		Product product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setActive(null);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIsActive(true);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIsActiveIsFalse() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setActive("false");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		expectedProduct.setIsActive(false);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductIsActiveHasInvalidValue() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setActive("eeeee");
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				updateProduct.getResponse());
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
+				updateProduct.getErrorCode().intValue());
+		RestResponse getProduct = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		ProductRestUtils.checkSuccess(getProduct);
+		Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		expectedProduct.setUniqueId(product.getUniqueId());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProduct.getResponse(), Product.class);
+		expectedProduct.setVersion(product.getVersion());
+		expectedProduct.setLastUpdaterUserId(productManager1.getUserId());
+		expectedProduct.setLastUpdaterFullName(productManager1.getFullName());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductAssociations() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		List<CategoryDefinition> addSecondGroupingToDefaultCategory = addSecondGroupingToDefaultCategory();
+		productReqDetails.setCategories(addSecondGroupingToDefaultCategory);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setCategories(productReqDetails.getCategories());
+		expectedProduct.setNormalizedName(productReqDetails.getName().toLowerCase());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductAssociations02() throws Exception {
+		List<CategoryDefinition> addSecondGroupingToDefaultCategory = addSecondGroupingToDefaultCategory(); // Category1->Subcategory1->[Grouping1,
+																											// Grouping11]
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct(addSecondGroupingToDefaultCategory);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		Product product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		List<CategoryDefinition> defaultCategory = addSubcategoryAndGroupingToDefaultCategory(); // Category1->[Subcategory1->[Grouping1,
+																									// Grouping11],Subcategory2->[Grouping12]]
+		productReqDetails.setCategories(defaultCategory);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setCategories(productReqDetails.getCategories());
+		expectedProduct.setNormalizedName(productReqDetails.getName().toLowerCase());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductRemoveAllAssociations() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		List<CategoryDefinition> defaultCategory = new ArrayList<CategoryDefinition>();
+		productReqDetails.setCategories(defaultCategory);
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setCategories(productReqDetails.getCategories());
+		expectedProduct.setNormalizedName(productReqDetails.getName().toLowerCase());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	@Test // (enabled=false)
+	public void updateProductAssociationsCategotyIsNull() throws Exception {
+		createProducrByPSAndCheckIn();
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+		productReqDetails.setUniqueId(product.getUniqueId());
+		productReqDetails.setUUID(product.getUUID());
+		productReqDetails.setCategories(null);// product categories will not be
+												// updated
+		RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkSuccess(updateProduct);
+		productReqDetails.setLastUpdaterUserId(productManager1.getUserId());
+		productReqDetails.setLastUpdaterFullName(productManager1.getFullName());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(updateProduct.getResponse(), Product.class);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "0.2", productManager1);
+		expectedProduct.setUUID(product.getUUID());
+		expectedProduct.setInvariantUUID(product.getInvariantUUID());
+		expectedProduct.setCategories(product.getCategories());
+		expectedProduct.setNormalizedName(productReqDetails.getName().toLowerCase());
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.UPDATE_COMPONENT);
+	}
+
+	////////////////////////////////////////////////////////////////////////
+
+	private void createProductWithCategories(List<CategoryDefinition> categoryDefinitions) throws Exception {
+		ProductReqDetails productReqDetails = (categoryDefinitions != null
+				? ElementFactory.getDefaultProduct(categoryDefinitions) : ElementFactory.getDefaultProduct());
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+		Product actualProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		String actualUuid = ResponseParser.getUuidFromResponse(createProduct);
+		Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
+				productManager1);
+		String normalizedNameFomJsonResponse = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
+				"normalizedName");
+		expectedProduct.setNormalizedName(normalizedNameFomJsonResponse);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
+				ComponentOperationEnum.CREATE_COMPONENT);
+		ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
+				expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
+				"0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, actualUuid);
+		AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
+	}
+
+	private void createProducrByPSAndCheckIn() throws Exception {
+		productReqDetails = ElementFactory.getDefaultProduct(defaultCategories);
+		createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		ProductRestUtils.checkCreateResponse(createProduct);
+		product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+		RestResponse changeProductLifeCycle = ProductRestUtils.changeProductLifeCycle(product, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.checkSuccess(changeProductLifeCycle);
+	}
+
+	@Test
+	public void checkInvariantUuidIsImmutable() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		String invariantUuidDefinedByUser = "!!!!!!!!!!!!!!!!!!!!!!!!";
+		productReqDetails.setInvariantUUID(invariantUuidDefinedByUser);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		BaseRestUtils.checkStatusCode(createProduct, "create request failed", false, 201);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+		Product ProductCreation = ResponseParser.convertProductResponseToJavaObject(createProduct.getResponse());
+		String invariantUUIDcreation = ProductCreation.getInvariantUUID();
+
+		// validate get response
+		RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
+				productManager1.getUserId());
+		BaseRestUtils.checkSuccess(getProductRes);
+		Product productGetting = ResponseParser.convertProductResponseToJavaObject(getProductRes.getResponse());
+		String invariantUUIDgetting = productGetting.getInvariantUUID();
+		assertEquals(invariantUUIDcreation, invariantUUIDgetting);
+
+		// Update Product with new invariant UUID
+		RestResponse restResponseUpdate = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		BaseRestUtils.checkSuccess(restResponseUpdate);
+		Product updatedProduct = ResponseParser.convertProductResponseToJavaObject(restResponseUpdate.getResponse());
+		String invariantUUIDupdating = updatedProduct.getInvariantUUID();
+		assertEquals(invariantUUIDcreation, invariantUUIDupdating);
+
+		// Do checkin
+		RestResponse restResponseCheckin = LifecycleRestUtils.changeProductState(productReqDetails, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		BaseRestUtils.checkSuccess(restResponseCheckin);
+		Product checkinProduct = ResponseParser.convertProductResponseToJavaObject(restResponseCheckin.getResponse());
+		String invariantUUIDcheckin = checkinProduct.getInvariantUUID();
+		String version = checkinProduct.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcheckin);
+		assertEquals(version, "0.1");
+
+		// Do checkout
+		RestResponse restResponseCheckout = LifecycleRestUtils.changeProductState(productReqDetails, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		BaseRestUtils.checkSuccess(restResponseCheckout);
+		Product checkoutProduct = ResponseParser.convertProductResponseToJavaObject(restResponseCheckout.getResponse());
+		String invariantUUIDcheckout = checkoutProduct.getInvariantUUID();
+		version = checkoutProduct.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcheckout);
+		assertEquals(version, "0.2");
+
+	}
+
+	// US672129 Benny
+	private void getProductValidateInvariantUuid(String productUniqueId, String invariantUUIDcreation)
+			throws Exception {
+		RestResponse getProduct = ProductRestUtils.getProduct(productUniqueId,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, getProduct.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(getProduct));
+	}
+
+	@Test // invariantUUID generated when the component is created and never
+			// changed
+	public void productInvariantUuid() throws Exception {
+		ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
+		String invariantUuidDefinedByUser = "12345";
+		productReqDetails.setInvariantUUID(invariantUuidDefinedByUser);
+		RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
+		assertEquals("Check response code after create resource", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+		// invariantUUID generated when the component is created and never
+		// changed
+		String invariantUUIDcreation = ResponseParser.getInvariantUuid(createProduct);
+		getProductValidateInvariantUuid(productReqDetails.getUniqueId(), invariantUUIDcreation);
+		// Update Product with new invariant UUID
+		RestResponse restResponse = ProductRestUtils.updateProduct(productReqDetails, productManager1);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getProductValidateInvariantUuid(productReqDetails.getUniqueId(), invariantUUIDcreation);
+		// Checkin
+		restResponse = LifecycleRestUtils.changeProductState(productReqDetails, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getProductValidateInvariantUuid(productReqDetails.getUniqueId(), invariantUUIDcreation);
+		// Checkout
+		restResponse = LifecycleRestUtils.changeProductState(productReqDetails, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getProductValidateInvariantUuid(productReqDetails.getUniqueId(), invariantUUIDcreation);
+
+		// UnDo-CheckOut
+		restResponse = LifecycleRestUtils.changeProductState(productReqDetails, productManager1,
+				LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getProductValidateInvariantUuid(productReqDetails.getUniqueId(), invariantUUIDcreation);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java
new file mode 100644
index 0000000..aebea69
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java
@@ -0,0 +1,164 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class ProductGetFollowedTest extends ProductBaseTest {
+
+	protected Product product200;
+	protected Product product400;
+
+	private ProductReqDetails productDetails200;
+	private ProductReqDetails productDetails400;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ProductGetFollowedTest() {
+		super(name, ProductGetFollowedTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+		createProducts();
+	}
+
+	@Test
+	public void followedPageTest() throws Exception { // Actions
+		RestResponse changeLifeCycleResponse;
+		changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
+		changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
+		// Expected users Followed page
+		ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
+		ProductValidationUtils.checkUserFollowedPage(productManager2, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
+	}
+
+	@Test
+	public void followedPagePmCheckedOutProductWasCheckInByOtherPm() throws Exception {
+		ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.changeProductLifeCycle(product400, productManager1, LifeCycleStatesEnum.CHECKOUT);
+		RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product200, productManager2, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
+
+		ProductValidationUtils.checkUserFollowedPage(productManager1, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
+	}
+
+	@Test
+	public void followedPagePmCheckInProduct02() throws Exception {
+		ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
+
+		ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
+		ProductValidationUtils.checkUserFollowedPage(productManager2, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
+	}
+
+	@Test
+	public void followedPageAdminCheckoutProductWasCheckedinByPm() throws Exception {
+		ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
+		RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product400, adminUser, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
+
+		ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
+	}
+
+	@Test
+	public void followedPageAdminCheckInProduct() throws Exception {
+		ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.changeProductLifeCycle(product400, adminUser, LifeCycleStatesEnum.CHECKOUT);
+		RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product400, adminUser, LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
+
+		ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
+	}
+
+	@Test
+	public void followedPagePmCheckoutProductWasCheckedinByAdmin() throws Exception {
+		ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
+		ProductRestUtils.changeProductLifeCycle(product200, adminUser, LifeCycleStatesEnum.CHECKOUT);
+		ProductRestUtils.changeProductLifeCycle(product200, adminUser, LifeCycleStatesEnum.CHECKIN);
+		RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product200, productManager2, LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
+
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product200);
+		ProductValidationUtils.checkUserFollowedPage(productManager2, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
+		ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
+	}
+
+	private void createProducts() throws Exception {
+		// PM1 (Product manager) create :PR200 (check In State)
+		// PM2 (Product manager) create :PR400 (check In State)
+
+		productDetails200 = ElementFactory.getDefaultProduct("CiProd200", defaultCategories);
+		productDetails400 = ElementFactory.getDefaultProduct("CiProd400", defaultCategories);
+
+		RestResponse createProduct = ProductRestUtils.createProduct(productDetails200, productManager1);
+		ResourceRestUtils.checkCreateResponse(createProduct);
+		product200 = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+
+		createProduct = ProductRestUtils.createProduct(productDetails400, productManager2);
+		ResourceRestUtils.checkCreateResponse(createProduct);
+		product400 = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java
new file mode 100644
index 0000000..26bb3e2
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.testng.annotations.BeforeMethod;
+
+public abstract class ProductLifecycleTest extends ProductBaseTest {
+
+	protected static final String CHECKIN_ACTION = "Checkin";
+	protected static final String CHECKOUT_ACTION = "Checkout";
+	protected static final String UNDO_CHECKOUT_ACTION = "UndoCheckout";
+
+	protected Product expectedProduct;
+
+	public ProductLifecycleTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+		ProductReqDetails defaultProduct = ElementFactory.getDefaultProduct(defaultCategories);
+		RestResponse createProduct = ProductRestUtils.createProduct(defaultProduct, productManager1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+		expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
new file mode 100644
index 0000000..479dbb9
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.Before;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+
+public class ProductTestBase extends ProductBaseTest {
+
+	public ProductTestBase(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	protected ResourceReqDetails downloadResourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails;
+	protected User sdncUserDetails;
+	protected ArtifactReqDetails heatArtifactDetails;
+	protected ArtifactReqDetails defaultArtifactDetails;
+	protected ResourceUtils resourceUtils;
+	protected ArtifactUtils artifactUtils;
+	protected Resource resource;
+	protected Service service;
+	protected Product product;
+
+	// protected static ServiceUtils serviceUtils = new ServiceUtils();
+
+	@Before
+	public void before() throws Exception {
+
+		initializeMembers();
+		createComponents();
+
+	}
+
+	public void initializeMembers() throws IOException, Exception {
+
+		downloadResourceDetails = ElementFactory.getDefaultResource();
+		serviceDetails = ElementFactory.getDefaultService();
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
+
+	}
+
+	protected void createComponents() throws Exception {
+
+		RestResponse response = ResourceRestUtils.createResource(downloadResourceDetails, sdncUserDetails);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", downloadResourceDetails.getUniqueId());
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncUserDetails,
+				downloadResourceDetails.getUniqueId());
+		assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		// certified resource
+		response = LifecycleRestUtils.certifyResource(downloadResourceDetails);
+		assertTrue("certify resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		response = ResourceRestUtils.getResource(downloadResourceDetails.getUniqueId());
+		assertTrue("response code is not 200, returned: " + response.getErrorCode(), response.getErrorCode() == 200);
+		resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+
+		response = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
+
+		// add resource instance with HEAT deployment artifact to the service
+		resourceInstanceReqDetails.setComponentUid(downloadResourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncUserDetails,
+				serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
+
+		// certified service
+		response = LifecycleRestUtils.certifyService(serviceDetails);
+		assertTrue("certify service request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		response = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
+		assertTrue("response code is not 200, returned: " + response.getErrorCode(), response.getErrorCode() == 200);
+		service = ResponseParser.convertServiceResponseToJavaObject(response.getResponse());
+
+		DbUtils.cleanAllAudits();
+
+		ProductReqDetails defaultProduct = ElementFactory.getDefaultProduct(defaultCategories);
+		RestResponse createProduct = ProductRestUtils.createProduct(defaultProduct, productStrategistUser1);
+		assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
+				createProduct.getErrorCode().intValue());
+		product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
+
+		// add service instance to product
+		//
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java
new file mode 100644
index 0000000..412e6fd
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.ci.tests.utils.Decoder;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class ProductToscaYamlGenerationTest extends ProductTestBase {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ProductToscaYamlGenerationTest() {
+		super(name, ProductToscaYamlGenerationTest.class.getName());
+	}
+
+	@Test
+	public void productToscaYamlFormat() throws IOException {
+
+		String heatEnvArtifactHeader = (String) Utils.parseYamlConfig("heatEnvArtifactHeader");
+		// System.out.println("heatEnvArtifactHeader = \n" +
+		// heatEnvArtifactHeader);
+
+		String heatEnvArtifactFooter = (String) Utils.parseYamlConfig("heatEnvArtifactFooter");
+		// System.out.println("heatEnvArtifactFooter = \n" +
+		// heatEnvArtifactFooter);
+
+		// temporary commented
+		// RestResponse downloadResourceInstanceHeatArtifact =
+		// ArtifactRestUtils.downloadResourceInstanceArtifact(service.getUniqueId(),
+		// resourceInstanceId, sdncUserDetails,
+		// heatArtifactDefinition.getUniqueId());
+		// assertTrue("expected request returned status:" + 200 + ", actual: " +
+		// downloadResourceInstanceHeatArtifact.getErrorCode(),
+		// downloadResourceInstanceHeatArtifact.getErrorCode()==200);
+
+		// InputStream stream =
+		// getDecodedSteramFromString(downloadResourceInstanceHeatArtifact.getResponse());
+		// System.out.println(Utils.getParamValueFromYamlByKey(stream,
+		// "description", String.class));
+
+		// node_types
+
+	}
+
+	private InputStream getDecodedSteramFromString(String encoded64Payload) throws IOException {
+
+		Gson gson = new Gson();
+		ArtifactUiDownloadData artifactUiDownloadData = gson.fromJson(encoded64Payload, ArtifactUiDownloadData.class);
+		String decodedPayload = Decoder.decode(artifactUiDownloadData.getBase64Contents());
+		return new ByteArrayInputStream(decodedPayload.getBytes());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java
new file mode 100644
index 0000000..d4bfb62
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java
@@ -0,0 +1,216 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.product;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNull;
+
+import java.io.FileNotFoundException;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class ProductUndoCheckoutTest extends ProductLifecycleTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	@BeforeClass
+	public static void staticInit() {
+		auditAction = UNDO_CHECKOUT_ACTION;
+		operation = ComponentOperationEnum.CHANGE_STATE_UNDO_CHECKOUT;
+	}
+
+	public ProductUndoCheckoutTest() {
+		super(name, ProductUndoCheckoutTest.class.getName());
+	}
+
+	@Test
+	public void undoCheckOutProductByPm() throws Exception {
+		undoCheckOutProductSuccess(productManager1, false);
+	}
+
+	@Test
+	public void undoCheckOutProductByAdmin() throws Exception {
+		undoCheckOutProductSuccess(adminUser, true);
+	}
+
+	@Test
+	public void undoCheckOutAfterCreate() throws Exception {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals("Check response code after undo checkout product", 200, lcsResponse.getErrorCode().intValue());
+
+		// Verify version was removed
+		lcsResponse = ProductRestUtils.getProduct(expectedProduct.getUniqueId(), productManager1.getUserId());
+		assertEquals("Check response code after get undone product", 404, lcsResponse.getErrorCode().intValue());
+
+		Product emptyProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+		assertNull(emptyProduct);
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(emptyProduct,
+				auditAction, productManager1, ActionStatus.OK, "0.1", Constants.EMPTY_STRING,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, null, Constants.EMPTY_STRING);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+
+	}
+
+	@Test
+	public void undoCheckOutNotExist() throws Exception {
+		String notExistId = "1234";
+		expectedProduct.setUniqueId(notExistId);
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals("Check response code after undo checkout product", 404, lcsResponse.getErrorCode().intValue());
+		expectedProduct.setName(notExistId);
+		String[] auditParameters = new String[] { Constants.EMPTY_STRING };
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, productManager1, ActionStatus.PRODUCT_NOT_FOUND, Constants.EMPTY_STRING,
+				Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, auditParameters);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+
+	}
+
+	@Test
+	public void undoCheckOutNotInCheckout() throws Exception {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals("Check response code after undo checkout product", 409, lcsResponse.getErrorCode().intValue());
+
+		String[] auditParameters = new String[] { expectedProduct.getName(), "product", productManager1.getFirstName(),
+				productManager1.getLastName(), productManager1.getUserId() };
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, productManager1, ActionStatus.COMPONENT_ALREADY_CHECKED_IN, "0.1", "0.1",
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
+				expectedProduct.getUUID(), auditParameters);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+
+	}
+
+	@Test
+	public void undoCheckOutProductByPsRoleNotAllowed() throws Exception {
+		undoCheckOutProductRestricted(productStrategistUser1);
+	}
+
+	@Test
+	public void undoCheckOutProductByPmNotStateOwner() throws Exception {
+		undoCheckOutProductForbidden(productManager2);
+	}
+
+	private void undoCheckOutProductSuccess(User user, boolean isAdmin) throws Exception, FileNotFoundException {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
+
+		// Checking undo checkout of admin even if not state owner
+		User checkoutUser = isAdmin ? productManager1 : user;
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout product", 200, lcsResponse.getErrorCode().intValue());
+		Product productToBeUndone = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+
+		lcsResponse = LifecycleRestUtils.changeProductState(productToBeUndone, user, LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals("Check response code after undo checkout product", 200, lcsResponse.getErrorCode().intValue());
+
+		// Verify version was removed
+		lcsResponse = ProductRestUtils.getProduct(productToBeUndone.getUniqueId(), user.getUserId());
+		assertEquals("Check response code after get undone product", 404, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = ProductRestUtils.getProduct(expectedProduct.getUniqueId(), user.getUserId());
+		assertEquals("Check response code after get latest version", 200, lcsResponse.getErrorCode().intValue());
+
+		Product latestProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+
+		expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, latestProduct, operation);
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(latestProduct,
+				auditAction, user, ActionStatus.OK, "0.2", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, latestProduct.getUUID());
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	private void undoCheckOutProductRestricted(User undoCheckoutUser) throws Exception, FileNotFoundException {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout product", 200, lcsResponse.getErrorCode().intValue());
+		Product productToBeUndone = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+
+		lcsResponse = LifecycleRestUtils.changeProductState(productToBeUndone, undoCheckoutUser,
+				LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals("Check response code after undocheckout product", 409, lcsResponse.getErrorCode().intValue());
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(productToBeUndone,
+				auditAction, undoCheckoutUser, ActionStatus.RESTRICTED_OPERATION, "0.2", "0.2",
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				productToBeUndone.getUUID());
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+	private void undoCheckOutProductForbidden(User undoCheckoutUser) throws Exception, FileNotFoundException {
+		RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
+
+		lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout product", 200, lcsResponse.getErrorCode().intValue());
+		Product productToBeUndone = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
+
+		lcsResponse = LifecycleRestUtils.changeProductState(productToBeUndone, undoCheckoutUser,
+				LifeCycleStatesEnum.UNDOCHECKOUT);
+		assertEquals("Check response code after undocheckout product", 403, lcsResponse.getErrorCode().intValue());
+		String[] auditParameters = new String[] { productToBeUndone.getName(), "product",
+				productManager1.getFirstName(), productManager1.getLastName(), productManager1.getUserId() };
+
+		ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
+				auditAction, undoCheckoutUser, ActionStatus.COMPONENT_CHECKOUT_BY_ANOTHER_USER, "0.2", "0.2",
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				productToBeUndone.getUUID(), auditParameters);
+		AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java
new file mode 100644
index 0000000..1cf1697
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java
@@ -0,0 +1,2021 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.property;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.json.simple.parser.JSONParser;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
+import org.openecomp.sdc.be.model.PropertyConstraint;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintDeserialiser;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.resource.ResourceApiTest;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+
+public class AdditionalInformationServletTest extends ComponentBaseTest {
+
+	protected Type constraintType = new TypeToken<PropertyConstraint>() {
+	}.getType();
+
+	protected Gson gson = new GsonBuilder().registerTypeAdapter(constraintType, new PropertyConstraintDeserialiser()).create();
+
+	@Rule
+	public static TestName name = new TestName();
+
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+	protected JSONParser jsonParser = new JSONParser();
+
+	public AdditionalInformationServletTest() {
+		super(name, AdditionalInformationServletTest.class.getName());
+	}
+
+	// @Before
+	// public void deleteResources() {
+	// //TODO Evg : will be new API added for delete by name and version
+	//
+	// ResourceReqDetails resource = getResource();
+	// User user = getUser();
+	//
+	// try {
+	// String resourceName = resource.getResourceName();
+	// ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
+	// "0.1");
+	// ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
+	// "0.2");
+	// ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
+	// "1.0");
+	// ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
+	// "1.1");
+	// ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName +
+	// "aa", "0.1");
+	// resourceUtils.deleteResource_allVersions(resource, user);
+	//
+	// } catch (IOException e) {
+	// assertTrue(false);
+	// }
+	//
+	// try {
+	// ServiceReqDetails serviceDetails = getServiceDetails();
+	//
+	// RestResponse deleteServiceResponse =
+	// serviceUtils.deleteServiceByNameAndVersion(UserUtils.getAdminDetails(),
+	// serviceDetails.getServiceName(), "0.1");
+	//
+	// assertNotNull("check response object is not null after delete
+	// service",deleteServiceResponse);
+	// assertNotNull("check error code exists in response after delete
+	// service",deleteServiceResponse.getErrorCode());
+	// assertTrue("delete service failed status:" +
+	// deleteServiceResponse.getErrorCode(),
+	// deleteServiceResponse.getErrorCode() != 500);
+	//
+	// deleteServiceResponse =
+	// serviceUtils.deleteServiceByNameAndVersion(UserUtils.getAdminDetails(),
+	// serviceDetails.getServiceName(), "1.0");
+	//
+	// assertNotNull("check response object is not null after delete
+	// service",deleteServiceResponse);
+	// assertNotNull("check error code exists in response after delete
+	// service",deleteServiceResponse.getErrorCode());
+	// assertTrue("delete service failed status:" +
+	// deleteServiceResponse.getErrorCode(),
+	// deleteServiceResponse.getErrorCode() != 500);
+	//
+	// serviceUtils.deleteService_allVersions(serviceDetails, user);
+	//
+	// } catch (IOException e) {
+	// assertTrue(false);
+	// }
+	// }
+
+	@Test
+	public void updateResourceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		AssertJUnit.assertNotNull("check response object is not null after create resource", createResourceResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		String updatedKey = "ZZZ  ZZZ";
+		String updatedValue = "JJJJ";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		AssertJUnit.assertNotNull("check response object is not null after create property", createProperty);
+		AssertJUnit.assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		AssertJUnit.assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		AssertJUnit.assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		fromJson.setKey(updatedKey);
+		fromJson.setValue(updatedValue);
+
+		RestResponse updatedProperty = updateAdditionalInformation(resourceId, fromJson, user, fromJson.getUniqueId());
+		AssertJUnit.assertNotNull("check response object is not null after update additional information", updatedProperty);
+		AssertJUnit.assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after additional information", 200, updatedProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo updatedJson = gson.fromJson(updatedProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		AssertJUnit.assertFalse("check number of spaces", updatedJson.getKey().contains("  "));
+		AssertJUnit.assertEquals("check returned key", "ZZZ ZZZ", updatedJson.getKey());
+		AssertJUnit.assertEquals("check returned value", updatedValue, updatedJson.getValue());
+		AssertJUnit.assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
+
+	}
+
+	@Test
+	public void deleteResourceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		AssertJUnit.assertNotNull("check response object is not null after create resource", createResourceResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		AssertJUnit.assertNotNull("check response object is not null after create property", createProperty);
+		AssertJUnit.assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		AssertJUnit.assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		AssertJUnit.assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		RestResponse deletedProperty = deleteAdditionalInformation(resourceId, fromJson.getUniqueId(), user);
+		AssertJUnit.assertNotNull("check response object is not null after update additional information", deletedProperty);
+		AssertJUnit.assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		AssertJUnit.assertFalse("check number of spaces", updatedJson.getKey().contains("  "));
+		AssertJUnit.assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
+		AssertJUnit.assertEquals("check returned value", value, updatedJson.getValue());
+		AssertJUnit.assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
+
+		deletedProperty = deleteAdditionalInformation(resourceId, fromJson.getUniqueId(), user);
+		AssertJUnit.assertNotNull("check response object is not null after update additional information", deletedProperty);
+		AssertJUnit.assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after additional information", 409, deletedProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceAdditionalInformationTestDuringLifecycle() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		AssertJUnit.assertNotNull("check response object is not null after create resource", createResourceResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		AssertJUnit.assertNotNull("check response object is not null after create property", createProperty);
+		AssertJUnit.assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		AssertJUnit.assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		AssertJUnit.assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		resource.setUniqueId(resourceId);
+
+		// resourceUtils.addResourceMandatoryArtifacts(user,
+		// createResourceResponse);
+
+		certifyResource(user, resource, null, 1);
+
+	}
+
+	public RestResponse createService() {
+
+		User user = getUser();
+		ServiceReqDetails serviceDetails = getServiceDetails();
+
+		RestResponse createServiceResponse = null;
+		try {
+			createServiceResponse = ServiceRestUtils.createService(serviceDetails, user);
+			AssertJUnit.assertNotNull("check response object is not null after create user", createServiceResponse);
+			AssertJUnit.assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
+			AssertJUnit.assertEquals("Check response code after checkout resource", 201, createServiceResponse.getErrorCode().intValue());
+		} catch (Exception e) {
+			AssertJUnit.assertTrue(false);
+		}
+
+		return createServiceResponse;
+
+	}
+
+	protected User getUser() {
+		String adminFirstName = "Jimmy";
+		String adminLastName = "Hendrix";
+		String adminUserId = "jh0003";
+		return new User(adminFirstName, adminLastName, adminUserId, null, null, null);
+	}
+
+	protected ResourceReqDetails getResource() {
+		String resourceName = "ciResourceforproperty4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "pe0123";
+		String icon = "myICON";
+		ResourceReqDetails resource = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resource.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
+		return resource;
+	}
+
+	protected RestResponse createResource(ResourceReqDetails resourceDetails, User sdncModifierDetails) throws IOException {
+
+		ResourceApiTest rat = new ResourceApiTest();
+		ResourceReqDetails resourceObj = rat.getResourceObj();
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+		RestResponse createResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
+
+		return createResourceResponse;
+
+	}
+
+	protected RestResponse getResource(User sdncModifierDetails, String resourceUid) throws IOException {
+
+		ResourceApiTest rat = new ResourceApiTest();
+		ResourceReqDetails resourceObj = rat.getResourceObj();
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid);
+		RestResponse createResourceResponse = http.httpSendGet(url, headersMap);
+
+		return createResourceResponse;
+
+	}
+
+	protected RestResponse deleteResource(String resourceName, String resourceVersion, User sdncModifierDetails) throws IOException {
+		RestResponse deleteResourceResponse = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceName, resourceVersion);
+
+		return deleteResourceResponse;
+
+	}
+
+	protected RestResponse updateAdditionalInformation(String resourceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails, String id) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String body = gson.toJson(additionalInfo);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
+		return http.httpSendPut(url, body, headersMap);
+
+	}
+
+	protected RestResponse updateServiceAdditionalInformation(String resourceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails, String id) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String body = gson.toJson(additionalInfo);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
+		return http.httpSendPut(url, body, headersMap);
+
+	}
+
+	protected RestResponse deleteAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.DELETE_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
+		return http.httpSendDelete(url, headersMap);
+
+	}
+
+	protected RestResponse deleteServiceAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.DELETE_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
+		return http.httpSendDelete(url, headersMap);
+
+	}
+
+	protected RestResponse getAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	protected RestResponse getServiceAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	protected RestResponse getResourceAllAdditionalInformation(String resourceId, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ALL_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	protected RestResponse getServiceAllAdditionalInformation(String resourceId, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ALL_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	protected RestResponse createResourceAdditionalInformation(String resourceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String body = gson.toJson(additionalInfo);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
+		return http.httpSendPost(url, body, headersMap);
+
+	}
+
+	protected RestResponse createServiceAdditionalInformation(String serviceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String body = gson.toJson(additionalInfo);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
+		return http.httpSendPost(url, body, headersMap);
+
+	}
+
+	protected ServiceReqDetails getServiceDetails() {
+		String serviceName = "ciNewTestService21";
+		String category = ServiceCategoriesEnum.MOBILITY.getValue();
+		ArrayList<String> tags = new ArrayList<String>();
+		tags.add("serviceTag");
+		tags.add(serviceName);
+		String description = "service Description";
+		String vendorName = "Oracle";
+		String vendorRelease = "0.1";
+		String contactId = "al1976";
+		String icon = "myIcon";
+
+		return new ServiceReqDetails(serviceName, category, tags, description, contactId, icon);
+	}
+
+	// TODO Tal: Since Cashing change partial resource returned that causes null
+	// pointer exception in line:
+	// commented out till fixing
+	protected Resource certifyResource(User user, ResourceReqDetails resource, String resourceVersion, int numberOfAI) throws IOException {
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN);
+
+		AssertJUnit.assertNotNull("check response object is not null after create user", checkInResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create user", checkInResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create user", 200, checkInResponse.getErrorCode().intValue());
+
+		Resource resourceAfterOperation = gson.fromJson(checkInResponse.getResponse(), Resource.class);
+		// TODO Tal: Since Cashing change partial resource returned that causes
+		// null pointer exception
+		/*
+		 * AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		 */
+		/*
+		 * AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0). getParameters().size());
+		 */
+
+		RestResponse req4certResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+
+		AssertJUnit.assertNotNull("check response object is not null after create user", req4certResponse);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200, req4certResponse.getErrorCode().intValue());
+
+		resourceAfterOperation = gson.fromJson(req4certResponse.getResponse(), Resource.class);
+		// TODO Tal: Since Cashing change partial resource returned that causes
+		// null pointer exception
+		/*
+		 * AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		 */
+		/*
+		 * AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0). getParameters().size());
+		 */
+
+		// change modifier
+		user.setUserId(UserRoleEnum.TESTER.getUserId());
+		// start certification
+
+		RestResponse startCertResourceResponse3 = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		AssertJUnit.assertNotNull("check response object is not null after create user", startCertResourceResponse3);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200, startCertResourceResponse3.getErrorCode().intValue());
+
+		resourceAfterOperation = gson.fromJson(startCertResourceResponse3.getResponse(), Resource.class);
+		// TODO Tal: Since Cashing change partial resource returned that causes
+		// null pointer exception
+		/*
+		 * AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		 */
+		/*
+		 * AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0). getParameters().size());
+		 */
+
+		// certify
+
+		RestResponse certifyResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFY);
+		AssertJUnit.assertNotNull("check response object is not null after create user", certifyResponse);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200, certifyResponse.getErrorCode().intValue());
+
+		resourceAfterOperation = gson.fromJson(certifyResponse.getResponse(), Resource.class);
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+
+		Resource certifyResource = gson.fromJson(certifyResponse.getResponse(), Resource.class);
+		return certifyResource;
+	}
+
+	protected Resource certifyService(User user, ServiceReqDetails service, String resourceVersion) throws Exception {
+		RestResponse checkInResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKIN);
+
+		AssertJUnit.assertNotNull("check response object is not null after create user", checkInResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create user", checkInResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create user", 200, checkInResponse.getErrorCode().intValue());
+
+		Resource resourceAfterOperation = gson.fromJson(checkInResponse.getResponse(), Resource.class);
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+
+		RestResponse req4certResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+
+		AssertJUnit.assertNotNull("check response object is not null after create user", req4certResponse);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200, req4certResponse.getErrorCode().intValue());
+
+		resourceAfterOperation = gson.fromJson(req4certResponse.getResponse(), Resource.class);
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+
+		// change modifier
+		user.setUserId(UserRoleEnum.TESTER.getUserId());
+		// start certification
+
+		RestResponse startCertResourceResponse3 = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		AssertJUnit.assertNotNull("check response object is not null after create user", startCertResourceResponse3);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200, startCertResourceResponse3.getErrorCode().intValue());
+
+		resourceAfterOperation = gson.fromJson(startCertResourceResponse3.getResponse(), Resource.class);
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+
+		// certify
+
+		RestResponse certifyResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CERTIFY);
+		AssertJUnit.assertNotNull("check response object is not null after create user", certifyResponse);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200, certifyResponse.getErrorCode().intValue());
+
+		resourceAfterOperation = gson.fromJson(certifyResponse.getResponse(), Resource.class);
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+		AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+
+		Resource certifyResource = gson.fromJson(certifyResponse.getResponse(), Resource.class);
+		return certifyResource;
+	}
+
+	@Test
+	public void createResourceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceAdditionalInfoFormatWithTags() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "<b>Bold<</b>";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertEquals("check returned key", "Bold&amp;lt;", fromJson.getValue());
+
+	}
+
+	@Test
+	public void createServiceAdditionalInfoFormatWithTags() throws Exception {
+		User user = getUser();
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		assertNotNull("check response object is not null after create resource", createServiceResponse);
+		assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createServiceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "<b>Bold<</b>";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertEquals("check returned key", "Bold&amp;lt;", fromJson.getValue());
+
+	}
+
+	@Test
+	public void createResourceAdditionalInfoFormatWithWhiteSpaces() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "      ";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+		key = "    ";
+		value = "AAA  AAA";
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceAdditionalInfoFormatWithWhiteSpaces() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+		ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		assertNotNull("check response object is not null after create resource", createServiceResponse);
+		assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createServiceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "      ";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+		key = "    ";
+		value = "AAA  AAA";
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceAndUpdateAdditionalInfo() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		key = "BBB  BBB";
+		value = "BBBB";
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "BBB BBB", fromJson.getKey());
+
+		String updatedKey = "AAA  AAA";
+		String updatedValue = "JJJJ";
+
+		fromJson.setKey(updatedKey);
+		fromJson.setValue(updatedValue);
+
+		RestResponse updatedProperty = updateAdditionalInformation(resourceId, fromJson, user, fromJson.getUniqueId());
+		assertNotNull("check response object is not null after update additional information", updatedProperty);
+		assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 409, updatedProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceEmptyAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+		key = "BBBB";
+		value = "";
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceEmptyAdditionalInformationTest() throws Exception {
+
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceAllSpacesAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "           ";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceAllSpacesAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "           ";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceInvalidKeyAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "abc?";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceInvalidKeyAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "abc?";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceAdditionalInformationNullKeyTest() throws Exception {
+
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		String key = null;
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceAdditionalInformationNullKeyTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = null;
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceMaximumInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		for (int i = 0; i < 50; i++) {
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
+
+			RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		}
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceLifeCycleAndMaximumInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+		resource.setUniqueId(resourceId);
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		for (int i = 0; i < 49; i++) {
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
+
+			RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		}
+
+		String resourceVersion = "0.1";
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+
+		assertNotNull("check response object is not null after create property", checkInResponse);
+		assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
+		assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
+
+		resourceVersion = "0.2";
+
+		RestResponse checkOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
+
+		resourceId = ResponseParser.getUniqueIdFromResponse(checkOutResponse);
+		resource.setUniqueId(resourceId);
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+		RestResponse checkUndoOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.UNDOCHECKOUT, null);
+
+		resourceVersion = "0.1";
+
+		checkOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
+		resourceId = ResponseParser.getUniqueIdFromResponse(checkOutResponse);
+		resource.setUniqueId(resourceId);
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceLifeCycleCertifyAndMaximumInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+		resource.setUniqueId(resourceId);
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		for (int i = 0; i < 49; i++) {
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
+
+			RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		}
+
+		String resourceVersion = "0.1";
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+
+		// resourceUtils.addResourceMandatoryArtifacts(user,
+		// createResourceResponse);
+
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+
+		assertNotNull("check response object is not null after create property", checkInResponse);
+		assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
+		assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
+
+		RestResponse changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST, null);
+		changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION, null);
+		changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFY, null);
+
+		assertNotNull("check response object is not null after create property", checkInResponse);
+		assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
+		assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
+
+		resourceId = ResponseParser.getUniqueIdFromResponse(changeStateResponse);
+		resource.setUniqueId(resourceId);
+
+		resourceVersion = "1.0";
+
+		changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
+		resourceId = ResponseParser.getUniqueIdFromResponse(changeStateResponse);
+		resource.setUniqueId(resourceId);
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceCycleAndMaximumInformationTest() throws Exception {
+
+		User user = getUser();
+
+		ServiceReqDetails service = getServiceDetails();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		assertNotNull("check response object is not null after create resource", createServiceResponse);
+		assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createServiceResponse.getErrorCode().intValue());
+
+		service.setUniqueId(serviceId);
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		for (int i = 0; i < 49; i++) {
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
+
+			RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		}
+
+		String resourceVersion = "0.1";
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+		RestResponse checkInResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
+
+		assertNotNull("check response object is not null after create property", checkInResponse);
+		assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
+		assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
+
+		resourceVersion = "0.2";
+
+		RestResponse checkOutResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
+
+		serviceId = ResponseParser.convertServiceResponseToJavaObject(checkOutResponse.getResponse()).getUniqueId();
+		service.setUniqueId(serviceId);
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
+		createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+		RestResponse checkUndoOutResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.UNDOCHECKOUT, null);
+
+		resourceVersion = "0.1";
+
+		checkOutResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
+		serviceId = ResponseParser.convertServiceResponseToJavaObject(checkOutResponse.getResponse()).getUniqueId();
+		service.setUniqueId(serviceId);
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
+		createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
+		createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createServiceMaximumInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		String lastCreatedProperty = null;
+
+		for (int i = 0; i < 50; i++) {
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
+
+			RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+			AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+			lastCreatedProperty = fromJson.getUniqueId();
+
+		}
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
+
+		RestResponse deletedProperty = deleteServiceAdditionalInformation(serviceId, lastCreatedProperty, user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+		createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void updateServiceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		String updatedKey = "ZZZ  ZZZ";
+		String updatedValue = "JJJJ";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		fromJson.setKey(updatedKey);
+		fromJson.setValue(updatedValue);
+
+		RestResponse updatedProperty = updateServiceAdditionalInformation(serviceId, fromJson, user, fromJson.getUniqueId());
+		assertNotNull("check response object is not null after update additional information", updatedProperty);
+		assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, updatedProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo updatedJson = gson.fromJson(updatedProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", updatedJson.getKey().contains("  "));
+		assertEquals("check returned key", "ZZZ ZZZ", updatedJson.getKey());
+		assertEquals("check returned value", updatedValue, updatedJson.getValue());
+		assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
+
+		fromJson.setKey(updatedKey);
+		fromJson.setValue("\uC2B5");
+
+		updatedProperty = updateServiceAdditionalInformation(serviceId, fromJson, user, fromJson.getUniqueId());
+		assertNotNull("check response object is not null after update additional information", updatedProperty);
+		assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 400, updatedProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void deleteServiceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		RestResponse deletedProperty = deleteServiceAdditionalInformation(serviceId, fromJson.getUniqueId(), user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", updatedJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
+		assertEquals("check returned value", value, updatedJson.getValue());
+		assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
+
+		deletedProperty = deleteServiceAdditionalInformation(serviceId, fromJson.getUniqueId(), user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 409, deletedProperty.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void getResourceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		RestResponse deletedProperty = getAdditionalInformation(resourceId, fromJson.getUniqueId(), user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", updatedJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
+		assertEquals("check returned value", value, updatedJson.getValue());
+		assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
+
+	}
+
+	@Test
+	public void getServiceAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		RestResponse deletedProperty = getServiceAdditionalInformation(serviceId, fromJson.getUniqueId(), user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", updatedJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
+		assertEquals("check returned value", value, updatedJson.getValue());
+		assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
+
+	}
+
+	@Test
+	public void getResourceAllAdditionalInformationTest() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		RestResponse deletedProperty = getResourceAllAdditionalInformation(resourceId, user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		AdditionalInformationDefinition updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInformationDefinition.class);
+		assertEquals("check number of parameters", 1, updatedJson.getParameters().size());
+		AdditionalInfoParameterInfo info = updatedJson.getParameters().iterator().next();
+
+		assertFalse("check number of spaces", info.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", info.getKey());
+		assertEquals("check returned value", value, info.getValue());
+		assertEquals("check returned id", fromJson.getUniqueId(), info.getUniqueId());
+
+	}
+
+	@Test
+	public void getServiceAllAdditionalInformationTest() throws Exception {
+		User user = getUser();
+
+		RestResponse createServiceResponse = createService();
+
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+
+		String key = "AAA  AAA";
+		String value = "BBBB";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		RestResponse deletedProperty = getServiceAllAdditionalInformation(serviceId, user);
+		assertNotNull("check response object is not null after update additional information", deletedProperty);
+		assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
+		assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
+
+		AdditionalInformationDefinition updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInformationDefinition.class);
+		assertEquals("check number of parameters", 1, updatedJson.getParameters().size());
+		AdditionalInfoParameterInfo info = updatedJson.getParameters().iterator().next();
+
+		assertFalse("check number of spaces", info.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", info.getKey());
+		assertEquals("check returned value", value, info.getValue());
+		assertEquals("check returned id", fromJson.getUniqueId(), info.getUniqueId());
+
+	}
+
+	@Test
+	public void createServiceAdditionalInformationTestDuringLifecycle() throws Exception {
+
+		User user = getUser();
+		RestResponse createServiceResponse = createService();
+		String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
+		String key = "AAA  AAA";
+		String value = "BBBB";
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+		AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
+		assertFalse("check number of spaces", fromJson.getKey().contains("  "));
+		assertEquals("check returned key", "AAA AAA", fromJson.getKey());
+
+		ServiceReqDetails serviceDetails = getServiceDetails();
+
+		serviceDetails.setUniqueId(serviceId);
+
+		// serviceUtils.addServiceMandatoryArtifacts(user,
+		// createServiceResponse);
+
+		certifyService(user, serviceDetails, null);
+
+	}
+
+	@Test
+	public void createCascadeResource() {
+
+		// TODO: to check after rebase
+
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+		String newResourceNameSuffix = "aa";
+
+		RestResponse createResourceResponse = null;
+		try {
+
+			createResourceResponse = createResource(resource, user);
+			assertEquals("check invalid type", 201, createResourceResponse.getErrorCode().intValue());
+			String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+			String resourceVersion = "0.1";
+			// resourceUtils.addResourceMandatoryArtifacts(user,
+			// createResourceResponse);
+
+			String key = "AAA  AAA";
+			String value = "BBBB";
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+			RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+			resource.setUniqueId(resourceId);
+			Resource certifiedResource = certifyResource(user, resource, resourceVersion, 1);
+
+			ResourceReqDetails newResourceDetails = getResource();
+			String newResourceName = newResourceDetails.getName() + newResourceNameSuffix;
+			newResourceDetails.setName(newResourceName);
+			List<String> derivedFrom = new ArrayList<>();
+			derivedFrom.add(certifiedResource.getName());
+			newResourceDetails.setDerivedFrom(derivedFrom);
+			newResourceDetails.getTags().add(newResourceName);
+
+			user.setUserId(UserRoleEnum.ADMIN.getUserId());
+			RestResponse newCreateResourceResponse = createResource(newResourceDetails, user);
+			assertEquals("Check response code after creating resource", 201, newCreateResourceResponse.getErrorCode().intValue());
+			Resource newResource = gson.fromJson(newCreateResourceResponse.getResponse(), Resource.class);
+
+			RestResponse allAdditionalInformation = getResourceAllAdditionalInformation(newResource.getUniqueId(), user);
+
+			assertNotNull("check response object is not null after update additional information", allAdditionalInformation);
+			assertNotNull("check error code exists in response after additional information", allAdditionalInformation.getErrorCode());
+			assertEquals("Check response code after additional information", 200, allAdditionalInformation.getErrorCode().intValue());
+
+			AdditionalInformationDefinition updatedJson = gson.fromJson(allAdditionalInformation.getResponse(), AdditionalInformationDefinition.class);
+			assertEquals("check number of parameters", 0, updatedJson.getParameters().size());
+			// AdditionalInfoParameterInfo info =
+			// updatedJson.getParameters().iterator().next();
+
+			String newResourceId = newResource.getUniqueId();
+			createProperty = createResourceAdditionalInformation(newResourceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+			allAdditionalInformation = getResourceAllAdditionalInformation(newResourceId, user);
+
+			assertNotNull("check response object is not null after update additional information", allAdditionalInformation);
+			assertNotNull("check error code exists in response after additional information", allAdditionalInformation.getErrorCode());
+			assertEquals("Check response code after additional information", 200, allAdditionalInformation.getErrorCode().intValue());
+
+			updatedJson = gson.fromJson(allAdditionalInformation.getResponse(), AdditionalInformationDefinition.class);
+			assertEquals("check number of parameters", 1, updatedJson.getParameters().size());
+
+		} catch (IOException e) {
+			assertTrue(false);
+		}
+
+	}
+
+	@Test
+	public void createSamePropertyAfterCiCOResource() {
+
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		RestResponse createResourceResponse = null;
+		try {
+
+			createResourceResponse = createResource(resource, user);
+			assertEquals("check invalid type", 201, createResourceResponse.getErrorCode().intValue());
+			String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+			String resourceVersion = "0.1";
+			// resourceUtils.addResourceMandatoryArtifacts(user,
+			// createResourceResponse);
+
+			String key = "AAA  AAA";
+			String value = "BBBB";
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+			RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+			assertNotNull("check response object is not null after create property", createProperty);
+			assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+			resource.setUniqueId(resourceId);
+			RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN);
+
+			assertNotNull("check response object is not null after create user", checkInResponse);
+			assertNotNull("check error code exists in response after create user", checkInResponse.getErrorCode());
+			assertEquals("Check response code after create user", 200, checkInResponse.getErrorCode().intValue());
+
+			Resource resourceAfterOperation = gson.fromJson(checkInResponse.getResponse(), Resource.class);
+			assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
+			assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+
+			RestResponse checkOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT);
+
+			assertNotNull("check response object is not null after create user", checkOutResponse);
+			assertNotNull("check error code exists in response after create user", checkOutResponse.getErrorCode());
+			assertEquals("Check response code after create user", 200, checkOutResponse.getErrorCode().intValue());
+
+			Resource resourceAfterCoOperation = gson.fromJson(checkOutResponse.getResponse(), Resource.class);
+			assertEquals("check size of additional information", 1, resourceAfterCoOperation.getAdditionalInformation().size());
+			assertEquals("check size of additional information", 1, resourceAfterCoOperation.getAdditionalInformation().get(0).getParameters().size());
+
+			String newResourceId = ResponseParser.getUniqueIdFromResponse(checkOutResponse);
+
+			String key2 = "ZZZ";
+			String value2 = "BBBB";
+
+			AdditionalInfoParameterInfo additionalInfoParameterInfo2 = new AdditionalInfoParameterInfo(null, key2, value2);
+
+			RestResponse createProperty2 = createResourceAdditionalInformation(newResourceId, additionalInfoParameterInfo2, user);
+			assertNotNull("check response object is not null after create property", createProperty2);
+			assertNotNull("check error code exists in response after create property", createProperty2.getErrorCode());
+			assertEquals("Check response code after create property", 201, createProperty2.getErrorCode().intValue());
+
+			RestResponse afterCreateAI = ResourceRestUtils.getResource(user, newResourceId);
+			Resource resourceNew = gson.fromJson(afterCreateAI.getResponse(), Resource.class);
+			assertEquals("check size of additional information", 1, resourceNew.getAdditionalInformation().size());
+			assertEquals("check size of additional information", 2, resourceNew.getAdditionalInformation().get(0).getParameters().size());
+
+			resource.setUniqueId(newResourceId);
+			Resource certifiedResource = certifyResource(user, resource, resourceVersion, 2);
+			assertEquals("check size of additional information", 1, certifiedResource.getAdditionalInformation().size());
+			assertEquals("check size of additional information", 2, certifiedResource.getAdditionalInformation().get(0).getParameters().size());
+
+			user.setUserId(UserRoleEnum.DESIGNER.getUserId());
+			resource.setUniqueId(certifiedResource.getUniqueId());
+			RestResponse checkOutResponseAfterCertify = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT);
+
+			assertNotNull("check response object is not null after create user", checkOutResponseAfterCertify);
+			assertNotNull("check error code exists in response after create user", checkOutResponseAfterCertify.getErrorCode());
+			assertEquals("Check response code after create user", 200, checkOutResponseAfterCertify.getErrorCode().intValue());
+
+			Resource resourceAfterCertifyCoOperation = gson.fromJson(checkOutResponseAfterCertify.getResponse(), Resource.class);
+			assertEquals("check size of additional information", 1, resourceAfterCertifyCoOperation.getAdditionalInformation().size());
+			assertEquals("check size of additional information", 2, resourceAfterCertifyCoOperation.getAdditionalInformation().get(0).getParameters().size());
+
+		} catch (IOException e) {
+			assertTrue(false);
+		}
+
+	}
+
+	// public Resource certifyService(User user, ServiceReqDetails service,
+	// String resourceVersion) throws Exception {
+	//
+	// RestResponse checkInResponse =
+	// LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
+	// LifeCycleStates.CHECKIN);
+	//
+	// assertNotNull("check response object is not null after create user",
+	// checkInResponse);
+	// assertNotNull("check error code exists in response after create user",
+	// checkInResponse.getErrorCode());
+	// assertEquals("Check response code after create user", 200,
+	// checkInResponse.getErrorCode().intValue());
+	//
+	// Resource resourceAfterOperation =
+	// gson.fromJson(checkInResponse.getResponse(), Resource.class);
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().size());
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+	//
+	//// TODO Andrey
+	// createAndAddCertResourceToService(service, user);
+	//
+	// RestResponse req4certResponse =
+	// LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
+	// LifeCycleStates.CERTIFICATIONREQUEST);
+	//
+	// assertNotNull("check response object is not null after create user",
+	// req4certResponse);
+	// assertEquals("Check response code after checkout resource", 200,
+	// req4certResponse.getErrorCode().intValue());
+	//
+	// resourceAfterOperation = gson.fromJson(req4certResponse.getResponse(),
+	// Resource.class);
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().size());
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+	//
+	// //change modifier
+	// user.setUserId(UserRoleEnum.TESTER.getUserId());
+	//
+	// //start certification
+	// RestResponse startCertResourceResponse3 =
+	// LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
+	// LifeCycleStates.STARTCERTIFICATION);
+	// assertNotNull("check response object is not null after create user",
+	// startCertResourceResponse3);
+	// assertEquals("Check response code after checkout resource", 200,
+	// startCertResourceResponse3.getErrorCode().intValue());
+	//
+	// resourceAfterOperation =
+	// gson.fromJson(startCertResourceResponse3.getResponse(), Resource.class);
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().size());
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+	//
+	// //certify
+	//
+	// RestResponse certifyResponse =
+	// LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
+	// LifeCycleStates.CERTIFY);
+	// assertNotNull("check response object is not null after create user",
+	// certifyResponse);
+	// assertEquals("Check response code after checkout resource", 200,
+	// certifyResponse.getErrorCode().intValue());
+	//
+	// resourceAfterOperation = gson.fromJson(certifyResponse.getResponse(),
+	// Resource.class);
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().size());
+	// assertEquals("check size of additional information", 1,
+	// resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
+	//
+	// Resource certifyResource = gson.fromJson(certifyResponse.getResponse(),
+	// Resource.class);
+	// return certifyResource;
+	// }
+
+	private void createAndAddCertResourceToService(ServiceReqDetails serviceDetails, User user) throws Exception {
+
+		User sdncTesterUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
+
+		RestResponse response = ResourceRestUtils.createResource(resourceDetails, user);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetails.getUniqueId());
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, user, resourceDetails.getUniqueId());
+		assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(), response.getErrorCode() == 200);
+
+		// certified resource
+		// response = LCSbaseTest.certifyResource(resourceDetails);
+		RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, LifeCycleStatesEnum.CHECKIN);
+		assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterUser, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterUser, LifeCycleStatesEnum.CERTIFY);
+		assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
+
+		// add resource instance with HEAT deployment artifact to the service
+		restResponseResource = LifecycleRestUtils.changeServiceState(serviceDetails, user, serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
+		resourceInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, user, serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
+	}
+
+	@Test
+	public void createResourceAdditionalInformationTestAddValue() throws Exception {
+		User user = getUser();
+		ResourceReqDetails resource = getResource();
+
+		// deleteResource(resourceId, user);
+		RestResponse createResourceResponse = createResource(resource, user);
+
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse);
+		assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
+
+		String key = "AAA  AAA";
+		String value = "\uC2B5";
+
+		AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+		value = "";
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
+
+		value = "----<b></b><>;";
+
+		additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
+
+		createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
+		assertNotNull("check response object is not null after create property", createProperty);
+		assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
+		assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java
new file mode 100644
index 0000000..6ba1b2c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java
@@ -0,0 +1,1263 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.property;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import fj.data.Either;
+
+// open bug for this class: DE199108 - closed, DE199741
+public class ComponentInstancePropertyTest extends ComponentBaseTest {
+
+	protected Resource basicVFC;
+	protected Resource vfc1FromBasicVFC;
+	protected Resource vfc2FromVfc1;
+	protected Resource vfResource;
+
+	private List<ComponentInstanceProperty> expectedPropertyList;
+	private List<ComponentInstanceProperty> actualPropertyList;
+	// protected String updatedStringValue = "{Not Default String Value}";
+	protected String updatedStringValue = "Not Default String Value";
+	protected String updatedIntegerValue = "666";
+	protected String updatedBooleanValue = "false";
+	protected String newStringPropName = "stringProp2";
+	protected String newIntegerPropName = "integerProp2";
+	protected String newBooleanPropName = "booleanProp2";
+	// bug DE199741 protected String newStringPropValue = "<second string
+	// value>";
+	protected String newStringPropValue = "second string value";
+	protected String newIntegerPropValue = "888";
+	protected String newBooleanPropValue = "false";
+
+	@BeforeMethod
+	public void init() {
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ComponentInstancePropertyTest() {
+		super(name, ComponentInstancePropertyTest.class.getName());
+	}
+
+	// --------------Regular
+	// resource-------------------------------------------------------------------------------
+
+	@Test
+	public void nestedResourceProperty3Levels() throws Exception {
+
+		// first res
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		// second resource
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		// third resource
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		// verify property
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, actualPropertyList);
+		assertTrue("check list size failed, expected 3", actualPropertyList.size() == 3);
+
+	}
+
+	// --------------VF
+	// resource-----------------------------------------------------------
+
+	@Test
+	public void nestedVfResourceProperty3Levels() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		// verify property
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+	}
+
+	@Test
+	public void nestedVfResourceProperty3LevelsAndCpWithProp() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// four resource
+		Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
+				NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
+		cpStringProperty.setName("Different Name");
+		cpStringProperty.setPropertyDefaultValue("Different value from default");
+		AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, cp, expectedPropertyList,
+				vfResource);
+		// verify property
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+	}
+
+	@Test
+	public void nestedCertifiedVfResourceProperty3Levels() throws Exception {
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CERTIFY, vfc1FromBasicVFC);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		// verify property
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+	}
+
+	@Test
+	public void nestedVfResourceProperty3Levels2SameResInstances() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		// verify property
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+	}
+
+	// ------------------update resource
+	// property-----------------------------------
+
+	@Test
+	public void nestedVfResourceProperty3LevelsUpdateFirstLevelProperty() throws Exception {
+		// first res
+		basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addDefaultPropertyToResource(PropertyTypeEnum.STRING, basicVFC, UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+
+		// verify property
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedStringValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(vfResource, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	@Test
+	public void nestedVfResourceProperty3LevelsUpdateSecondLevelProperty() throws Exception {
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+
+		// second resource
+		vfc1FromBasicVFC = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
+				basicVFC, ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true).left().value();
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addCustomPropertyToResource(ElementFactory.getDefaultIntegerProperty(), vfc1FromBasicVFC,
+						UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(vfc1FromBasicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY,
+				true);
+
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+
+		// verify property
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedIntegerValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(vfResource, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue(
+				"expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS
+						+ " ,but was " + updatePropertyValueOnResourceInstance.getErrorCode(),
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated properly",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	@Test
+	public void nestedVfResourceProperty3LevelsUpdateThirdLevelProperty() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+
+		// third resource
+		vfc2FromVfc1 = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
+				vfc1FromBasicVFC, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addCustomPropertyToResource(ElementFactory.getDefaultBooleanProperty(), vfc2FromVfc1,
+						UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(vfc2FromVfc1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN,
+				true);
+
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+
+		// verify property
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedBooleanValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(vfResource, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	// ---------------------Service------------------------------------------------------------------------
+
+	/**
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p3) (p2) (p1)
+	 */
+	@Test
+	public void serviceWithNestedResourceProperty3Levels() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+	}
+
+	/**
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1)
+	 */
+	@Test
+	public void serviceWithNestedResourceProperty3LevelsAndVfProperty() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		PropertyReqDetails propDetails = ElementFactory.getDefaultBooleanProperty();
+		propDetails.setName(newBooleanPropName);
+		propDetails.setPropertyDefaultValue(newBooleanPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(propDetails, vfResource, UserRoleEnum.DESIGNER, true);
+		propDetails = ElementFactory.getDefaultStringProperty();
+		propDetails.setName(newStringPropName);
+		propDetails.setPropertyDefaultValue(newStringPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(propDetails, vfResource, UserRoleEnum.DESIGNER, true);
+		propDetails = ElementFactory.getDefaultIntegerProperty();
+		propDetails.setName(newIntegerPropName);
+		propDetails.setPropertyDefaultValue(newIntegerPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(propDetails, vfResource, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfResource, expectedPropertyList);
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+	}
+
+	/**
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1) CP(VF inst) (p5)
+	 */
+	@Test
+	public void serviceWithNestedResourceProperty3LevelsAndCp() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// four resource
+		Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
+				NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
+		cpStringProperty.setName("Different Name");
+		cpStringProperty.setPropertyDefaultValue("Different value from default");
+		AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, cp, expectedPropertyList,
+				vfResource);
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+	}
+
+	/**
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1) CP(inst) (p5)
+	 */
+	@Test
+	public void serviceWithNestedResourceProperty3LevelsAndCpResInst() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		// expectedPropertyList =
+		// PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1,
+		// expectedPropertyList);
+
+		// four resource
+		Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
+				NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
+		cpStringProperty.setName("Different Name");
+		cpStringProperty.setPropertyDefaultValue("Different value from default");
+		AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(cp, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, service, UserRoleEnum.DESIGNER, true).left().value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+	}
+
+	/**
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) | (p3) (p2) (p1)
+	 * | (VFC(inst)-->VFC-->VFC-->VFC) (p3) (p2) (p1)
+	 * 
+	 * VF2(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) | (p3') (p2') (p1') |
+	 * (VFC(inst)-->VFC-->VFC-->VFC) (p3) (p2) (p1)
+	 */
+	@Test
+	public void serviceNestedVfResourceProperty3Levels2SameResInstances() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		// verify property
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
+				vfResource);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+	}
+
+	// service test template
+	/**
+	 * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1)
+	 */
+	@Test
+	public void serviceNestedVfResourceProperty3LevelsAndSelfVfProperty() throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+		PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
+		newProp.setName(newStringPropName);
+		newProp.setPropertyDefaultValue(newStringPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+	}
+
+	/**
+	 * update property(p4)
+	 * 
+	 * 
+	 * VFC(p1) ^ | VFC(p2) ^ | Service-->VF(inst)-->VF-->(VFC(inst)-->VFC(p3)
+	 * (p4)
+	 */
+	@Test
+	public void serviceNestedVfResourceProperty3LevelsAndSelfVfProperty_UpdateVfproperty() throws Exception {
+		// Create VFC(check-in state) derived from another resource
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+
+		// add property to VF
+		PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
+		newProp.setName(newStringPropName);
+		newProp.setPropertyDefaultValue(newStringPropValue);
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update VF instance property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedStringValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(service, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	/**
+	 * update property(p1)
+	 * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1)
+	 */
+	@Test
+	public void serviceNestedVfResourceProperty3LevelsAndSelfVfPropertyUpdateVfInheritance1LevelProperty()
+			throws Exception {
+
+		basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addDefaultPropertyToResource(PropertyTypeEnum.STRING, basicVFC, UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// verify property
+		PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
+		newProp.setName(newStringPropName);
+		newProp.setPropertyDefaultValue(newStringPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update VF property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedStringValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(service, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	/**
+	 * update property(p2)
+	 * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1)
+	 */
+	@Test
+	public void serviceNestedVfResourceProperty3LevelsAndSelfVfPropertyUpdateVfInheritance2LevelProperty()
+			throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
+				basicVFC, ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true).left().value();
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addCustomPropertyToResource(ElementFactory.getDefaultIntegerProperty(), vfc1FromBasicVFC,
+						UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(vfc1FromBasicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY,
+				true);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+
+		// verify property
+		PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
+		newProp.setName(newStringPropName);
+		newProp.setPropertyDefaultValue(newStringPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update VF property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedIntegerValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(service, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	/**
+	 * update property(p3)
+	 * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1)
+	 */
+	@Test
+	public void serviceNestedVfResourceProperty3LevelsAndSelfVfPropertyUpdateVfInheritance3LevelProperty()
+			throws Exception {
+
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
+				vfc1FromBasicVFC, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+		Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
+				.addCustomPropertyToResource(ElementFactory.getDefaultBooleanProperty(), vfc2FromVfc1,
+						UserRoleEnum.DESIGNER, true);
+		String propNameToUpdate = propDetailsToUpdate.left().value().getName();
+		String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
+		AtomicOperationUtils.changeComponentState(vfc2FromVfc1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN,
+				true);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// verify property
+		PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
+		newProp.setName(newStringPropName);
+		newProp.setPropertyDefaultValue(newStringPropValue);
+		AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		// update VF property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
+				.getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedBooleanValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(service, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+
+	}
+
+	/**
+	 * update property p5'
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1) CP(inst on VF) (p5) CP(inst) (p5')
+	 */
+	@Test
+	public void serviceWithNestedResourceProperty3LevelsAndCpOnVfUpdateCpInstanceOfService() throws Exception {
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		// expectedPropertyList =
+		// PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1,
+		// expectedPropertyList);
+
+		// four resource
+		Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
+				NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
+		cpStringProperty.setName("Different Name");
+		cpStringProperty.setPropertyDefaultValue("Different value from default");
+		AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(cp, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
+		// create VF + add RI
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, service, UserRoleEnum.DESIGNER, true).left().value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		// service = AtomicOperationUtils.getServiceObject(service,
+		// UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		String propNameToUpdate = "cidr";
+		String propTypeToUpdate = "string";
+
+		// update CP property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils.getCompPropInstListByInstIdAndPropName(
+				service, componentInstDetails, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedStringValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		List<String> path = expectedUpdatePropDetails.getPath();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(service, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, path);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+	}
+
+	/**
+	 * update property p5
+	 * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
+	 * (p1) CP(inst on VF) (p5) CP(inst) (p5')
+	 */
+	@Test
+	public void serviceWithNestedResourceProperty3LevelsAndCpOnVfUpdateCpInstanceOfVf() throws Exception {
+		basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
+		vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
+				ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
+		vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
+				LifeCycleStatesEnum.CERTIFY, vfc1FromBasicVFC);
+		vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
+		// expectedPropertyList =
+		// PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1,
+		// expectedPropertyList);
+
+		// four resource
+		Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
+				NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
+		cpStringProperty.setName("Different Name");
+		cpStringProperty.setPropertyDefaultValue("Different value from default");
+		AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(cp, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		// create VF + add RI
+		cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
+		vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		ComponentInstance componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
+
+		// Service
+		expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
+		actualPropertyList = new ArrayList<ComponentInstanceProperty>();
+		expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
+				null);
+		expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		componentInstDetails = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp, service, UserRoleEnum.DESIGNER, true).left().value();
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
+				expectedPropertyList);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+		PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
+
+		String propNameToUpdate = "cidr";
+		String propTypeToUpdate = "string";
+
+		// update CP property
+		ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils.getCompPropInstListByInstIdAndPropName(
+				service, componentInstDetails, propNameToUpdate, propTypeToUpdate);
+		expectedUpdatePropDetails.setValue(updatedStringValue);
+		String propUniqeId = expectedUpdatePropDetails.getUniqueId();
+		List<String> path = expectedUpdatePropDetails.getPath();
+		RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
+				.updatePropertyValueOnResourceInstance(service, componentInstDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
+		assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
+				updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
+
+		actualPropertyList = new ArrayList<>();
+		actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
+
+		ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
+				.getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, path);
+		assertTrue("property was not updated propely",
+				PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
+	}
+
+	// -------------------Methods--------------------------
+	public static PropertyDataDefinition convertToPropertyDataDefinitionObject(PropertyReqDetails prop) {
+		PropertyDataDefinition propDataDef = new PropertyDataDefinition();
+		propDataDef.setDefaultValue(prop.getPropertyDefaultValue());
+		propDataDef.setType(prop.getPropertyType());
+		propDataDef.setPassword(prop.getPropertyPassword());
+		propDataDef.setDescription(prop.getPropertyDescription());
+		return propDataDef;
+	}
+
+	protected Resource createResourceWithPropertyDerivedFromOtherResource(PropertyReqDetails propertyReqDetails,
+			LifeCycleStatesEnum state, Resource derivedFromResource) throws Exception {
+		Resource resource = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
+				derivedFromResource, ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		if (propertyReqDetails != null) {
+			AtomicOperationUtils.addCustomPropertyToResource(propertyReqDetails, resource, UserRoleEnum.DESIGNER, true);
+		}
+		AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, state, true);
+		return AtomicOperationUtils.getResourceObject(resource, UserRoleEnum.DESIGNER);
+		// return resource;
+	}
+
+	protected Resource createResourceWithProperty(PropertyReqDetails propertyReqDetails, LifeCycleStatesEnum state)
+			throws Exception {
+		Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		if (propertyReqDetails != null) {
+			AtomicOperationUtils.addCustomPropertyToResource(propertyReqDetails, resource, UserRoleEnum.DESIGNER, true);
+		}
+		AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, state, true);
+		return AtomicOperationUtils.getResourceObject(resource, UserRoleEnum.DESIGNER);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentProperty.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentProperty.java
new file mode 100644
index 0000000..7ecdcf4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentProperty.java
@@ -0,0 +1,1796 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.property;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class ComponentProperty extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ComponentProperty() {
+		super(name, ComponentProperty.class.getName());
+	}
+
+	@DataProvider
+	private static final Object[][] propertiesListDefaultValueSuccessFlow() throws IOException, Exception {
+		return new Object[][] {
+				// integer
+				{ "integer", "[1,2]", "[1,2]" },
+				{ "tosca.datatypes.Credential",
+						"[{\"protocol\":\"protocol1\",\"token\":\"token1\"},{\"protocol\":\"protocol2\",\"token\":\"token2\"}]",
+						"[{\"protocol\":\"protocol1\",\"token\":\"token1\"},{\"protocol\":\"protocol2\",\"token\":\"token2\"}]" },
+				{ "tosca.datatypes.Credential",
+						"[{\"protocol\":\"protocol1\",\"token\":\"token1\"},{\"protocol\":\"protocol<br>2\",\"token\":\"token2  2\"}]",
+						"[{\"protocol\":\"protocol1\",\"token\":\"token1\"},{\"protocol\":\"protocol2\",\"token\":\"token2 2\"}]" },
+				{ "tosca.datatypes.Credential", null, null }, { "tosca.datatypes.Credential", "[]", "[]" },
+				{ "integer", "[1,2,1,2]", "[1,2,1,2]" }, { "integer", "[1,,2]", "[1,2]" },
+				{ "integer", "[1,null,2]", "[1,2]" }, { "integer", "[1,2,null]", "[1,2]" },
+				{ "integer", "[null,1,2]", "[1,2]" }, { "integer", "[1,,2]", "[1,2]" },
+				{ "integer", "[,1,2]", "[1,2]" },
+				// {"integer",
+				// "[1000000000000000000000000000000000000000000000000000,2]" ,
+				// "[1000000000000000000000000000000000000000000000000000,2]"},
+				{ "integer", "[100000000,2]", "[100000000,2]" }, // Andrey, in
+																	// success
+																	// flow
+																	// integer
+																	// max value
+																	// is
+																	// 2147483647
+				{ "integer", null, null }, // no default value
+				{ "integer",
+						"[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2]",
+						"[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2]" },
+				// boolean
+				{ "boolean", "[true,false]", "[true,false]" },
+				{ "boolean", "[true,false,false]", "[true,false,false]" },
+				{ "boolean", "[null,true,false]", "[true,false]" }, { "boolean", "[true,false,null]", "[true,false]" },
+				{ "boolean", "[true,,false]", "[true,false]" }, { "boolean", "[true,false,]", "[true,false]" },
+				{ "boolean", "[,true,false]", "[true,false]" }, { "boolean", null, null },
+				// DE199713 - Default value for property type Boolean should
+				// support also the following values: "true", "t" , "on" , "1" ,
+				// "false", "f" , "off" , "0"
+				{ "boolean", "[on,off]", "[true,false]" }, { "boolean", "[ON,OFF]", "[true,false]" },
+				{ "boolean", "[On,Off]", "[true,false]" }, { "boolean", "[yes,no]", "[true,false]" },
+				{ "boolean", "[YES,NO]", "[true,false]" }, { "boolean", "[Yes,No]", "[true,false]" },
+				{ "boolean", "[y,n]", "[true,false]" }, { "boolean", "[Y,N]", "[true,false]" },
+				// float
+				{ "float", "[10.0,0.0]", "[10.0,0.0]" }, { "float", "[10,0]", "[10,0]" }, // contain
+																							// integer
+				{ "float", "[-10,-5.30]", "[-10,-5.30]" }, // Negative numbers
+				{ "float", "[10,null,0]", "[10,0]" }, { "float", "[null,10,0]", "[10,0]" },
+				{ "float", "[10,0,null]", "[10,0]" },
+				{ "float", "[10,0.1111111111111111111111111111111111111111]",
+						"[10,0.1111111111111111111111111111111111111111]" },
+				{ "float", "[10,   ,7.3  ]", "[10,7.3]" }, { "float", "[10 , 7.3 , ]", "[10,7.3]" },
+				{ "float", "[, , 10 , 7.3 , ]", "[10,7.3]" }, { "float", "[4.7f, -5.5f ]", "[4.7,-5.5]" },
+				{ "float", "[4.7f, 6.3 ,6.3, 4.7f]", "[4.7,6.3,6.3,4.7]" }, // duplicate
+																			// value
+				{ "float", null, null }, { "string", "[aaaa , AAAA  ]", "[\"aaaa\",\"AAAA\"]" },
+
+				{ "string",
+						"[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2]",
+						"[\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\",\"1\",\"2\"]" },
+				{ "string", "[aaaa , AAAA, 1, off , true, false  ]",
+						"[\"aaaa\",\"AAAA\",\"1\",\"off\",\"true\",\"false\"]" },
+				{ "string", "[aaaa , AAAA, aaaa, Aaaa , aaaa  ]", "[\"aaaa\",\"AAAA\",\"aaaa\",\"Aaaa\",\"aaaa\"]" },
+				{ "string", "[aaaa , AAAA, ,  ]", "[\"aaaa\",\"AAAA\"]" },
+				{ "string", "[ , aaaa , AAAA ]", "[\"aaaa\",\"AAAA\"]" },
+				{ "string", "[ aaaa , ,  AAAA ]", "[\"aaaa\",\"AAAA\"]" },
+				{ "string", "[ aaaa ,  AAAA, null ]", "[\"aaaa\",\"AAAA\"]" },
+				{ "string", "[ null,  aaaa ,  AAAA ]", "[\"aaaa\",\"AAAA\"]" },
+				{ "string", "[  aaaa , null ,  AAAA ]", "[\"aaaa\",\"AAAA\"]" }, { "string", null, null }, // without
+																											// default
+																											// values
+																											// -
+																											// Property
+																											// will
+																											// be
+																											// without
+																											// default
+																											// parameter
+				{ "string", "[ <b>AAA</b> ]", "[\"AAA\"]" }, // BUG DE199715 -
+																// Error 400
+																// response
+																// received
+																// while adding
+																// property with
+																// default value
+																// contain HTML
+																// tags.
+																// Need to check
+																// whether / is
+																// legal in yaml
+
+		};
+	}
+
+	@DataProvider
+	private static final Object[][] invalidListProperties() throws IOException, Exception {
+		return new Object[][] {
+
+				{ "integer", "[1,aaa]" },
+				{ "tosca.datatypes.Credential",
+						"[{\"protocol\":\"protocol1\",\"token\":\"token1\"},{\"protocol\":\"protocol2\",\"token1\":\"token2\"}]" },
+				{ "integer", "[1,false]" }, { "integer", "[1,3.5]" }, { "integer", "[1,3#]" },
+				{ "boolean", "[true,3.5]" }, { "boolean", "[true,1000]" }, { "boolean", "[false,trueee]" },
+				{ "boolean", "[true,false!]" }, { "float", "[5.0000001,true]" }, { "float", "[0.0001,koko]" },
+				{ "float", "[0.0001,6.3@]" }, { "float", "[0.0001f,6.3x]" }, };
+	}
+
+	@DataProvider
+	private static final Object[][] updatePropertiesListDefaultValueSuccessFlow() throws IOException, Exception {
+		return new Object[][] {
+				// integer
+				// Setting --- update properties
+				// -----------------------------------------------------------------------
+				{ "integer", "[1,2]", "[1,2]", "integer", "[200,100]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[200,100,null]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[null, 200,100]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[200,null,100]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[200,100,    ]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[  , 200,100 ]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[200 ,  ,100 ]", "[200,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", null, null },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[200 , 100 , 200, 100]", "[200,100,200,100]" },
+				//
+				// ////DE199829 update resource property schema_type is not
+				// updated
+				{ "integer", "[1,2]", "[1,2]", "string", "[aaaa , bbbb ]", "[\"aaaa\",\"bbbb\"]" },
+				{ "integer", "[1,2]", "[1,2]", "boolean", "[true , false ]", "[true,false]" },
+				{ "integer", "[1,2]", "[1,2]", "float", "[3.5,4.8f ]", "[3.5,4.8]" },
+				// {"string", "[aaa,bbb]" , "[\"aaa\",\"bbb\"]","integer","[100,
+				// 200]" , "[\"100\",\"200\"]"},
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "integer", "[100, 200]", "[100,200]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "float", "[0.1f, 3.01]", "[0.1,3.01]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "boolean", "[true, false]", "[true,false]" },
+				{ "float", "[1.2,2.3]", "[1.2,2.3]", "boolean", "[true, false]", "[true,false]" },
+				{ "float", "[1.2,2.3]", "[1.2,2.3]", "integer", "[100, 200]", "[100,200]" },
+				{ "float", "[1.2,2.3]", "[1.2,2.3]", "string", "[koko, moko]", "[\"koko\",\"moko\"]" },
+				{ "boolean", "[true,false]", "[true,false]", "string", "[koko, moko]", "[\"koko\",\"moko\"]" },
+				// {"boolean", "[true,false]" ,
+				// "[\"true\",\"false\"]","integer","[100, 300000000000000]" ,
+				// "[\"100\",\"300000000000000\"]"},// Andrey, value not valid
+				// for integer success flow
+				{ "boolean", "[true,false]", "[true,false]", "integer", "[100,2147483647]", "[100,2147483647]" }, // Andrey,
+																													// in
+																													// success
+																													// flow
+																													// integer
+																													// max
+																													// value
+																													// is
+																													// 2147483647
+				{ "boolean", "[true,false]", "[true,false]", "float", "[3.000000000000002, 5.67f]",
+						"[3.000000000000002,5.67]" },
+				// ////DE199829
+				//
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[xxx, yyy]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[xxx , yyy ,null]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[null, xxx, yyy]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[xxx ,null,yyy]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[xxx ,yyy,    ]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[  , xxx,yyy ]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[xxx ,  ,yyy ]", "[\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[ xxx , yyy , xxx , yyy]",
+						"[\"xxx\",\"yyy\",\"xxx\",\"yyy\"]" },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", null, null },
+				{ "string", "[aaa,bbb]", "[\"aaa\",\"bbb\"]", "string", "[xxx_-x, y__y--y]",
+						"[\"xxx_-x\",\"y__y--y\"]" },
+				// DE199715
+				// {"string", "[aaa,bbb]" , "[\"aaa\",\"bbb\"]", "string" ,
+				// "[\"<b>xxx</b>\", \"<b>yyy</b>\"]" , "[\"xxx\",\"yyy\"]"},
+				//
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1 , -0.1]", "[2.1,-0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1, 0.1 ,null]", "[2.1,0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[null , 2.1, 0.1]", "[2.1,0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1,null,0.1]", "[2.1,0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1,0.1,    ]", "[2.1,0.1]" },
+				// {"float", "[1.00,0.02]" , "[1.00,0.02]","float","[ ,
+				// 2.00000000000001,0.00000000000000100 ]" ,
+				// "[2.00000000000001,0.00000000000000100]"},
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1 ,  ,0.1 ]", "[2.1,0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", null, null },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1f ,  ,0.1f ]", "[2.1,0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[2.1 , 0.1 , 2.1, 0.1]", "[2.1,0.1,2.1,0.1]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[200 , 100.11]", "[200,100.11]" },
+				{ "float", "[1.00,0.02]", "[1.00,0.02]", "float", "[-2.35 , 100.11]", "[-2.35,100.11]" },
+				//
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[false , false]", "[false,false]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[false, true ,null]", "[false,true]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[null , false, true]", "[false,true]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[false,null,true]", "[false,true]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[false ,true ,    ]", "[false,true]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[  , false, true ]", "[false,true]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", "[false ,  ,true ]", "[false,true]" },
+				{ "boolean", "[true,false]", "[true,false]", "boolean", null, null }, { "boolean", "[true,false]",
+						"[true,false]", "boolean", "[false , true , false, true]", "[false,true,false,true]" }, };
+	}
+
+	@DataProvider
+	private static final Object[][] updatePropertiesListDefaultValueFailureFlow() throws IOException, Exception {
+		return new Object[][] {
+				// integer
+				// Setting --- update properties
+				// -----------------------------------------------------------------------
+				{ "integer", "[1,2]", "[1,2]", "integer", "[aaa,bbb]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[true,false]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[1.0,100]" },
+				{ "integer", "[1,2]", "[1,2]", "integer", "[@12,100]" },
+				{ "float", "[0.11,0.22]", "[0.11,0.22]", "float", "[aaa, bbb]" },
+				{ "float", "[0.11,0.22]", "[0.11,0.22]", "float", "[0.88, false]" },
+				{ "float", "[0.11,0.22]", "[0.11,0.22]", "float", "[0.88g, 0.3]" },
+				{ "float", "[0.11,0.22]", "[0.11,0.22]", "float", "[@0.88, 0.3]" },
+				{ "boolean", "[true, false]", "[true,false]", "boolean", "[true, 100]" },
+				{ "boolean", "[true, false]", "[true,false]", "boolean", "[false, 0.01]" },
+				{ "boolean", "[true, false]", "[true,false]", "boolean", "[koko, true]" },
+				{ "boolean", "[true, false]", "[true,false]", "boolean", "[@false, true]" },
+
+		};
+	}
+
+	// Map properties
+	@DataProvider
+	private static final Object[][] updatePropertiesMapDefaultValueSuccessFlow() throws IOException, Exception {
+		return new Object[][] {
+				// entrySchemaType , propertyDefaultValues ,
+				// expectedDefaultValue , newEntrySchemaType ,
+				// newPropertyDefaultValue , newExpectedDefaultValue
+				// integer
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "integer",
+						"{\"key1\":200,\"key2\":null , \"key3\":300}", "{\"key1\":200,\"key2\":null,\"key3\":300}" },
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "integer",
+						"{\"key1\":null,\"key2\":200 , \"key3\":100}", "{\"key1\":null,\"key2\":200,\"key3\":100}" },
+				// string
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "string",
+						"{\"key1\":\"aaaa\" , \"key2\":\"aaaa\"}", "{\"key1\":\"aaaa\",\"key2\":\"aaaa\"}" },
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "boolean",
+						"{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}" },
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "float",
+						"{\"key1\":3.5 , \"key2\":4.8f}", "{\"key1\":3.5,\"key2\":4.8}" },
+				// string
+				{ "string", "{\"key1\":aaa , \"key2\":bbb}", "{\"key1\":\"aaa\",\"key2\":\"bbb\"}", "string",
+						"{\"key1\":xxx , \"key2\":yyy}", "{\"key1\":\"xxx\",\"key2\":\"yyy\"}" },
+				// float
+				{ "float", "{\"key1\":1.00 , \"key2\":0.02}", "{\"key1\":1.00,\"key2\":0.02}", "float",
+						"{\"key1\":2.1, \"key2\":-0.1}", "{\"key1\":2.1,\"key2\":-0.1}" },
+				{ "float", "{\"key1\":1.00 , \"key2\":0.02}", "{\"key1\":1.00,\"key2\":0.02}", "float",
+						"{\"key1\":2.1 , \"key2\":0.1 , \"key3\":null}", "{\"key1\":2.1,\"key2\":0.1,\"key3\":null}" },
+				// boolean
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":false , \"key2\":false}", "{\"key1\":false,\"key2\":false}" },
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":false , \"key2\":true , \"key3\":null}",
+						"{\"key1\":false,\"key2\":true,\"key3\":null}" },
+				// null
+				{ "boolean", "{\"key1\":null , \"key2\":false}", "{\"key1\":null,\"key2\":false}", "boolean",
+						"{\"key1\":false , \"key2\":true , \"key3\":null}",
+						"{\"key1\":false,\"key2\":true,\"key3\":null}" },
+				// tosca.datatypes.Credential
+				{ "tosca.datatypes.Credential",
+						"{\"key1\":{\"protocol\":\"protocol<br>1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}",
+						"{\"key1\":{\"protocol\":\"protocol1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}",
+						"tosca.datatypes.Credential",
+						"{\"key1\":{\"protocol\":\"protocol<br>1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}",
+						"{\"key1\":{\"protocol\":\"protocol1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}" },
+
+		};
+	}
+
+	@DataProvider
+	private static final Object[][] propertiesMapDefaultValueSuccessFlow() throws IOException, Exception {
+		return new Object[][] {
+
+				// entrySchemaType , propertyDefaultValues ,
+				// expectedDefaultValue
+				//
+				// {"string",
+				// "{\"vf_module_id\":{\"get_input\":\"vf_module_id\"},
+				// \"vnf_idw\": 2}",
+				// "{\"vf_module_id\":{\"get_input\":\"vf_module_id\"},
+				// \"vnf_idw\": 2}"},
+
+				// tosca.datatypes.Credential
+				{ "tosca.datatypes.Credential",
+						"{\"key1\":{\"protocol\":\"protocol<br>1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}",
+						"{\"key1\":{\"protocol\":\"protocol1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}" },
+				// integer
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}" },
+				{ "integer", "{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":2}",
+						"{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":2}" },
+				{ "integer", "{\"key1\":1,\"key2\":null,\"key3\":1,\"key4\":2}",
+						"{\"key1\":1,\"key2\":null,\"key3\":1,\"key4\":2}" },
+				{ "integer", "{\"key1\":null,\"key2\":1,\"key3\":1,\"key4\":2}",
+						"{\"key1\":null,\"key2\":1,\"key3\":1,\"key4\":2}" },
+				{ "integer", "{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":null}",
+						"{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":null}" },
+				{ "integer", "{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":NULL}",
+						"{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":null}" },
+				{ "integer", "{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":Null}",
+						"{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":null}" },
+				{ "integer", "{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":nuLL}",
+						"{\"key1\":1,\"key2\":2,\"key3\":1,\"key4\":null}" },
+				{ "integer", null, null }, // no default value
+				// //BUG
+				//// {"integer",
+				// "{\"key1\":1000000000000000000000000000000000000000000000000000,\"key2\":2}"
+				// ,"{\"key1\":1000000000000000000000000000000000000000000000000000,\"key2\":2}"},
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":true , \"key2\":false, \"key3\":false }",
+						"{\"key1\":true,\"key2\":false,\"key3\":false}" },
+				{ "boolean", "{\"key1\":null , \"key2\":true, \"key3\":false }",
+						"{\"key1\":null,\"key2\":true,\"key3\":false}" },
+				{ "boolean", "{\"key1\":true , \"key2\":Null, \"key3\":false }",
+						"{\"key1\":true,\"key2\":null,\"key3\":false}" },
+				{ "boolean", "{\"key1\":true , \"key2\":false, \"key3\":nULL }",
+						"{\"key1\":true,\"key2\":false,\"key3\":null}" },
+				{ "boolean", null, null },
+				{ "boolean", "{\"key1\":on , \"key2\":off}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":ON , \"key2\":OFF}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":On , \"key2\":Off}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":yes , \"key2\":no}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":YES , \"key2\":NO}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":Yes , \"key2\":No}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":y , \"key2\":n}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{\"key1\":Y , \"key2\":N}", "{\"key1\":true,\"key2\":false}" },
+				{ "boolean", "{null:false}", "{\"null\":false}" },
+				// float
+				{ "float", "{\"key1\":10.0 , \"key2\":0.0}", "{\"key1\":10.0,\"key2\":0.0}" },
+				{ "float", "{\"key1\":10 , \"key2\":0}", "{\"key1\":10,\"key2\":0}" }, // contain
+																						// integer
+				{ "float", "{\"key1\":null , \"key2\":Null}", "{\"key1\":null,\"key2\":null}" }, // contain
+																									// null
+				{ "float", "{\"key1\":3.5 , \"key2\":nULL}", "{\"key1\":3.5,\"key2\":null}" },
+				// BUG
+				{ "float", "{\"key1\":3.5 , \"key2\":0.1111111111111111111111111111111111111111}",
+						"{\"key1\":3.5,\"key2\":0.1111111111111111111111111111111111111111}" },
+				{ "float", "{\"key1\":4.7f , \"key2\":-5.5f}", "{\"key1\":4.7,\"key2\":-5.5}" },
+				{ "float", "{\"key1\":4.7f , \"key2\":-5.5f, \"key3\":-5.5f}",
+						"{\"key1\":4.7,\"key2\":-5.5,\"key3\":-5.5}" },
+				{ "boolean", null, null },
+				{ "string", "{\"key1\":aaaa , \"key2\":AAAA}", "{\"key1\":\"aaaa\",\"key2\":\"AAAA\"}" },
+				{ "string", "{\"key1\":off , \"key2\":true , \"key3\":1}",
+						"{\"key1\":\"off\",\"key2\":\"true\",\"key3\":\"1\"}" },
+				{ "string", "{\"key1\":aaaa , \"key2\":Aaaa , \"key3\":aaaa}",
+						"{\"key1\":\"aaaa\",\"key2\":\"Aaaa\",\"key3\":\"aaaa\"}" },
+				{ "string", "{\"key1\":aaaa , \"key2\":bbbb , \"key3\":null}",
+						"{\"key1\":\"aaaa\",\"key2\":\"bbbb\",\"key3\":null}" },
+				{ "string", "{\"key1\":NULL , \"key2\":bbbb , \"key3\":aaaa}",
+						"{\"key1\":null,\"key2\":\"bbbb\",\"key3\":\"aaaa\"}" },
+				{ "string", "{\"key1\":aaaa , \"key2\":Null , \"key3\":bbbb}",
+						"{\"key1\":\"aaaa\",\"key2\":null,\"key3\":\"bbbb\"}" },
+				{ "string", null, null }, // without default values - Property
+											// will be without default parameter
+				{ "string", "{\"key1\":\"<b>AAAA</b>\" }", "{\"key1\":\"AAAA\"}" },
+
+		};
+	}
+
+	@DataProvider
+	private static final Object[][] updatePropertiesMapDefaultValueFailureFlow() throws IOException, Exception {
+		return new Object[][] {
+
+				// integer
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "integer",
+						"{\"key1\":aaa , \"key2\":bbb}" },
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "integer",
+						"{\"key1\":true , \"key2\":false}" },
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "integer",
+						"{\"key1\":1.0 , \"key2\":100}" },
+				{ "integer", "{\"key1\":1 , \"key2\":2}", "{\"key1\":1,\"key2\":2}", "integer",
+						"{\"key1\":12@ , \"key2\":100}" },
+				// float
+				{ "float", "{\"key1\":0.11 , \"key2\":0.22}", "{\"key1\":0.11,\"key2\":0.22}", "float",
+						"{\"key1\":aaa , \"key2\":bbb}" },
+				{ "float", "{\"key1\":0.11 , \"key2\":0.22}", "{\"key1\":0.11,\"key2\":0.22}", "float",
+						"{\"key1\":0.88 , \"key2\":false}" },
+				{ "float", "{\"key1\":0.11 , \"key2\":0.22}", "{\"key1\":0.11,\"key2\":0.22}", "float",
+						"{\"key1\":0.88g , \"key2\":0.3}" },
+				{ "float", "{\"key1\":0.11 , \"key2\":0.22}", "{\"key1\":0.11,\"key2\":0.22}", "float",
+						"{\"key1\":@0.88g , \"key2\":0.3}" },
+				// boolean
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":true , \"key2\":100}" },
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":false , \"key2\":0.01}" },
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":koko , \"key2\":true}" },
+				{ "boolean", "{\"key1\":true , \"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":@false , \"key2\":true}" },
+				{ "boolean", "{\"key1\":true,\"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{:false , \"key2\":true}" },
+				{ "boolean", "{\"key1\":true,\"key2\":false}", "{\"key1\":true,\"key2\":false}", "boolean",
+						"{\"key1\":true , , \"key2\":false}" },
+				// tosca.datatypes.Credential
+				{ "tosca.datatypes.Credential",
+						"{\"key1\":{\"protocol\":\"protocol<br>1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}",
+						"{\"key1\":{\"protocol\":\"protocol1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token\":\"token2\"}}",
+						"tosca.datatypes.Credential",
+						"{\"key1\":{\"protocol\":\"protocol<br>1\",\"token\":\"token1\"},\"key2\":{\"protocol\":\"protocol2\",\"token2\":\"token2\"}}" },
+
+		};
+	}
+
+	// US594938 - UPDATE PROPERTY
+	// DE199718
+	@Test(dataProvider = "updatePropertiesListDefaultValueFailureFlow")
+	public void updateDefaultValueOfResourcePropertyListFailureFlow(String entrySchemaType, String propertyDefaltValues,
+			String expecteddefaultValues, String newEntrySchemaType, String newPropertyDefaltValues) throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.setPropertyDefaultValue(propertyDefaltValues);
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// verify properties return from response
+		assertEquals("list", resourcePropertiesFromResponse.getType());
+		assertEquals(expecteddefaultValues, resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(propertyDetails.getSchema().getProperty().getType(),
+				resourcePropertiesFromResponse.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+		// Update resource property type = "list"
+		propertyDetails.setPropertyDefaultValue(newPropertyDefaltValues);
+		propertyDetails.getSchema().getProperty().setType(newEntrySchemaType);
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(propertyDetails.getName());
+		variables.add(propertyDetails.getPropertyType());
+		variables.add(propertyDetails.getSchema().getProperty().getType());
+		variables.add(newPropertyDefaltValues);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name(), variables,
+				updatePropertyResponse.getResponse());
+	}
+
+	@Test
+	public void updatePropertyOfDerivedResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty(PropertyTypeEnum.STRING_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String derivedResourcePropertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		// second resource derived from basicVFC
+		Resource vfc1FromBasicVFC = AtomicOperationUtils
+				.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC, basicVFC,
+						ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		// add property Type list to second resource
+		PropertyReqDetails defaultListProperty = ElementFactory.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(defaultListProperty, vfc1FromBasicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Update property (list) of derived resource
+		RestResponse updatePropertyResponse = AtomicOperationUtils.updatePropertyOfResource(propertyDetails, basicVFC,
+				derivedResourcePropertyUniqueId, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updatePropertyResponse.getResponse());
+		// Verify resource's priority list did not changed
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[\"a\",\"b\"]");
+	}
+
+	@Test
+	public void updatePropertyOfNonDerivedResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty(PropertyTypeEnum.STRING_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		// second resource derived from basicVFC
+		Resource vfc1FromBasicVFC = AtomicOperationUtils
+				.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC, basicVFC,
+						ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		// add property Type list to second resource
+		PropertyReqDetails defaultListProperty = ElementFactory.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(defaultListProperty, vfc1FromBasicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// Update property (list) of derived resource
+		defaultListProperty.setPropertyDefaultValue("[1,2,3,4]");
+		String expectedDefaultValue = "[1,2,3,4]";
+		ComponentInstanceProperty resourcePropertyAfterUpdate = AtomicOperationUtils
+				.updatePropertyOfResource(defaultListProperty, vfc1FromBasicVFC, propertyUniqueId,
+						UserRoleEnum.DESIGNER, true)
+				.left().value();
+		assertEquals(resourcePropertyAfterUpdate.getType(), "list");
+		assertEquals(resourcePropertyAfterUpdate.getDefaultValue(), expectedDefaultValue);
+		assertEquals(resourcePropertyAfterUpdate.getSchema().getProperty().getType(),
+				defaultListProperty.getSchema().getProperty().getType()); // string/integer/boolean/float
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(vfc1FromBasicVFC.getUniqueId());
+		String expectedDefaultValueFromDerivedResource = "[\"a\",\"b\"]";
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		resource.getProperties().get(0).getDefaultValue().equals(expectedDefaultValue);
+		resource.getProperties().get(1).getDefaultValue().equals(expectedDefaultValueFromDerivedResource);
+	}
+
+	@Test
+	public void updateListPropertyToNonCheckedOutResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String PropertyDefaultValue = "[2,3]";
+		propertyDetails.setPropertyDefaultValue(PropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType("integer");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		// Update resource property type = "list"
+		propertyDetails.setPropertyDefaultValue("[3,4]");
+		propertyDetails.getSchema().getProperty().setType("integer");
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updatePropertyResponse.getResponse());
+		// Verify resource's priority list did not changed
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[2,3]");
+	}
+
+	@Test
+	public void updateListPropertyResourceByNonResouceOwner() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String PropertyDefaultValue = "[2,3]";
+		propertyDetails.setPropertyDefaultValue(PropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType("integer");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// AtomicOperationUtils.changeComponentState(basicVFC,
+		// UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		// Update resource property type = "list"
+		propertyDetails.setPropertyDefaultValue("[3,4]");
+		propertyDetails.getSchema().getProperty().setType("integer");
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER2, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updatePropertyResponse.getResponse());
+		// Verify resource's priority list did not changed
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[2,3]");
+	}
+
+	@Test
+	public void updateListPropertyResourceByTester() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String PropertyDefaultValue = "[2,3]";
+		propertyDetails.setPropertyDefaultValue(PropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType("integer");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// AtomicOperationUtils.changeComponentState(basicVFC,
+		// UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		// Update resource property type = "list"
+		propertyDetails.setPropertyDefaultValue("[3,4]");
+		propertyDetails.getSchema().getProperty().setType("integer");
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.TESTER, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				updatePropertyResponse.getResponse());
+		// Verify resource's priority list did not changed
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[2,3]");
+	}
+
+	// DE199964
+	@Test(enabled = false)
+	public void updateListPropertyToNonExistingResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String PropertyDefaultValue = "[2,3]";
+		propertyDetails.setPropertyDefaultValue(PropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType("integer");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		String resourceUniqueId = basicVFC.getUniqueId();
+		basicVFC.setUniqueId("1111111");
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_NOT_FOUND));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(basicVFC.getUniqueId());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), variables,
+				updatePropertyResponse.getResponse());
+		// Verify resource's priority list did not changed
+		basicVFC.setUniqueId(resourceUniqueId);
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[2,3]");
+	}
+
+	// DE199725
+	@Test
+	public void updateResourcePropertyListNonSupportedPropertyType() throws Exception { // Not
+																						// "list"
+																						// type
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String PropertyDefaultValue = "[2,3]";
+		propertyDetails.setPropertyDefaultValue(PropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType("integer");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// update resource property
+		String propertyType = "listttttttt";
+		propertyDetails.setPropertyType(propertyType);
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, false)
+				.right().value();
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(propertyDetails.getPropertyType()); // property data type
+															// (koko instead
+															// list)
+		variables.add(propertyDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_TYPE.name(), variables,
+				updatePropertyResponse.getResponse());
+		// Verify resource's priority list did not changed
+		propertyDetails.setPropertyType("list");
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[2,3]");
+	}
+
+	@Test(enabled = false) // DE199732
+	public void updateResourcePropertyListNonSupportedEntrySchemaType() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String PropertyDefaultValue = "[2,3]";
+		propertyDetails.setPropertyDefaultValue(PropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType("integer");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// update resource property
+		String EntrySchemaType = "integerrrrrr";
+		propertyDetails.getSchema().getProperty().setType(EntrySchemaType);
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(EntrySchemaType);
+		variables.add(propertyDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_INNER_TYPE.name(), variables,
+				updatePropertyResponse.getResponse());
+		propertyDetails.getSchema().getProperty().setType("integer");
+		verifyResourcePropertyList(basicVFC, propertyDetails, "[2,3]");
+	}
+
+	@Test(dataProvider = "updatePropertiesListDefaultValueSuccessFlow")
+	public void updateResourcePropertyListSuccessFlow(String entrySchemaType, String propertyDefaltValues,
+			String expecteddefaultValues, String newEntrySchemaType, String newPropertyDefaltValues,
+			String newExpecteddefaultValues) throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.setPropertyDefaultValue(propertyDefaltValues);
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// verify properties return from response
+		assertEquals("list", resourcePropertiesFromResponse.getType());
+		assertEquals(expecteddefaultValues, resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(propertyDetails.getSchema().getProperty().getType(),
+				resourcePropertiesFromResponse.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+		// Update resource property type = "list"
+		propertyDetails.setPropertyDefaultValue(newPropertyDefaltValues);
+		propertyDetails.getSchema().getProperty().setType(newEntrySchemaType);
+		ComponentInstanceProperty resourcePropertyAfterUpdate = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		assertEquals("list", resourcePropertyAfterUpdate.getType());
+		assertEquals(newExpecteddefaultValues, resourcePropertyAfterUpdate.getDefaultValue());
+		assertEquals(propertyDetails.getSchema().getProperty().getType(),
+				resourcePropertyAfterUpdate.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, newExpecteddefaultValues);
+	}
+
+	// Add property type list to resource
+	// DE199718
+	@Test(dataProvider = "invalidListProperties") // invalid default values
+	public void addListPropertyToResourceFailureFlow(String entrySchemaType, String propertyDefaltValues)
+			throws Exception {
+		// String propertyType = "list";
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		propertyDetails.setPropertyDefaultValue(propertyDefaltValues);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		RestResponse addPropertyToResourceResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyToResourceResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(propertyDetails.getName());
+		variables.add(propertyDetails.getPropertyType());
+		variables.add(propertyDetails.getSchema().getProperty().getType());
+		variables.add(propertyDefaltValues);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name(), variables,
+				addPropertyToResourceResponse.getResponse());
+
+	}
+
+	// DE199964
+	@Test
+	public void addListPropertyToNonExistingResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType("integer");
+		propertyDetails.setPropertyDefaultValue("[1,2]");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to non existing resource
+		basicVFC.setUniqueId("1111111");
+		RestResponse addPropertyToResourceResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyToResourceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_NOT_FOUND));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), variables,
+				addPropertyToResourceResponse.getResponse());
+	}
+
+	@Test
+	public void addListPropertyToNonCheckedOutResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType("integer");
+		propertyDetails.setPropertyDefaultValue("[1,2]");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		// Add property type list to non Checked-Out resource
+		RestResponse addPropertyToResourceResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyToResourceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				addPropertyToResourceResponse.getResponse());
+	}
+
+	@Test
+	public void addListPropertyToResourceByNonResourceOwner() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType("integer");
+		propertyDetails.setPropertyDefaultValue("[1,2]");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to non Checked-Out resource
+		RestResponse addPropertyToResourceResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER2, false).right().value();
+		assertTrue(addPropertyToResourceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				addPropertyToResourceResponse.getResponse());
+	}
+
+	@Test
+	public void addListPropertyToResourcePropertyAlreadyExists01() throws Exception {
+		String propertyType = "list";
+		String propertySchemaType = "integer";
+		String defaultValues = "[1,2]";
+		String expecteddefaultValues = "[1,2]";
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType(propertySchemaType);
+		propertyDetails.setPropertyDefaultValue(defaultValues);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// check-in and check-out resource
+		RestResponse changeComponentState = LifecycleRestUtils.changeComponentState(basicVFC,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
+		assertTrue(changeComponentState.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS));
+		changeComponentState = LifecycleRestUtils.changeComponentState(basicVFC,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKOUT);
+		assertTrue(changeComponentState.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS));
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		// verify properties return from response
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyType);
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), expecteddefaultValues);
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(), propertySchemaType); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+		// Add same property again to resource
+		RestResponse addPropertyRestResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyRestResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_ALREADY_EXISTS));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_ALREADY_EXIST.name(), variables,
+				addPropertyRestResponse.getResponse());
+		// verify property not deleted
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+	}
+
+	@Test
+	public void addListPropertyToResourcePropertyAlreadyExists02() throws Exception {
+		String propertyType = "list";
+		String propertySchemaType = "integer";
+		String defaultValues = "[1,2]";
+		String expecteddefaultValues = "[1,2]";
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType(propertySchemaType);
+		propertyDetails.setPropertyDefaultValue(defaultValues);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		// verify properties return from response
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyType);
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), expecteddefaultValues);
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(), propertySchemaType); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+		// check-in and check-out resource
+		RestResponse changeComponentState = LifecycleRestUtils.changeComponentState(basicVFC,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
+		assertTrue(changeComponentState.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS));
+		changeComponentState = LifecycleRestUtils.changeComponentState(basicVFC,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKOUT);
+		assertTrue(changeComponentState.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS));
+		// Add same property again to resource
+		RestResponse addPropertyRestResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyRestResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_ALREADY_EXISTS));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_ALREADY_EXIST.name(), variables,
+				addPropertyRestResponse.getResponse());
+		// verify property not deleted
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+	}
+
+	@Test // DE199725
+	public void addListPropertyToResourceNonSupportedPropertyType() throws Exception { // Not
+																						// "list"
+																						// type
+		String propertyType = "listttttttt";
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.setPropertyType(propertyType);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		RestResponse addPropertyRestResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyRestResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(propertyDetails.getPropertyType()); // property data type
+															// (koko instead
+															// list)
+		variables.add(propertyDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_TYPE.name(), variables,
+				addPropertyRestResponse.getResponse());
+	}
+
+	@Test // DE199732
+	public void addListPropertyToResourceNonSupportedEntrySchemaType() throws Exception {
+		String EntrySchemaType = "stringggg"; // instead "string"
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType(EntrySchemaType);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		RestResponse addPropertyRestResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyRestResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(EntrySchemaType);
+		variables.add(propertyDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_PROPERTY_INNER_TYPE.name(), variables,
+				addPropertyRestResponse.getResponse());
+	}
+
+	@Test
+	public void addHundredPropertyListToResourceSuccessFlow() throws Exception {
+		String propertyType = "list";
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		String propertyName = propertyDetails.getName();
+		int numberOfPropertiesToAddToResource = 100;
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		for (int x = 0; x < numberOfPropertiesToAddToResource; x++) {
+			propertyDetails.setName(propertyName + x);
+			resourcePropertiesFromResponse = AtomicOperationUtils
+					.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+			// verify properties return from response
+			assertEquals(resourcePropertiesFromResponse.getName(), propertyName + x);
+			assertEquals(resourcePropertiesFromResponse.getType(), propertyType);
+			assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[\"a\",\"b\"]");
+			assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+					propertyDetails.getSchema().getProperty().getType()); // string/integer/boolean/float
+		}
+		// get resource and verify that 100 properties exist
+		Resource resourceObject = AtomicOperationUtils.getResourceObject(basicVFC, UserRoleEnum.DESIGNER);
+		assertEquals(numberOfPropertiesToAddToResource, resourceObject.getProperties().size());
+
+	}
+
+	@Test(dataProvider = "propertiesListDefaultValueSuccessFlow")
+	public void addListPropertyToResourceSuccessFlow(String entrySchemaType, String propertyDefaltValues,
+			String expecteddefaultValues) throws Exception {
+		String propertyType = "list";
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		propertyDetails.setPropertyDefaultValue(propertyDefaltValues);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		// verify properties return from response
+		assertEquals(propertyType, resourcePropertiesFromResponse.getType());
+		assertEquals(expecteddefaultValues, resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(entrySchemaType, resourcePropertiesFromResponse.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyType);
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), expecteddefaultValues);
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(), entrySchemaType); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+	}
+
+	// Delete property type list
+	@Test
+	public void deleteOneOfTheListPropertiesFromResourceAndAddItAgain() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.STRING_LIST);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[\"a\",\"b\"]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1,2]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, "[\"a\",\"b\"]");
+		// Add deleted property again to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1,2]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+	}
+
+	@Test
+	public void deletePropertyListTypeInteger() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.STRING_LIST);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[\"a\",\"b\"]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1,2]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "[1,2]");
+	}
+
+	@Test
+	public void deletePropertyListTypeBoolean() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.BOOLEAN_LIST);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[true,false]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1,2]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one property
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "[1,2]");
+	}
+
+	@Test
+	public void deletePropertyListTypeFloat() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.FLOAT_LIST);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1.0,2.0]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1,2]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one property
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "[1,2]");
+	}
+
+	@Test
+	public void deletePropertyListAlreadyDeleted() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.FLOAT_LIST);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1.0,2.0]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), "[1,2]");
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one property
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "[1,2]");
+		// delete again the same property
+		deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_NOT_FOUND == deletePropertyOfResource.getErrorCode());
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
+				deletePropertyOfResource.getResponse());
+	}
+
+	@Test
+	public void deletePropertyListResourceIsNotCheckedOutState() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.FLOAT_LIST);
+		String expectedDefaultvalues = "[1.0,2.0]";
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), expectedDefaultvalues);
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		// Get resource and verify updated default value
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, expectedDefaultvalues);
+		// Check-in resource
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		// Delete property
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION == deletePropertyOfResource.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				deletePropertyOfResource.getResponse());
+		// Get resource and verify property is not deleted
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, expectedDefaultvalues);
+	}
+
+	@Test
+	public void deletePropertyListResourceByNotIsNonResouceOwner() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.FLOAT_LIST);
+		String expectedDefaultvalues = "[1.0,2.0]";
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), expectedDefaultvalues);
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		// Get resource and verify updated default value
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, expectedDefaultvalues);
+		// Delete property by non resource owner
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER2);
+		assertTrue(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION == deletePropertyOfResource.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				deletePropertyOfResource.getResponse());
+		// Get resource and verify property is not deleted
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, expectedDefaultvalues);
+	}
+
+	@Test
+	public void deletePropertyListFromNonExistingResource() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.FLOAT_LIST);
+		String expectedDefaultvalues = "[1.0,2.0]";
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String actualResourceUniqueId = basicVFC.getUniqueId();
+		// Add property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals(resourcePropertiesFromResponse.getDefaultValue(), expectedDefaultvalues);
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		// Get resource and verify updated default value
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, expectedDefaultvalues);
+		// Delete property from non existing resource
+		basicVFC.setUniqueId("1111111");
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(deletePropertyOfResource.getErrorCode().equals(BaseRestUtils.STATUS_CODE_NOT_FOUND));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), variables,
+				deletePropertyOfResource.getResponse());
+		// Get resource and verify property is not deleted
+		basicVFC.setUniqueId(actualResourceUniqueId);
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, expectedDefaultvalues);
+	}
+
+	@Test
+	public void deletePropertyOfDerivedResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty(PropertyTypeEnum.STRING_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String derivedResourcePropertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		// second resource derived from basicVFC
+		Resource vfc1FromBasicVFC = AtomicOperationUtils
+				.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC, basicVFC,
+						ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		// Delete property (list) of derived resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(
+				vfc1FromBasicVFC.getUniqueId(), derivedResourcePropertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(deletePropertyOfResource.getErrorCode().equals(BaseRestUtils.STATUS_CODE_NOT_FOUND));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
+				deletePropertyOfResource.getResponse());
+		// Verify resource's priority list did not changed
+		verifyResourcePropertyList(vfc1FromBasicVFC, propertyDetails, "[\"a\",\"b\"]");
+	}
+
+	@Test
+	public void deletePropertyOfNonDerivedResource() throws Exception {
+		PropertyReqDetails propertyListString = ElementFactory.getDefaultListProperty(PropertyTypeEnum.STRING_LIST);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyListString, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		// second resource derived from basicVFC
+		Resource vfc1FromBasicVFC = AtomicOperationUtils
+				.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC, basicVFC,
+						ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		// add property Type list to second resource
+		PropertyReqDetails propertyListInteger = ElementFactory.getDefaultListProperty(PropertyTypeEnum.INTEGER_LIST);
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyListInteger, vfc1FromBasicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// Delete property (list) of derived resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils
+				.deletePropertyOfResource(vfc1FromBasicVFC.getUniqueId(), propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyListString, "[\"a\",\"b\"]");
+	}
+
+	private void verifyResourcePropertyList(Resource resource, PropertyReqDetails expectedProperty,
+			String expecteddefaultValues) throws Exception {
+		// get resource and verify property from type list
+		Resource getResource = AtomicOperationUtils.getResourceObject(resource, UserRoleEnum.DESIGNER);
+		List<PropertyDefinition> actualResourceProperties = getResource.getProperties();
+		boolean isPropertyAppear = false;
+		for (PropertyDefinition pro : actualResourceProperties) {
+			if (expectedProperty.getName().equals(pro.getName())) {
+				assertTrue("Check Property Type ", pro.getType().equals(expectedProperty.getPropertyType()));
+				assertEquals("Check Property  default values ", expecteddefaultValues, pro.getDefaultValue());
+				// assertTrue("Check Property default values ",
+				// pro.getDefaultValue().equals(expecteddefaultValues));
+				assertTrue("Check entrySchema Property Type ", pro.getSchema().getProperty().getType()
+						.equals(expectedProperty.getSchema().getProperty().getType()));
+				isPropertyAppear = true;
+			}
+		}
+		assertTrue(isPropertyAppear);
+	}
+
+	// US656905
+	// --------------------- Map Property
+	// ----------------------------------------------------------------
+	@Test(dataProvider = "updatePropertiesMapDefaultValueFailureFlow")
+	public void updateDefaultValueOfResourcePropertyMapFailureFlow(String entrySchemaType, String propertyDefaultValues,
+			String expectedDefaultValue, String newEntrySchemaType, String newPropertyDefaultValue) throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultMapProperty();
+		propertyDetails.setPropertyDefaultValue(propertyDefaultValues);
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// verify properties return from response
+		assertEquals("map", resourcePropertiesFromResponse.getType());
+		assertEquals(expectedDefaultValue, resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(propertyDetails.getSchema().getProperty().getType(),
+				resourcePropertiesFromResponse.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expectedDefaultValue);
+		// Update resource property type = "map"
+		propertyDetails.setPropertyDefaultValue(newPropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType(newEntrySchemaType);
+		RestResponse updatePropertyResponse = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, false)
+				.right().value();
+		assertTrue(updatePropertyResponse.getErrorCode().equals(STATUS_CODE_INVALID_CONTENT));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(propertyDetails.getName());
+		variables.add(propertyDetails.getPropertyType());
+		variables.add(propertyDetails.getSchema().getProperty().getType());
+		variables.add(newPropertyDefaultValue);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE.name(), variables,
+				updatePropertyResponse.getResponse());
+	}
+
+	@Test(dataProvider = "updatePropertiesMapDefaultValueSuccessFlow")
+	public void updateResourcePropertyMapSuccessFlow(String entrySchemaType, String propertyDefaultValues,
+			String expectedDefaultValue, String newEntrySchemaType, String newPropertyDefaultValue,
+			String newExpectedDefaultValue) throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultMapProperty();
+		propertyDetails.setPropertyDefaultValue(propertyDefaultValues);
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		// verify properties return from response
+		assertEquals("map", resourcePropertiesFromResponse.getType());
+		assertEquals(expectedDefaultValue, resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(propertyDetails.getSchema().getProperty().getType(),
+				resourcePropertiesFromResponse.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expectedDefaultValue);
+		// Update resource property type = "map"
+		propertyDetails.setPropertyDefaultValue(newPropertyDefaultValue);
+		propertyDetails.getSchema().getProperty().setType(newEntrySchemaType);
+		ComponentInstanceProperty resourcePropertyAfterUpdate = AtomicOperationUtils
+				.updatePropertyOfResource(propertyDetails, basicVFC, propertyUniqueId, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		assertEquals("map", resourcePropertyAfterUpdate.getType());
+		assertEquals(newExpectedDefaultValue, resourcePropertyAfterUpdate.getDefaultValue());
+		assertEquals(propertyDetails.getSchema().getProperty().getType(),
+				resourcePropertyAfterUpdate.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, newExpectedDefaultValue);
+	}
+
+	@Test
+	public void deletePropertyMapTypeString() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultMapProperty(PropertyTypeEnum.STRING_MAP);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory.getDefaultMapProperty(PropertyTypeEnum.INTEGER_MAP);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals("{\"key1\":\"val1\",\"key2\":\"val2\"}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals("{\"key1\":123,\"key2\":-456}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "{\"key1\":123,\"key2\":-456}");
+	}
+
+	@Test
+	public void deletePropertyMapTypeFloat() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeFloat = ElementFactory.getDefaultMapProperty(PropertyTypeEnum.FLOAT_MAP);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory.getDefaultMapProperty(PropertyTypeEnum.INTEGER_MAP);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeFloat, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeFloat.getPropertyType());
+		assertEquals("{\"key1\":0.2123,\"key2\":43.545}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeFloat.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals("{\"key1\":123,\"key2\":-456}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "{\"key1\":123,\"key2\":-456}");
+	}
+
+	@Test
+	public void deletePropertyMapTypeBoolean() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeBoolean = ElementFactory
+				.getDefaultMapProperty(PropertyTypeEnum.BOOLEAN_MAP);
+		PropertyReqDetails propertyDetailsInteger = ElementFactory.getDefaultMapProperty(PropertyTypeEnum.INTEGER_MAP);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeBoolean, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeBoolean.getPropertyType());
+		assertEquals("{\"key1\":true,\"key2\":false}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeBoolean.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsInteger.getPropertyType());
+		assertEquals("{\"key1\":123,\"key2\":-456}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsInteger.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsInteger, "{\"key1\":123,\"key2\":-456}");
+	}
+
+	@Test
+	public void deletePropertyMapTypeInteger() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeInteger = ElementFactory
+				.getDefaultMapProperty(PropertyTypeEnum.INTEGER_MAP);
+		PropertyReqDetails propertyDetailsBoolean = ElementFactory.getDefaultMapProperty(PropertyTypeEnum.BOOLEAN_MAP);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeInteger, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		String propertyUniqueId = resourcePropertiesFromResponse.getUniqueId();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeInteger.getPropertyType());
+		assertEquals("{\"key1\":123,\"key2\":-456}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeInteger.getSchema().getProperty().getType()); // string/integer/boolean/float
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsBoolean, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsBoolean.getPropertyType());
+		assertEquals("{\"key1\":true,\"key2\":false}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsBoolean.getSchema().getProperty().getType());
+		// Get resource and verify updated default value
+		RestResponse restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(2, resource.getProperties().size());
+		// Delete one resource
+		RestResponse deletePropertyOfResource = AtomicOperationUtils.deletePropertyOfResource(basicVFC.getUniqueId(),
+				propertyUniqueId, UserRoleEnum.DESIGNER);
+		assertTrue(BaseRestUtils.STATUS_CODE_DELETE == deletePropertyOfResource.getErrorCode());
+		// Get resource and verify updated default value
+		restResponse = ResourceRestUtils.getResource(basicVFC.getUniqueId());
+		resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		assertEquals(1, resource.getProperties().size());
+		verifyResourcePropertyList(basicVFC, propertyDetailsBoolean, "{\"key1\":true,\"key2\":false}");
+	}
+
+	@Test(dataProvider = "propertiesMapDefaultValueSuccessFlow")
+	public void addMapPropertyToResourceSuccessFlow(String entrySchemaType, String propertyDefaltValues,
+			String expecteddefaultValues) throws Exception {
+		String propertyType = "map";
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultMapProperty();
+		propertyDetails.getSchema().getProperty().setType(entrySchemaType);
+		propertyDetails.setPropertyDefaultValue(propertyDefaltValues);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to resource
+		ComponentInstanceProperty resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, true).left().value();
+		// verify properties return from response
+		assertEquals(propertyType, resourcePropertiesFromResponse.getType());
+		assertEquals(expecteddefaultValues, resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(entrySchemaType, resourcePropertiesFromResponse.getSchema().getProperty().getType()); // string/integer/boolean/float
+		verifyResourcePropertyList(basicVFC, propertyDetails, expecteddefaultValues);
+	}
+
+	@Test
+	public void addMapPropertyToNonExistingResource() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType("integer");
+		propertyDetails.setPropertyDefaultValue("{\"key1\":1 , \"key2\":2}");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to non existing resource
+		basicVFC.setUniqueId("1111111");
+		RestResponse addPropertyToResourceResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER, false).right().value();
+		assertTrue(addPropertyToResourceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_NOT_FOUND));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), variables,
+				addPropertyToResourceResponse.getResponse());
+	}
+
+	@Test
+	public void addMaptPropertyToResourceByNonResourceOwner() throws Exception {
+		PropertyReqDetails propertyDetails = ElementFactory.getDefaultListProperty();
+		propertyDetails.getSchema().getProperty().setType("integer");
+		propertyDetails.setPropertyDefaultValue("{\"key1\":1 , \"key2\":2}");
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add property type list to non Checked-Out resource
+		RestResponse addPropertyToResourceResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetails, basicVFC, UserRoleEnum.DESIGNER2, false).right().value();
+		assertTrue(addPropertyToResourceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION));
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				addPropertyToResourceResponse.getResponse());
+	}
+
+	@Test
+	public void addMapPropertyToResourcePropertyAlreadyExists() throws Exception {
+		ComponentInstanceProperty resourcePropertiesFromResponse;
+		PropertyReqDetails propertyDetailsTypeString = ElementFactory
+				.getDefaultListProperty(PropertyTypeEnum.STRING_MAP);
+		// create resource
+		Resource basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		// Add 2 property type list to resource
+		resourcePropertiesFromResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		assertEquals(resourcePropertiesFromResponse.getType(), propertyDetailsTypeString.getPropertyType());
+		assertEquals("{\"key1\":\"val1\",\"key2\":\"val2\"}", resourcePropertiesFromResponse.getDefaultValue());
+		assertEquals(resourcePropertiesFromResponse.getSchema().getProperty().getType(),
+				propertyDetailsTypeString.getSchema().getProperty().getType()); // string/integer/boolean/float
+		// check-in and check-out resource
+		RestResponse changeComponentState = LifecycleRestUtils.changeComponentState(basicVFC,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
+		assertTrue(changeComponentState.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS));
+		changeComponentState = LifecycleRestUtils.changeComponentState(basicVFC,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKOUT);
+		assertTrue(changeComponentState.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS));
+		// Add same property again to resource
+		RestResponse addPropertyRestResponse = AtomicOperationUtils
+				.addCustomPropertyToResource(propertyDetailsTypeString, basicVFC, UserRoleEnum.DESIGNER, false).right()
+				.value();
+		assertTrue(addPropertyRestResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_ALREADY_EXISTS));
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_ALREADY_EXIST.name(), variables,
+				addPropertyRestResponse.getResponse());
+		// verify property not deleted
+		verifyResourcePropertyList(basicVFC, propertyDetailsTypeString, "{\"key1\":\"val1\",\"key2\":\"val2\"}");
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java
new file mode 100644
index 0000000..0586269
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java
@@ -0,0 +1,384 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.property;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.preRequisites.SimpleOneRsrcOneServiceTest;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class PropertyApisTest extends SimpleOneRsrcOneServiceTest {
+
+	protected static final String RESOURCE_CATEGORY = "Generic/Databases";
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";;
+
+	// protected User sdncDesignerDetails;
+	// protected ResourceReqDetails resourceDetails;
+	protected PropertyReqDetails property;
+	protected String body;
+
+	protected HttpRequest httpRequest = new HttpRequest();
+	protected Map<String, String> headersMap = new HashMap<String, String>();
+
+	@Rule
+	public static TestName testName = new TestName();
+
+	public PropertyApisTest() {
+		super(testName, PropertyApisTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+		//
+		// //Delete resource
+		//
+		// resourceDetails = new ResourceReqDetails();
+		// resourceDetails.setResourceName("testresourceDetails");
+		//
+		// resourceUtils.deleteResource_allVersions(resourceDetails,
+		// sdncDesignerDetails);
+		//
+		// //Create resource
+		// resourceDetails = createResource(sdncDesignerDetails,
+		// "testresourceDetails");
+
+		// Create property
+		// property.setPropertyName("test");
+		// property.setPropertyType("integer");
+		// property.setPropertySource("A&AI");
+		// property.setPropertyDescription("test property");
+
+		// body = gson.toJson(property);
+		property = ElementFactory.getDefaultProperty();
+		body = property.propertyToJsonString();
+		// System.out.println(body);
+		// HTTP (for negative tests)
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncDesignerDetails.getUserId());
+
+	}
+
+	@Test
+	public void testPropertyApis() throws Exception {
+		// Create property
+		// System.out.println ("---- Create Property (POST) ----");
+
+		String propertyId = UniqueIdBuilder.buildComponentPropertyUniqueId(getResourceId(resourceDetails), property.getName());
+
+		PropertyRestUtils.deleteProperty(getResourceId(resourceDetails), propertyId, sdncDesignerDetails);
+		RestResponse createPropertyResponse = PropertyRestUtils.createProperty(getResourceId(resourceDetails), body,
+				sdncDesignerDetails);
+		AssertJUnit.assertTrue("Expected result code - 201, received - " + createPropertyResponse.getErrorCode(),
+				createPropertyResponse.getErrorCode() == 201);
+
+		// Get property
+		// System.out.println ("---- Get Property (GET) ----");
+		RestResponse getPropertyResponse = PropertyRestUtils.getProperty(getResourceId(resourceDetails), propertyId,
+				sdncDesignerDetails);
+		AssertJUnit.assertTrue("Expected result code - 200, received - " + getPropertyResponse.getErrorCode(),
+				getPropertyResponse.getErrorCode() == 200);
+
+		JSONObject jsonResp = (JSONObject) JSONValue.parse(getPropertyResponse.getResponse());
+
+		// assertTrue("Wrong 'type' in the
+		// response",jsonResp.get("type").equals(property.getPropertyType()));
+		// assertTrue("Wrong 'source' in the
+		// response",jsonResp.get("name").equals(property.getPropertyName()));
+		// assertTrue("Wrong 'name' in the
+		// response",jsonResp.get("source").equals(property.getPropertySource()));
+		// assertTrue("Wrong 'description' in the
+		// response",jsonResp.get("description").equals(property.getPropertyDescription()));
+
+		// Update property
+		// System.out.println ("---- Update Property (UPDATE) ----");
+		property.setPropertyDescription("Updated description");
+		// body = gson.toJson(property);
+		body = property.propertyToJsonString();
+
+		RestResponse updatePropertyResponse = PropertyRestUtils.updateProperty(getResourceId(resourceDetails),
+				propertyId, body, sdncDesignerDetails);
+		AssertJUnit.assertTrue("Expected result code - 200, received - " + updatePropertyResponse.getErrorCode(),
+				updatePropertyResponse.getErrorCode() == 200);
+
+		// Get property
+		// System.out.println ("---- Get Property (GET) ----");
+		getPropertyResponse = PropertyRestUtils.getProperty(getResourceId(resourceDetails), propertyId,
+				sdncDesignerDetails);
+		AssertJUnit.assertTrue("Expected result code - 200, received - " + getPropertyResponse.getErrorCode(),
+				getPropertyResponse.getErrorCode() == 200);
+
+		jsonResp = (JSONObject) JSONValue.parse(getPropertyResponse.getResponse());
+
+		// assertTrue("Wrong 'type' in the
+		// response",jsonResp.get("type").equals(property.getPropertyType()));
+		// assertTrue("Wrong 'source' in the
+		// response",jsonResp.get("name").equals(property.getPropertyName()));
+		// assertTrue("Wrong 'name' in the
+		// response",jsonResp.get("source").equals(property.getPropertySource()));
+		// assertTrue("Wrong 'description' in the
+		// response",jsonResp.get("description").equals(property.getPropertyDescription()));
+
+		// Delete property
+		// System.out.println ("---- Delete Property (DELETE) ----");
+		RestResponse deletePropertyResponse = PropertyRestUtils.deleteProperty(getResourceId(resourceDetails),
+				propertyId, sdncDesignerDetails);
+		AssertJUnit.assertTrue("Expected result code - 204, received - " + deletePropertyResponse.getErrorCode(),
+				deletePropertyResponse.getErrorCode() == 204);
+
+		// Get property - verify that the property doesn't exist.
+		// System.out.println("---- GET - Property Not Found ----");
+		getPropertyResponse = PropertyRestUtils.getProperty(getResourceId(resourceDetails), propertyId,
+				sdncDesignerDetails);
+		List<String> variables = Arrays.asList("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
+				getPropertyResponse.getResponse());
+
+	}
+
+	// --------------------------------------------------------------------------------------
+
+	protected String getPropertyId(ResourceReqDetails resource, PropertyReqDetails property) {
+		// return
+		// resource.getResourceName().toLowerCase()+".0.1."+property.getPropertyName();
+		return UniqueIdBuilder.buildComponentPropertyUniqueId(resource.getUniqueId(), property.getName());
+	}
+
+	protected String getResourceId(ResourceReqDetails resource) {
+		// String resourceUid =
+		// UniqueIdBuilder.buildResourceUniqueId(resource.getResourceName(),
+		// "0.1");
+
+		return resource.getUniqueId();
+	}
+
+	protected User createUser(String cspUserId, String firstName, String lastName, String email, String role)
+			throws Exception {
+		User sdncUserDetails = new User(firstName, lastName, cspUserId, email, role, null);
+
+		User adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		UserRestUtils.createUser(sdncUserDetails, adminUser);
+
+		return sdncUserDetails;
+	}
+
+	protected ResourceReqDetails createResource(User sdncUserDetails, String resourceName) throws Exception {
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		// String category = ResourceCategoryEnum.DATABASE.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.0";
+		String contactId = sdncUserDetails.getUserId();
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(),
+				ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
+		// deleteResource(resourceName.toLowerCase()+".0.1",sdncUserDetails.getUserId());
+		// TODO delete by name
+		// deleteResource(UniqueIdBuilder.buildResourceUniqueId(resourceName,
+		// "0.1"), sdncUserDetails.getUserId());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
+		AssertJUnit.assertTrue(createResource.getErrorCode().intValue() == 201);
+		String resourceId = ResponseParser.getUniqueIdFromResponse(createResource);
+		resourceDetails.setUniqueId(resourceId);
+
+		return resourceDetails;
+
+	}
+
+	@Test
+	public void putReqToCreateUriNotAllowed() throws Exception {
+		// System.out.println("---- PUT request to Create uri - Not Allowed
+		// ----");
+		String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails));
+		RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void getReqToCreateUriNotAllowed() throws Exception {
+		// System.out.println("---- GET request to Create uri - Not Allowed
+		// ----");
+		String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails));
+		RestResponse propertyErrorResponse = httpRequest.httpSendGet(url, headersMap);
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void deleteReqToCreateUriNotAllowed() throws Exception {
+		// System.out.println("---- DELETE request to Create uri - Not Allowed
+		// ----");
+		String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails));
+		RestResponse propertyErrorResponse = httpRequest.httpSendDelete(url, headersMap);
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void postReqToUpdateUriNotAllowed() throws Exception {
+		// System.out.println("---- POST request to Update uri - Not Allowed
+		// ----");
+		String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
+		RestResponse propertyErrorResponse = httpRequest.httpSendPost(url, body, headersMap);
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void deleteReqPropertyNotFound() throws Exception {
+		// System.out.println("---- DELETE - Property Not Found ----");
+		String unknownPropertyId = getPropertyId(resourceDetails, property) + "111";
+		String url = String.format(Urls.DELETE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails), unknownPropertyId);
+		RestResponse propertyErrorResponse = httpRequest.httpSendDelete(url, headersMap);
+		List<String> variables = Arrays.asList("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void updateReqPropertyNotFound() throws Exception {
+		// System.out.println("---- PUT - Property Not Found ----");
+		String unknownPropertyId = getPropertyId(resourceDetails, property) + "111";
+		String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails), unknownPropertyId);
+		RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
+		List<String> variables = Arrays.asList("");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void modifierNotTheStateOwner() throws Exception {
+		// System.out.println("---- The modifier is not the state owner -
+		// Operation Not Allowed ----");
+		User sdncUserDetails2 = createUser("tu5555", "Test", "User", "tu5555@intl.sdc.com", "DESIGNER");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails2.getUserId());
+		property.setPropertyDescription("new description");
+		// body = gson.toJson(property);
+		body = property.propertyToJsonString();
+		String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
+		RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				propertyErrorResponse.getResponse());
+
+	}
+
+	@Test
+	public void postReqInvalidContent() throws Exception {
+		// System.out.println("---- POST - Invalid Content ----");
+		body = "invalid";
+		String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
+		RestResponse propertyErrorResponse = httpRequest.httpSendPost(url, body, headersMap);
+
+		// System.out.println(propertyErrorResponse.getResponse()+" "+
+		// propertyErrorResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	@Test
+	public void putReqInvalidContent() throws Exception {
+
+		// Create property
+		// System.out.println ("---- Create Property (POST) ----");
+		RestResponse createPropertyResponse = PropertyRestUtils.createProperty(getResourceId(resourceDetails), body,
+				sdncDesignerDetails);
+		assertTrue("Expected result code - 201, received - " + createPropertyResponse.getErrorCode(),
+				createPropertyResponse.getErrorCode() == 201);
+
+		// System.out.println("---- PUT - Invalid Content ----");
+		body = "invalid";
+
+		String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
+
+		// System.out.println(url + "\n" + body);
+
+		RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
+
+		// System.out.println(propertyErrorResponse.getResponse()+" "+
+		// propertyErrorResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
+				propertyErrorResponse.getResponse());
+	}
+
+	// --------------------------------------------------------------------------------------
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java
new file mode 100644
index 0000000..0ec6b00
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.common.util.SerializationUtils;
+import org.testng.annotations.Test;
+
+import fj.data.Either;
+
+public class CheckGetResource {
+
+	public void checkGetVmmsc6() throws Exception {
+
+		try {
+
+			System.out.println("dddd");
+			RestResponse getResource = ResourceRestUtils.getResource("96eb6583-2822-448b-a284-bfc144fa627e");
+
+			Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+
+			Either<byte[], Boolean> serialize = SerializationUtils.serializeExt(resource);
+
+			SerializationUtils.deserializeExt(serialize.left().value(), Resource.class, "ffff");
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java
new file mode 100644
index 0000000..d05dd10
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ComponentRelationshipInVfTest.java
@@ -0,0 +1,1408 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.client.ClientProtocolException;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.RelationshipImpl;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class ComponentRelationshipInVfTest extends ComponentBaseTest {
+
+	public ComponentRelationshipInVfTest() {
+		super(new TestName(), ComponentRelationshipInVfTest.class.getName());
+	}
+
+	private ResourceReqDetails resourceDetailsVF;
+	private User designerUser;
+	private User adminUser;
+	private User testerUser;
+	private ResourceReqDetails resourceDetailsReq;
+	private ResourceReqDetails resourceDetailsCap;
+
+	@BeforeMethod
+	public void before() throws Exception {
+		designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		testerUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+
+		resourceDetailsVF = ElementFactory.getDefaultResourceByType("VF100", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, designerUser.getUserId(), ResourceTypeEnum.VF.toString());
+		createResource(resourceDetailsVF, designerUser);
+
+		resourceDetailsReq = ElementFactory.getDefaultResourceByType("SoftCompRouter",
+				NormativeTypesEnum.SOFTWARE_COMPONENT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS,
+				designerUser.getUserId(), ResourceTypeEnum.CP.toString()); // resourceType
+																			// =
+																			// VFC
+		resourceDetailsCap = ElementFactory.getDefaultResourceByType("MyCompute", NormativeTypesEnum.COMPUTE,
+				ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, designerUser.getUserId(), ResourceTypeEnum.CP.toString()); // resourceType
+																														// =
+																														// VFC
+
+	}
+
+	private void createResource(ResourceReqDetails resourceDetails, User user) throws Exception, IOException {
+		RestResponse createResourceResponse = ResourceRestUtils.createResource(resourceDetails, user);
+		ResourceRestUtils.checkCreateResponse(createResourceResponse);
+		if (!resourceDetails.getResourceType().equals("VF"))
+			LifecycleRestUtils.changeResourceState(resourceDetails, user, "0.1", LifeCycleStatesEnum.CHECKIN);
+	}
+
+	private void createAtomicResource(ResourceReqDetails resourceDetails, User user) throws Exception {
+		createResource(resourceDetails, user);
+	}
+
+	private RequirementCapabilityRelDef setRelationshipBetweenInstances(ComponentInstance riReq,
+			ComponentInstance riCap, CapReqDef capReqDef) throws Exception {
+
+		String capbilityUid = capReqDef.getCapabilities().get("tosca.capabilities.Container").get(0).getUniqueId();
+		String requirementUid = capReqDef.getRequirements().get("tosca.capabilities.Container").get(0).getUniqueId();
+
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		requirementDef.setFromNode(riReq.getUniqueId());
+		requirementDef.setToNode(riCap.getUniqueId());
+
+		RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair();
+		pair.setRequirementOwnerId(riReq.getUniqueId());
+		pair.setCapabilityOwnerId(riCap.getUniqueId());
+		pair.setRequirement("host");
+		RelationshipImpl relationship = new RelationshipImpl();
+		relationship.setType("tosca.capabilities.Container");
+		pair.setRelationships(relationship);
+		pair.setCapabilityUid(capbilityUid);
+		pair.setRequirementUid(requirementUid);
+		List<RequirementAndRelationshipPair> relationships = new ArrayList<>();
+		relationships.add(pair);
+		requirementDef.setRelationships(relationships);
+		return requirementDef;
+	}
+
+	private ComponentInstance createComponentInstance(ResourceReqDetails res) throws Exception {
+		return createComponentInstance(res, designerUser);
+	}
+
+	private ComponentInstance createComponentInstance(ResourceReqDetails res, User user, ResourceReqDetails vf)
+			throws Exception {
+		RestResponse response = ResourceRestUtils.createResourceInstance(res, user, vf.getUniqueId());
+		ResourceRestUtils.checkCreateResponse(response);
+		ComponentInstance compInstance = ResponseParser.parseToObject(response.getResponse(), ComponentInstance.class);
+		return compInstance;
+	}
+
+	private ComponentInstance createComponentInstance(ResourceReqDetails res, User user) throws Exception {
+		return createComponentInstance(res, user, resourceDetailsVF);
+	}
+
+	private void createTwoAtomicResourcesByType(String reqType, String capType, User user1, User user2)
+			throws Exception {
+		resourceDetailsReq.setResourceType(reqType);
+		createAtomicResource(resourceDetailsReq, user1);
+		resourceDetailsCap.setResourceType(capType);
+		createAtomicResource(resourceDetailsCap, user2);
+	}
+
+	private void createTwoAtomicResourcesByType(String reqType, String capType) throws Exception {
+		createTwoAtomicResourcesByType(reqType, capType, designerUser, designerUser);
+	}
+
+	@Test
+	public void associateInVF() throws Exception {
+
+		createTwoAtomicResourcesByType(ResourceTypeEnum.VFC.toString(), ResourceTypeEnum.VFC.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get("tosca.capabilities.Container");
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get("tosca.capabilities.Container");
+
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		requirementDef.setFromNode(riReq.getUniqueId());
+		requirementDef.setToNode(riCap.getUniqueId());
+
+		RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair();
+		pair.setRequirementOwnerId(riReq.getUniqueId());
+		pair.setCapabilityOwnerId(riCap.getUniqueId());
+		pair.setRequirement("host");
+		RelationshipImpl relationship = new RelationshipImpl();
+		relationship.setType("tosca.capabilities.Container");
+		pair.setRelationships(relationship);
+		pair.setCapabilityUid(capList.get(0).getUniqueId());
+		pair.setRequirementUid(reqList.get(0).getUniqueId());
+		List<RequirementAndRelationshipPair> relationships = new ArrayList<>();
+		relationships.add(pair);
+		requirementDef.setRelationships(relationships);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(designerUser,
+				resourceDetailsVF);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+
+		List<RequirementDefinition> list = capReqDef.getRequirements().get("tosca.capabilities.Container");
+		assertEquals("Check requirement", null, list);
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, dissociateInstances.getErrorCode().intValue());
+
+		getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(designerUser, resourceDetailsVF);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+
+		list = capReqDef.getRequirements().get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, list.size());
+	}
+
+	//////////////////////////////// Q A //////////////////////////////
+	private boolean checkRealtionship(String fromNode, String toNode, String resourceUniqueId) throws Exception {
+		List<RequirementCapabilityRelDef> componentInstancesRelations = getComponentInstancesRelations(
+				resourceUniqueId);
+		RequirementCapabilityRelDef requirementCapabilityRelDef = componentInstancesRelations.get(0);
+		boolean fromNodeCheck = requirementCapabilityRelDef.getFromNode().equals(fromNode);
+		boolean toNodeCheck = requirementCapabilityRelDef.getToNode().equals(toNode);
+
+		return fromNodeCheck && toNodeCheck;
+	}
+
+	private List<RequirementCapabilityRelDef> getComponentInstancesRelations(String resourceUniqueId)
+			throws ClientProtocolException, IOException {
+		Resource resource = getVfAsResourceObject(resourceUniqueId);
+		List<RequirementCapabilityRelDef> componenRelationInstances = resource.getComponentInstancesRelations();
+
+		return componenRelationInstances;
+	}
+
+	private Resource getVfAsResourceObject(String resourceUniqueId) throws ClientProtocolException, IOException {
+		RestResponse getResource = ResourceRestUtils.getResource(resourceUniqueId);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		return resource;
+	}
+
+	private List<ComponentInstance> getComponentInstancesList(String resourceUniqueId) throws Exception {
+		Resource resource = getVfAsResourceObject(resourceUniqueId);
+		List<ComponentInstance> componentInstances = resource.getComponentInstances();
+		return componentInstances;
+	}
+
+	@Test
+	public void associateCpToCpTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.CP.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		requirementsBeforeAssociate.remove("tosca.capabilities.Container");
+		assertTrue(capReqDef.getRequirements().equals(requirementsBeforeAssociate));
+
+		List<CapabilityDefinition> list = capabilitiesBeforeAssociate.get("tosca.capabilities.Container");
+		for (CapabilityDefinition cap : list) {
+			cap.setMinOccurrences("0");
+		}
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+	}
+
+	private CapReqDef getResourceReqCap(ResourceReqDetails res) throws IOException {
+		RestResponse getResourceBeforeAssociate = ComponentRestUtils.getComponentRequirmentsCapabilities(designerUser,
+				resourceDetailsVF);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceBeforeAssociate.getResponse(), CapReqDef.class);
+		return capReqDef;
+	}
+
+	private CapReqDef getResourceReqCap() throws IOException {
+		return getResourceReqCap(resourceDetailsVF);
+	}
+
+	@Test
+	public void associateCpToVLTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		requirementsBeforeAssociate.remove("tosca.capabilities.Container");
+		assertTrue(capReqDef.getRequirements().equals(requirementsBeforeAssociate));
+
+		List<CapabilityDefinition> list = capabilitiesBeforeAssociate.get("tosca.capabilities.Container");
+		for (CapabilityDefinition cap : list) {
+			cap.setMinOccurrences("0");
+		}
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+
+	}
+
+	// Error handling
+	// ELLA - more informative error
+	@Test
+	public void associateCpToVlInVFCTest() throws Exception {
+		ResourceReqDetails vfcDetails = ElementFactory.getDefaultResourceByType("VFC100", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, designerUser.getUserId(), ResourceTypeEnum.VFC.toString());
+		RestResponse createVfcResponse = ResourceRestUtils.createResource(vfcDetails, designerUser);
+		ResourceRestUtils.checkCreateResponse(createVfcResponse);
+
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				vfcDetails.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 400, associateInstances.getErrorCode().intValue());
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "SoftCompRouter 1",
+		// "MyCompute 2",
+		// "host"
+		// ]
+	}
+
+	// Error handling
+	@Test
+	public void associateCpToVfTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riCapInVfInstance = createComponentInstance(resourceDetailsCap, designerUser,
+				resourceDetailsVF);
+		ComponentInstance riReqInVfInstance = createComponentInstance(resourceDetailsReq, designerUser,
+				resourceDetailsVF);
+
+		ResourceReqDetails vfHigh = new ResourceReqDetails(resourceDetailsVF, "0.1");
+		vfHigh.setName("vfHigh");
+		vfHigh.setTags(new ArrayList<String>(Arrays.asList(vfHigh.getName())));
+		vfHigh.setResourceType(ResourceTypeEnum.VF.toString());
+		createResource(vfHigh, designerUser);
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq, designerUser, vfHigh);
+		LifecycleRestUtils.changeResourceState(resourceDetailsVF, designerUser, "0.1", LifeCycleStatesEnum.CHECKIN);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsVF, designerUser, vfHigh);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				associateInstances.getResponse());
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "SoftCompRouter 1",
+		// "VF100 2",
+		// "host"
+		// ]
+	}
+
+	// Error handling
+	@Test
+	public void associateVfcToVfcNotFoundTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.VFC.toString(), ResourceTypeEnum.VFC.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+		riCap.setUniqueId("123");
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 400, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_BAD_REQUEST.name(),
+				new ArrayList<String>(), associateInstances.getResponse());
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "SoftCompRouter 1",
+		// "012f6dcd-bcdf-4d9b-87be-ff1442b95831.5d265453-0b6a-4453-8f3d-57a253b88432.softcomprouter1",
+		// "host"
+	}
+
+	@Test
+	public void associateCpToDeletedVfcTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VFC.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceDetailsCap.getUniqueId(),
+				designerUser.getUserId());
+		ResourceRestUtils.checkDeleteResponse(deleteResourceResponse);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+	}
+
+	@Test
+	public void associateCpToDeletedVlTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceDetailsCap.getUniqueId(),
+				designerUser.getUserId());
+		ResourceRestUtils.checkDeleteResponse(deleteResourceResponse);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+	}
+
+	@Test
+	public void associateCpToDeletedCpTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.CP.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceDetailsCap.getUniqueId(),
+				designerUser.getUserId());
+		ResourceRestUtils.checkDeleteResponse(deleteResourceResponse);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+	}
+
+	// Error handling
+	@Test
+	public void associateCpToDeletedCpInstanceTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.CP.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse deleteComponentInstance = ComponentInstanceRestUtils.deleteComponentInstance(designerUser,
+				resourceDetailsVF.getUniqueId(), riReq.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ComponentInstanceRestUtils.checkDeleteResponse(deleteComponentInstance);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 400, associateInstances.getErrorCode().intValue());
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "7d6aca08-9321-4ea1-a781-c52c8214a30e.c0e63466-5283-44d8-adff-365c0885a6ba.softcomprouter1",
+		// "MyCompute 2",
+		// "host"
+		// ]
+	}
+
+	// Error handling
+	@Test
+	public void associateVfcToDeletedVFCInstanceTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.VFC.toString(), ResourceTypeEnum.VFC.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse deleteComponentInstance = ComponentInstanceRestUtils.deleteComponentInstance(designerUser,
+				resourceDetailsVF.getUniqueId(), riReq.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ComponentInstanceRestUtils.checkDeleteResponse(deleteComponentInstance);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 400, associateInstances.getErrorCode().intValue());
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "7d6aca08-9321-4ea1-a781-c52c8214a30e.c0e63466-5283-44d8-adff-365c0885a6ba.softcomprouter1",
+		// "MyCompute 2",
+		// "host"
+		// ]
+	}
+
+	@Test
+	public void associateWithDifferentOwnerOfVf() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2), resourceDetailsVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				associateInstances.getResponse());
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsAfterAssociate = capReqDef.getRequirements();
+
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+		assertTrue(requirementsAfterAssociate.equals(requirementsBeforeAssociate));
+	}
+
+	@Test
+	public void associateWithTester() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), resourceDetailsVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				associateInstances.getResponse());
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsAfterAssociate = capReqDef.getRequirements();
+
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+		assertTrue(requirementsAfterAssociate.equals(requirementsBeforeAssociate));
+	}
+
+	// Error handling
+	@Test
+	public void associateCpToVLIntoVFNotFound() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		String uidNotFound = "123";
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				uidNotFound, ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 404, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(),
+				new ArrayList<String>(Arrays.asList("")), associateInstances.getResponse());
+
+		// {"serviceException":{"messageId":"SVC4063","text":"Error: Requested
+		// '%1' resource was not found.","variables":[""]}}}
+	}
+
+	// Error Handling
+	@Test
+	public void associateCpToVlWithMissingUid() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		requirementDef.setToNode("");
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 400, associateInstances.getErrorCode().intValue());
+		// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(),
+		// new ArrayList<String>(), associateInstances.getResponse());
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "SoftCompRouter 1",
+		// "fd3a689b-fa1c-4105-933d-d1310e642f05.95bce626-ce73-413b-8c14-2388d1589d5c.softcomprouter1",
+		// "host"
+		// ]
+	}
+
+	@Test
+	public void associateInServiceWithUidOfVf() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", 404, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(),
+				new ArrayList<String>(Arrays.asList("")), associateInstances.getResponse());
+	}
+
+	@Test
+	public void associateCpToVl_DifferentOwners() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString(), designerUser,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2));
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		requirementsBeforeAssociate.remove("tosca.capabilities.Container");
+		assertTrue(capReqDef.getRequirements().equals(requirementsBeforeAssociate));
+
+		List<CapabilityDefinition> list = capabilitiesBeforeAssociate.get("tosca.capabilities.Container");
+		for (CapabilityDefinition cap : list) {
+			cap.setMinOccurrences("0");
+		}
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+	}
+
+	@Test(enabled = false)
+	public void associateToNotCheckedoutVf() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse changeResourceStateToCheckin = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckin);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				associateInstances.getResponse());
+
+		CapReqDef capReqDef = getResourceReqCap();
+		assertTrue(capReqDef.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDef.getCapabilities().equals(capabilitiesBeforeAssociate));
+
+		String firstUniqueId = resourceDetailsVF.getUniqueId();
+
+		// checkout
+
+		RestResponse changeResourceStateToCheckout = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckout);
+		String secondUniqueId = resourceDetailsVF.getUniqueId();
+
+		CapReqDef capReqDefAfterFirstCheckout = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterFirstCheckout = capReqDefAfterFirstCheckout
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsAfterFirstCheckout = capReqDefAfterFirstCheckout
+				.getRequirements();
+
+		requirementDef = setUidsOfInstancesAfterLifecycleStateChange(riReq, riCap, capReqDefBeforeAssociate);
+
+		RestResponse firstAssociateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, firstAssociateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		CapReqDef capReqDefAfterFirstAssociate = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterFirstAssociate = capReqDefAfterFirstAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsAfterFirstAssociate = capReqDefAfterFirstAssociate
+				.getRequirements();
+
+		requirementsAfterFirstCheckout.remove("tosca.capabilities.Container");
+		assertTrue(requirementsAfterFirstAssociate.equals(requirementsAfterFirstCheckout));
+		assertTrue(capabilitiesAfterFirstAssociate.equals(capabilitiesAfterFirstCheckout));
+
+		resourceDetailsVF.setUniqueId(firstUniqueId);
+		CapReqDef capReqDefOfFirstVersion = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesOfFirstVersion = capReqDefOfFirstVersion.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsOfFirstVersion = capReqDefOfFirstVersion.getRequirements();
+
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+		assertTrue(requirementsBeforeAssociate.equals(requirementsOfFirstVersion));
+		assertTrue(capabilitiesBeforeAssociate.equals(capabilitiesOfFirstVersion));
+
+		// checkin-checkout
+		resourceDetailsVF.setUniqueId(secondUniqueId);
+		RestResponse changeResourceStateToCheckin2 = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckin2);
+		RestResponse changeResourceStateToCheckout2 = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckout2);
+
+		List<RequirementCapabilityRelDef> componentInstancesRelations = getComponentInstancesRelations(
+				resourceDetailsVF.getUniqueId());
+		assertFalse(componentInstancesRelations.isEmpty());
+		assertEquals(1, componentInstancesRelations.size());
+		List<ComponentInstance> componentInstancesList = getComponentInstancesList(resourceDetailsVF.getUniqueId());
+		for (ComponentInstance comp : componentInstancesList) {
+			String instanceUid = comp.getUniqueId();
+			assertTrue(checkNodesInRelations(instanceUid, componentInstancesRelations.get(0)));
+		}
+		assertEquals(2, componentInstancesList.size());
+
+	}
+
+	private RequirementCapabilityRelDef setUidsOfInstancesAfterLifecycleStateChange(ComponentInstance riReq,
+			ComponentInstance riCap, CapReqDef capReqDefBeforeAssociate)
+			throws ClientProtocolException, IOException, Exception {
+		RequirementCapabilityRelDef requirementDef;
+		// RestResponse getResourceResponse =
+		// ResourceRestUtils.getResource(resourceDetailsVF.getUniqueId());
+		// Resource resource_0_2 =
+		// ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(),
+		// Resource.class);
+		// List<ComponentInstance> componentInstances =
+		// resource_0_2.getComponentInstances();
+		List<ComponentInstance> componentInstances = getComponentInstancesList(resourceDetailsVF.getUniqueId());
+
+		for (ComponentInstance comp : componentInstances) {
+			if (comp.getName().equals(riReq.getName())) {
+				riReq.setUniqueId(comp.getUniqueId());
+			} else if (comp.getName().equals(riCap.getName())) {
+				riCap.setUniqueId(comp.getUniqueId());
+			}
+		}
+		requirementDef = setRelationshipBetweenInstances(riReq, riCap, capReqDefBeforeAssociate);
+		return requirementDef;
+	}
+
+	private boolean checkNodesInRelations(String instanceUid, RequirementCapabilityRelDef relation) {
+		if (relation.getToNode().equals(instanceUid)) {
+			return true;
+		} else if (relation.getFromNode().equals(instanceUid)) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	@Test
+	public void associateOneOfTwoCPsToVl_ThenDiscocciate() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+		ResourceReqDetails secondResourceDetailsReq = new ResourceReqDetails(resourceDetailsReq, "0.1");
+		secondResourceDetailsReq.setName("secondCP");
+		secondResourceDetailsReq.setTags(Arrays.asList(secondResourceDetailsReq.getName()));
+		createAtomicResource(secondResourceDetailsReq, designerUser);
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riReq2 = createComponentInstance(secondResourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		List<RequirementDefinition> expectedList = requirementsBeforeAssociate.get("tosca.capabilities.Container");
+		for (RequirementDefinition req : expectedList) {
+			if (req.getOwnerName().equals(riReq2.getName())) {
+				expectedList = new ArrayList<RequirementDefinition>(Arrays.asList(req));
+				break;
+			}
+		}
+		requirementsBeforeAssociate.put("tosca.capabilities.Container", expectedList);
+		assertTrue(capReqDef.getRequirements().equals(requirementsBeforeAssociate));
+
+		List<CapabilityDefinition> list = capabilitiesBeforeAssociate.get("tosca.capabilities.Container");
+		for (CapabilityDefinition cap : list) {
+			cap.setMinOccurrences("0");
+		}
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+
+		// second relationship
+
+		RequirementCapabilityRelDef secondRequirementDef = setRelationshipBetweenInstances(riReq2, riCap,
+				capReqDefBeforeAssociate);
+		RestResponse secondAssociateInstances = ComponentInstanceRestUtils.associateInstances(secondRequirementDef,
+				designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, secondAssociateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(secondRequirementDef.getFromNode(), secondRequirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		CapReqDef capReqDefAfterSecondAssociation = getResourceReqCap();
+
+		requirementsBeforeAssociate.remove("tosca.capabilities.Container");
+		assertTrue(capReqDefAfterSecondAssociation.getRequirements().equals(requirementsBeforeAssociate));
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterSecondAssociate = capReqDefAfterSecondAssociation
+				.getCapabilities();
+		assertTrue(capabilitiesAfterSecondAssociate.equals(capabilitiesBeforeAssociate));
+
+		// dissociate
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(secondRequirementDef,
+				designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+		CapReqDef capReqDefAfterDissociation = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterDissociate = capReqDefAfterDissociation
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsAfterDissociate = capReqDefAfterDissociation
+				.getRequirements();
+
+		assertTrue(capabilitiesAfterDissociate.equals(capReqDef.getCapabilities()));
+		requirementsBeforeAssociate.put("tosca.capabilities.Container", expectedList);
+		assertTrue(requirementsAfterDissociate.equals(requirementsBeforeAssociate));
+	}
+
+	@Test
+	public void associateNotCompitableCapAndReq() throws Exception {
+		resourceDetailsReq = ElementFactory.getDefaultResourceByType("Database", NormativeTypesEnum.DATABASE,
+				ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, designerUser.getUserId(), ResourceTypeEnum.CP.toString()); // resourceType
+																														// =
+																														// VFC
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		assertTrue(requirementDef.getRelationships().size() == 1);
+		String requirement = requirementDef.getRelationships().get(0).getRequirement();
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 404, associateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_MATCH_NOT_FOUND.name(),
+				new ArrayList<String>(Arrays.asList(riReq.getName(), riCap.getName(), requirement)),
+				associateInstances.getResponse());
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsAfterAssociate = capReqDef.getRequirements();
+
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+		assertTrue(requirementsAfterAssociate.equals(requirementsBeforeAssociate));
+
+	}
+
+	@Test
+	public void disassociateCpAndCpTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.CP.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+	}
+
+	@Test
+	public void disassociateCpAndVfcTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VFC.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+	}
+
+	@Test
+	public void disassociateCpAndVLTest() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+	}
+
+	// Error handliing
+	// in the error should we get the unique id of instances instead of names
+	@Test
+	public void disassociateNotFoundAssociation() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+		String requirementName = requirementDef.getRelationships().get(0).getRequirement();
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 404, dissociateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND.name(),
+				new ArrayList<String>(Arrays.asList(riReq.getName(), riCap.getName(), requirementName)),
+				dissociateInstances.getResponse());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+	}
+
+	// Error handliing
+	@Test
+	public void disassociateRelationInVfNotFound() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		String uidNotFound = "123";
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				uidNotFound, ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 404, dissociateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(),
+				new ArrayList<String>(Arrays.asList(uidNotFound)), dissociateInstances.getResponse());
+
+		// "serviceException": {
+		// "messageId": "SVC4063",
+		// "text": "Error: Requested \u0027%1\u0027 resource was not found.",
+		// "variables": [
+		// ""
+		// ]
+	}
+
+	@Test
+	public void disassociateWithDifferentDesigner() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2), resourceDetailsVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, dissociateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				dissociateInstances.getResponse());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+
+	}
+
+	@Test
+	public void disassociateWithTester() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), resourceDetailsVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, dissociateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				dissociateInstances.getResponse());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertNotNull("Requierment is null after disassociate with tester", listOfRequierments);
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+	}
+
+	@Test
+	public void disassociateServiceWithUidOfVF() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VFC.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", 404, dissociateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(),
+				new ArrayList<String>(Arrays.asList("")), dissociateInstances.getResponse());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertTrue(listOfRequierments == null);
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).size() != 0);
+	}
+
+	@Test
+	public void disassociateWithEmptyVfUid() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				"", ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 404, dissociateInstances.getErrorCode().intValue());
+
+		CapReqDef capReqDef = getResourceReqCap();
+
+		requirementsBeforeAssociate.remove("tosca.capabilities.Container");
+		assertTrue(capReqDef.getRequirements().equals(requirementsBeforeAssociate));
+
+		List<CapabilityDefinition> list = capabilitiesBeforeAssociate.get("tosca.capabilities.Container");
+		for (CapabilityDefinition cap : list) {
+			cap.setMinOccurrences("0");
+		}
+
+		Map<String, List<CapabilityDefinition>> capabilitiesAfterAssociate = capReqDef.getCapabilities();
+		assertTrue(capabilitiesAfterAssociate.equals(capabilitiesBeforeAssociate));
+	}
+
+	@Test
+	public void disassociateOneComponentDeleted() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+
+		RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceDetailsCap.getUniqueId(),
+				designerUser.getUserId());
+		ResourceRestUtils.checkDeleteResponse(deleteResourceResponse);
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+
+		List<RequirementDefinition> listOfRequierments = capReqDefAfterDissociate.getRequirements()
+				.get("tosca.capabilities.Container");
+		assertEquals("Check requirement", 1, listOfRequierments.size());
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+	}
+
+	@Test
+	public void disassociateNotCheckedoutVf() throws Exception {
+		createTwoAtomicResourcesByType(ResourceTypeEnum.CP.toString(), ResourceTypeEnum.VL.toString());
+
+		ComponentInstance riReq = createComponentInstance(resourceDetailsReq);
+		ComponentInstance riCap = createComponentInstance(resourceDetailsCap);
+
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap();
+		Map<String, List<CapabilityDefinition>> capabilitiesBeforeAssociate = capReqDefBeforeAssociate
+				.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementsBeforeAssociate = capReqDefBeforeAssociate
+				.getRequirements();
+
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(riReq, riCap,
+				capReqDefBeforeAssociate);
+
+		RestResponse changeResourceStateToCheckin = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckin);
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", 409, dissociateInstances.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				dissociateInstances.getResponse());
+
+		CapReqDef capReqDefAfterDissociate = getResourceReqCap();
+		assertTrue(capReqDefAfterDissociate.getRequirements().equals(requirementsBeforeAssociate));
+		assertTrue(capReqDefAfterDissociate.getCapabilities().equals(capabilitiesBeforeAssociate));
+
+		RestResponse changeResourceStateToCheckout = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckout);
+
+		requirementDef = setUidsOfInstancesAfterLifecycleStateChange(riReq, riCap, capReqDefBeforeAssociate);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, designerUser,
+				resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF.getUniqueId()));
+
+		RestResponse secondDisociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				designerUser, resourceDetailsVF.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, secondDisociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+		RestResponse changeResourceStateToCheckout2 = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckout2);
+		RestResponse changeResourceStateToCheckout3 = LifecycleRestUtils.changeResourceState(resourceDetailsVF,
+				designerUser, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.checkSuccess(changeResourceStateToCheckout3);
+
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF.getUniqueId()).isEmpty());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java
new file mode 100644
index 0000000..50d1056
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java
@@ -0,0 +1,2222 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.validation.constraints.AssertTrue;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+/**
+ * @author yshlosberg
+ * 
+ */
+public class CreateResourceApiTest extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(CreateResourceApiTest.class.getName());
+
+	String contentTypeHeaderData = "application/json";
+	String acceptHeaderDate = "application/json";
+	String resourceVersion = "0.1";
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public CreateResourceApiTest() {
+		super(name, CreateResourceApiTest.class.getName());
+	}
+
+	@Test
+	public void createResourceTest() throws Exception {
+
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// ResourceReqDetails resourceDetails = new
+		// ResourceReqDetails(resourceName, description, resourceTags, category,
+		// derivedFrom, vendorName, vendorRelease, contactId, icon);
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		String resourceName = resourceDetails.getName();
+		resourceDetails.setTags(Arrays.asList(resourceName, resourceName, resourceName, resourceName, "tag2", "tag2"));
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@Test
+	public void createResourceNonDefaultResourceTypeTest() throws Exception {
+
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		String resourceType = ResourceTypeEnum.CP.toString();
+		resourceDetails.setResourceType(resourceType);
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		resourceRespJavaObject.setResourceType(resourceType);
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@Test
+	public void createResourceTest_costAndLicenseType() throws Exception {
+
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		String resourceVersion = "0.1";
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+
+	}
+
+	// ////Benny
+	@Test
+	public void createResourceTest_CostIsMissing() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		// resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		String resourceVersion = "0.1";
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+	}
+
+	@Test
+	public void createResourceTest_LicenseTypeMissing() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		// resourceDetails.setLicenseType("User");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		String resourceVersion = "0.1";
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+	}
+
+	@Test
+	public void createResourceTest_LicenseType_Installation() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("99999.999");
+		resourceDetails.setLicenseType("Installation");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		String resourceVersion = "0.1";
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+	}
+
+	@Test
+	public void createResourceTest_LicenseType_CPU() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("0.0");
+		resourceDetails.setLicenseType("CPU");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		// validate response
+		String resourceVersion = "0.1";
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+	}
+
+	@Test
+	public void createResourceTest_LicenseType_Uppercase() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("0.0");
+		resourceDetails.setLicenseType("INSTALLATION");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
+	}
+
+	@Test
+	public void createResourceTest_LicenseType_Invalid() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("0.0");
+		resourceDetails.setLicenseType("CPUUU");
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
+	}
+
+	@Test
+	public void createResourceTest_CostValidation_noNumeric() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+		resourceDetails.setCost("12355.34b");
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+	}
+
+	@Test
+	public void createResourceTest_CostValidation_valueLength() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+
+		// Adding invalid cost
+		resourceDetails.setCost("12355.3434");
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+	}
+
+	@Test
+	public void createResourceTest_CostValidation_PriceLimitations() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+
+		// Adding invalid cost
+		RestResponse createResponse;
+		// create resource
+
+		resourceDetails.setCost("000000.000");
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+		/*
+		 * resourceDetails.setCost("0550.457"); createResponse =
+		 * resourceUtils.createResource(resourceDetails, sdncModifierDetails);
+		 * assertNotNull("check response object is not null after create resource"
+		 * , createResponse);
+		 * assertNotNull("check error code exists in response after create resource"
+		 * , createResponse.getErrorCode());
+		 * assertEquals("Check response code after create resource", 400,
+		 * createResponse.getErrorCode().intValue());
+		 * assertEquals("Check response code after create resource",
+		 * "Bad Request", createResponse.getResponseMessage().toString());
+		 */
+
+		resourceDetails.setCost("1");
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+		resourceDetails.setCost("123555.340");
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+		resourceDetails.setCost("123.4570");
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+		resourceDetails.setCost("123555.30");
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+		resourceDetails.setCost("123.5550");
+		createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request",
+				createResponse.getResponseMessage().toString());
+
+	}
+
+	@Test
+	public void createResourceTest_CostIsNull() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+		resourceDetails.setCost("");
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
+
+	}
+
+	@Test
+	public void createResourceTest_LicenseIsNull() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// set resource details
+		String resourceName = "CISCO4572";
+		String description = "description";
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add(resourceName);
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		// Adding cost and licenseType
+		resourceDetails.setCost("12355.345");
+		resourceDetails.setLicenseType("User");
+		resourceDetails.setLicenseType("");
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
+
+	}
+
+	@Test
+	public void createResourceTest_uri_methods() throws Exception {
+
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		ResourceReqDetails resourceDetails = createRandomResource();
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		log.debug(userBodyJson);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		RestResponse createResourceResponse2 = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
+
+		// validate response
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.NOT_ALLOWED.name());
+
+		assertNotNull("check response object is not null after create resource", createResourceResponse2);
+		assertNotNull("check error code exists in response after create resource",
+				createResourceResponse2.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(),
+				createResourceResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				createResourceResponse2.getResponse());
+
+	}
+
+	private ResourceReqDetails createRandomResource() {
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		return resourceDetails;
+	}
+
+	@Test
+	public void createResource_role_tester() throws Exception {
+
+		// init TESTER user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+
+		ResourceReqDetails resourceDetails2 = createRandomResource();
+
+		// create resource
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.TESTER.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.TESTER.getUserName());
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	// TODO DE171450(to check)
+	@Test
+	public void createResource_role_DESIGNER() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ResourceReqDetails resourceDetails = createRandomResource();
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		// validate response
+		assertNotNull("check response object is not null after create resource", restResponse);
+		assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
+		assertEquals(
+				"Check response code after create resource, response message is: " + restResponse.getResponseMessage(),
+				201, restResponse.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResource_missing_header() throws Exception {
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		ResourceReqDetails resourceDetails = createRandomResource();
+
+		// set null in userId header
+		sdncModifierDetails.setUserId(null);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), variables,
+				restResponse2.getResponse());
+
+		// //validate audit
+		//
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// resourceUtils.constructFieldsForAuditValidation(resourceDetails,resourceVersion);
+		//
+		// String auditAction="Create";
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setModifierUid("null null");
+		// expectedResourceAuditJavaObject.setModifierName("null null");
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setCurrState("");
+		// expectedResourceAuditJavaObject.setPrevVersion("");
+		// expectedResourceAuditJavaObject.setCurrVersion("");
+		// expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		//
+		// String auditDesc =
+		// AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		// expectedResourceAuditJavaObject.setDesc(auditDesc);
+		//
+		// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+		// auditAction);
+		// TODO: yshlosberg enable back
+
+	}
+
+	@Test
+	public void createResource_existing_resource() throws Exception {
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// ResourceReqDetails resourceDetails = createRandomResource();
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+
+		// create resource
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		assertNotNull("check response object is not null after create resource", restResponse);
+		assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+
+		// set resource details
+		ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
+		resourceDetails2.setName(resourceDetails.getName());
+		
+		// clean ES DB
+		DbUtils.cleanAllAudits();
+
+		// create resource
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", resourceDetails2.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_category() throws Exception {
+
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		;
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		category = null;
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_empty_category() throws Exception {
+
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		category = "";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_tags() throws Exception {
+
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		;
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_TAGS.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_TAGS.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	// TODO DE171450(to check)
+	@Test
+	public void createResourceTest_with_multiple_tags() throws Exception {
+
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// // set resource details
+		// String resourceName = "CISCO4";
+		// String description = "description";
+		// ArrayList<String> resourceTags = new ArrayList<String>();
+		// resourceTags.add(resourceName);
+		// resourceTags.add("tag2");
+		// String category = ResourceServiceCategoriesEnum.VOIP.getValue();
+		// ArrayList<String> derivedFrom = new ArrayList<String>();
+		// derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		// String vendorName = "Oracle";
+		// String vendorRelease = "1.5";
+		// String icon = "myICON";
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setTags(Arrays.asList(resourceDetails.getName(), "tag2"));
+
+		// create resource
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		assertNotNull("check response object is not null after create resource", restResponse);
+		assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createResourceTest_empty_tag() throws Exception {
+
+		// init ADMIN user
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add("");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FIELD_FORMAT.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse);
+		assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), restResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", "tag");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_with_empty_vendorName() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		vendorName = "";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_NAME.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_vendorName() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		vendorName = null;
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+		assertNotNull("check response object is not null after create resource", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create resource", 400, restResponse2.getErrorCode().intValue());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), variables,
+				restResponse2.getResponse());
+
+	}
+
+	@Test
+	public void createResourceTest_with_empty_vendorRelease() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		vendorRelease = "";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_RELEASE.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_RELEASE.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_vendorRelease() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		vendorRelease = null;
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_RELEASE.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_RELEASE.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_with_empty_contactId() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		contactId = "";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CONTACT.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_contactId() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		contactId = null;
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CONTACT.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_with_empty_icon() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		icon = "";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_ICON.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_icon() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		icon = null;
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_ICON.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_with_empty_description() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		description = "";
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createResourceTest_without_description() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// set resource details
+		String resourceName = "CISCO4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		// set resource details
+		description = null;
+
+		ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		// create resource
+
+		RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
+
+		// validate response
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
+
+		assertNotNull("check response object is not null after create resouce", restResponse2);
+		assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), variables,
+				restResponse2.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createAndGetResourceByNameAndVersion() throws Exception {
+
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		ResourceReqDetails resourceDetailsComp = ElementFactory.getDefaultResource("testresourceComp",
+				NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, sdncModifierDetails.getUserId());
+
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetailsComp, sdncModifierDetails);
+		// validate response
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		String resourceVersion = "0.1";
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetailsComp,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResourceByNameAndVersion(
+				sdncModifierDetails.getUserId(), resourceDetailsComp.getName(), resourceDetailsComp.getVersion());
+		assertEquals("Check response code after delete resource", 200, resourceGetResponse.getErrorCode().intValue());
+		// Resource resource =
+		// ResourceRestUtils.parseResourceFromListResp(resourceGetResponse);
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+		// resourceDetailsComp.setUniqueId(resource.getUniqueId());
+
+	}
+
+	@Test
+	public void createResourceResourceTypeNotExistsTest() throws Exception {
+
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		String resourceType = "NOT EXISTS";
+		resourceDetails.setResourceType(resourceType);
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
+
+		assertNotNull("check response object is not null after create resouce", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), createResponse.getErrorCode());
+
+		List<String> variables = new ArrayList<>();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
+				createResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
+				.constructFieldsForAuditValidation(resourceDetails, resourceVersion);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@Test
+	public void createResourceResourceTypeEmptyTest() throws Exception {
+
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		// String resourceType = "";
+		// resourceDetails.setResourceType(resourceType);
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// ErrorInfo errorInfo =
+		// ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
+		//
+		// assertNotNull("check response object is not null after create
+		// resouce", createResponse);
+		// assertNotNull("check error code exists in response after create
+		// resource", createResponse.getErrorCode());
+		// assertEquals("Check response code after create service",
+		// errorInfo.getCode(), createResponse.getErrorCode());
+		//
+		// List<String> variables = new ArrayList<>();
+		// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(),
+		// variables, createResponse.getResponse());
+		//
+		// // validate audit
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// Convertor.constructFieldsForAuditValidation(resourceDetails,
+		// resourceVersion);
+		// String auditAction = "Create";
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setPrevVersion("");
+		// expectedResourceAuditJavaObject.setCurrState("");
+		// expectedResourceAuditJavaObject.setCurrVersion("");
+		// expectedResourceAuditJavaObject.setResourceName("");
+		// expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getUserId());
+		// expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getFullName());
+		// expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		//
+		// String auditDesc =
+		// AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		// expectedResourceAuditJavaObject.setDesc(auditDesc);
+		// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+		// auditAction, null, false);
+	}
+
+	@Test
+	public void checkInvariantUuidIsImmutable() throws Exception {
+		// choose the user to create resource
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		String invariantUuidDefinedByUser = "!!!!!!!!!!!!!!!!!!!!!!!!";
+		resourceDetails.setInvariantUUID(invariantUuidDefinedByUser);
+		String resourceName = resourceDetails.getName();
+		resourceDetails.setTags(Arrays.asList(resourceName, resourceName, resourceName, resourceName, "tag2", "tag2"));
+		// create resource
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
+		BaseRestUtils.checkStatusCode(createResponse, "create request failed", false, 201);
+		// validate response
+		assertNotNull("check response object is not null after create resource", createResponse);
+		assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
+		assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
+
+		Resource resourceCreation = ResponseParser.convertResourceResponseToJavaObject(createResponse.getResponse());
+		String invariantUUIDcreation = resourceCreation.getInvariantUUID();
+		// validate response
+		ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+				resourceVersion);
+		resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setAbstractt("false");
+		ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncUserDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(resourceGetResponse);
+		Resource resourceGetting = ResponseParser
+				.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+		String invariantUUIDgetting = resourceGetting.getInvariantUUID();
+		assertEquals(invariantUUIDcreation, invariantUUIDgetting);
+
+		// Update resource with new invariant UUID
+		RestResponse restResponseUpdate = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncUserDetails,
+				resourceDetails.getUniqueId());
+		BaseRestUtils.checkSuccess(restResponseUpdate);
+		Resource updatedResource = ResponseParser.convertResourceResponseToJavaObject(restResponseUpdate.getResponse());
+		String invariantUUIDupdating = updatedResource.getInvariantUUID();
+		assertEquals(invariantUUIDcreation, invariantUUIDupdating);
+
+		// Do checkin
+		RestResponse restResponseCheckin = LifecycleRestUtils.changeResourceState(resourceDetails, sdncUserDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		BaseRestUtils.checkSuccess(restResponseCheckin);
+		Resource checkinResource = ResponseParser
+				.convertResourceResponseToJavaObject(restResponseCheckin.getResponse());
+		String invariantUUIDcheckin = checkinResource.getInvariantUUID();
+		String version = checkinResource.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcheckin);
+		assertEquals(version, "0.1");
+
+		// Do checkout
+		RestResponse restResponseCheckout = LifecycleRestUtils.changeResourceState(resourceDetails, sdncUserDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		BaseRestUtils.checkSuccess(restResponseCheckout);
+		Resource ResourceResource = ResponseParser
+				.convertResourceResponseToJavaObject(restResponseCheckout.getResponse());
+		String invariantUUIDcheckout = ResourceResource.getInvariantUUID();
+		version = ResourceResource.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcheckout);
+		assertEquals(version, "0.2");
+
+		// do certification request
+		RestResponse restResponseCertificationRequest = LifecycleRestUtils.changeResourceState(resourceDetails,
+				sdncUserDetails, resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		BaseRestUtils.checkSuccess(restResponseCertificationRequest);
+		Resource certificationRequestResource = ResponseParser
+				.convertResourceResponseToJavaObject(restResponseCertificationRequest.getResponse());
+		String invariantUUIDcertificationRequest = certificationRequestResource.getInvariantUUID();
+		version = certificationRequestResource.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcertificationRequest);
+		assertEquals(version, "0.2");
+
+		// start certification
+		RestResponse restResponseStartCertification = LifecycleRestUtils.changeResourceState(resourceDetails,
+				sdncUserDetails, resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		BaseRestUtils.checkSuccess(restResponseStartCertification);
+		Resource startCertificationRequestResource = ResponseParser
+				.convertResourceResponseToJavaObject(restResponseStartCertification.getResponse());
+		String invariantUUIDStartCertification = startCertificationRequestResource.getInvariantUUID();
+		version = startCertificationRequestResource.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDStartCertification);
+		assertEquals(version, "0.2");
+
+		// certify
+		RestResponse restResponseCertify = LifecycleRestUtils.changeResourceState(resourceDetails, sdncUserDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		BaseRestUtils.checkSuccess(restResponseCertify);
+		Resource certifyResource = ResponseParser
+				.convertResourceResponseToJavaObject(restResponseCertify.getResponse());
+		String invariantUUIDcertify = certifyResource.getInvariantUUID();
+		version = certifyResource.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcertify);
+		assertEquals(version, "1.0");
+
+	}
+
+	// US672129 BENNY
+
+	private void getResourceValidateInvariantUuid(String resourceUniqueId, String invariantUUIDcreation)
+			throws Exception {
+		RestResponse getResource = ResourceRestUtils.getResource(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				resourceUniqueId);
+		BaseRestUtils.checkSuccess(getResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		assertEquals(invariantUUIDcreation, resource.getInvariantUUID());
+	}
+
+	@Test
+	public void resourceInvariantUuid() throws Exception {
+
+		User designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		User testerUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResourceByType("VF200", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, designerUser.getUserId(), ResourceTypeEnum.VF.toString());
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService("newtestservice1",
+				ServiceCategoriesEnum.MOBILITY, designerUser.getUserId());
+
+		// ResourceReqDetails resourceDetails =
+		// ElementFactory.getDefaultResource();
+		resourceDetails.setInvariantUUID("kokomoko");
+		RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, designerUser);
+		assertEquals("Check response code after create resource", BaseRestUtils.STATUS_CODE_CREATED,
+				createResponse.getErrorCode().intValue());
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResponse.getResponse(), Resource.class);
+		String invariantUUIDcreation = resource.getInvariantUUID(); // generated
+																	// when the
+																	// component
+																	// is
+																	// created
+																	// and never
+																	// changed
+		// get resource and verify InvariantUuid is not changed
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+
+		// Update resource with new invariant UUID
+		resourceDetails.setInvariantUUID("1234567890");
+		RestResponse updateResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, designerUser,
+				resourceDetails.getUniqueId());
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
+				updateResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+
+		// checkIn resource
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+
+		// checkIn resource
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+		// certification request
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+		// start certification
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+		// certify
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
+		// update resource
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		resourceDetails.setDescription("updatedDescription");
+		resourceDetails.setVendorRelease("1.2.3.4");
+		updateResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, designerUser,
+				resourceDetails.getUniqueId());
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, updateResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// certification request
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// checkout resource
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// certification request
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+		// start certification
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// cancel certification
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
+				LifeCycleStatesEnum.CANCELCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// start certification
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// failure
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
+				LifeCycleStatesEnum.FAILCERTIFICATION);
+		assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// upload artifact
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		ArtifactReqDetails artifactDetails = ElementFactory.getDefaultArtifact();
+		ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails, designerUser,
+				resourceDetails.getUniqueId());
+		assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// checkIn resource
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		// create instance
+		RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
+		ResourceRestUtils.checkCreateResponse(createServiceResponse);
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetails);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, designerUser, serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_CREATED,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java
new file mode 100644
index 0000000..25c3242
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java
@@ -0,0 +1,582 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class GetAllResourceVersions extends ComponentBaseTest {
+
+	private static Logger logger = LoggerFactory.getLogger(GetAllResourceVersions.class.getName());
+	protected User designerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	protected User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+	protected ResourceReqDetails resourceDetails;
+
+	public static TestName name = new TestName();
+
+	public GetAllResourceVersions() {
+		super(name, GetAllResourceVersions.class.getName());
+
+	}
+
+	//// NEW
+
+	protected void deleteAllVersionOfResource() throws Exception {
+		RestResponse response = null;
+
+		String[] versions = { "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0",
+				"2.1", "2.2", "2.3", "2.4", "2.5", "3.0", "4.0", "4.1" };
+
+		for (String version : versions) {
+
+			response = ResourceRestUtils.deleteResourceByNameAndVersion(designerDetails,
+					resourceDetails.getName().toUpperCase(), version);
+			AssertJUnit.assertTrue("delete request returned status:" + response.getErrorCode(),
+					response.getErrorCode() == 204 || response.getErrorCode() == 404);
+
+			response = ResourceRestUtils.deleteResourceByNameAndVersion(designerDetails, resourceDetails.getName(),
+					version);
+			AssertJUnit.assertTrue("delete request returned status:" + response.getErrorCode(),
+					response.getErrorCode() == 204 || response.getErrorCode() == 404);
+
+		}
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+		resourceDetails = defineResourse();
+		deleteAllVersionOfResource();
+
+	}
+
+	@AfterMethod
+	public void endOfTests() throws Exception {
+		deleteAllVersionOfResource();
+	}
+
+	protected ResourceReqDetails defineResourse() {
+		String resourceName = "cisco4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		// String category = ServiceCategoriesEnum.MOBILITY.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
+
+		return resourceDetails;
+	}
+
+	@Test
+	public void getResourceAllVersions_version15() throws Exception {
+		// create resource
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		AssertJUnit.assertTrue("create request returned status:" + restResponse.getErrorCode(),
+				restResponse.getErrorCode() == 201);
+		String resourceName = resourceDetails.getName();
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+		for (int x = 0; x < 4; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+				checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+				checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+				checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+				checkoutResource.getErrorCode().intValue());
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		// change resource version to 1.5
+		for (int x = 0; x < 5; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+			AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			AssertJUnit.assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		AssertJUnit.assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	protected RestResponse createResource(User sdncModifierDetails, ResourceReqDetails resourceDetails)
+			throws Exception {
+		// clean ES DB
+		DbUtils.cleanAllAudits();
+
+		// create resource
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		AssertJUnit.assertNotNull("check response object is not null after create resource", restResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create resource",
+				restResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create resource", 201,
+				restResponse.getErrorCode().intValue());
+
+		return restResponse;
+	}
+
+	@Test
+	public void getResourceAllVersions_version05() throws Exception {
+
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+
+		logger.debug("Changing resource life cycle ");
+		for (int x = 0; x < 4; x++) {
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		}
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_version01() throws Exception {
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_version25() throws Exception {
+
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
+		String resourceName = resourceDetails.getName();
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+		for (int x = 0; x < 4; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		// resource version 1.0
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+		// change resource version to 1.5
+		for (int x = 0; x < 5; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		// resource version 2.0
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+		// change resource version to 2.5
+		for (int x = 0; x < 5; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_ReadyForCertification_version05() throws Exception {
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		String resourceName = resourceDetails.getName();
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+		for (int x = 0; x < 4; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		}
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_CertifactionInProgress_version05() throws Exception {
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+		String resourceName = resourceDetails.getName();
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+		for (int x = 0; x < 4; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		}
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_Certified_version10() throws Exception {
+
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
+		String resourceName = resourceDetails.getName();
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+		for (int x = 0; x < 4; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+
+		}
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_Certified_version20() throws Exception {
+
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+
+		// create resource
+		RestResponse restResponse = createResource(designerDetails, resourceDetails);
+		assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
+		String resourceName = resourceDetails.getName();
+		// resourceUtils.addResourceMandatoryArtifacts(designerDetails,
+		// restResponse);
+
+		// change resource version to 0.5
+		RestResponse checkoutResource;
+		for (int x = 0; x < 4; x++) {
+			logger.debug("Changing resource life cycle ");
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		// get to version 1.0
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+		// change resource version to 1.5
+		for (int x = 0; x < 4; x++) {
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+			checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
+					resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+			assertEquals("Check response code after checkout resource", 200,
+					checkoutResource.getErrorCode().intValue());
+		}
+
+		// get to version 1.0
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+		origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
+
+		// validate get response
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
+				resourceDetails.getUniqueId());
+		Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void getResourceAllVersions_ResourceNotFound() throws Exception {
+
+		RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails, "123456789");
+		assertEquals("Check response code after checkout resource", 404, resourceGetResponse.getErrorCode().intValue());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java
new file mode 100644
index 0000000..562150e
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetResourceNotAbstractApiTest.java
@@ -0,0 +1,328 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.imports.ImportGenericResourceCITest;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public class GetResourceNotAbstractApiTest extends ComponentBaseTest {
+
+	private static Logger logger = LoggerFactory.getLogger(ComponentBaseTest.class.getName());
+	protected static final int STATUS_CODE_GET_SUCCESS = 200;
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetResourceNotAbstractApiTest() {
+		super(name, GetResourceNotAbstractApiTest.class.getName());
+	}
+
+	@Test
+	public void getNotAbstractResourceList() throws Exception {
+
+		// remove all the not abstract resources
+		// Map<NormativeTypes, Boolean> originalState =
+		// ImportResourceCITest.removeAllNormativeTypeResources();
+
+		// import all the default not abstract resources
+		// ImportGenericResourceCITest.importAllNormativeTypesResources(UserRoleEnum.ADMIN);
+
+		// Get not abstract resources
+		RestResponse getResourceNotAbstarctResponse = getNotAbstractResources();
+		// Check that received 200.
+		assertEquals("Check response code after get abstract resources", STATUS_CODE_GET_SUCCESS,
+				getResourceNotAbstarctResponse.getErrorCode().intValue());
+		// Verify that all the resources not abstract
+		assertTrue("One or more resources are abstract", isAllResourcesNotAbstract(getResourceNotAbstarctResponse));
+		// Verify that all the resources are certified
+		assertTrue("Not all the resources are certified", isAllResourcesCertified(getResourceNotAbstarctResponse));
+
+		String objectStorageUid = "ObjectStorage";
+		String computeUid = "Compute";
+		String blockStorageUid = "BlockStorage";
+		String loadBalancerUid = "LoadBalancer";
+		// String portUid = "tosca.nodes.Network.Port";
+		String portUid = "Port";
+		String networkUid = "Network";
+		String databaseUid = "Database";
+
+		// Compare expected list of abstract resources to actual list of
+		// abstract resources.
+		List<String> expectedNotAbstractResourcesUniqueIdArray = new ArrayList<String>(Arrays.asList(computeUid,
+				databaseUid, objectStorageUid, blockStorageUid, loadBalancerUid, portUid, networkUid));
+
+		List<String> actualNotAbstarctResourcesUniqueIdArray = restResponseToListByHeader(
+				getResourceNotAbstarctResponse, "name");
+
+		// Collections.sort(actualNotAbstarctResourcesUniqueIdArray);
+		// Collections.sort(expectedNotAbstractResourcesUniqueIdArray);
+
+		List<String> toFind = new ArrayList<>();
+		toFind.add(objectStorageUid);
+		toFind.add(computeUid);
+		toFind.add(blockStorageUid);
+		toFind.add(loadBalancerUid);
+		toFind.add(portUid);
+
+		boolean removeAll = toFind.removeAll(actualNotAbstarctResourcesUniqueIdArray);
+		logger.debug("Cannot find resources {}", toFind.toString());
+
+		for (String expectedResource : expectedNotAbstractResourcesUniqueIdArray) {
+			if (false == actualNotAbstarctResourcesUniqueIdArray.contains(expectedResource)) {
+				// System.out.println("Not found abstract resource " +
+				// expectedResource);
+			}
+		}
+
+		assertTrue(
+				"Expected abstract resources list: " + expectedNotAbstractResourcesUniqueIdArray.toString()
+						+ " Actual: " + actualNotAbstarctResourcesUniqueIdArray.toString(),
+				actualNotAbstarctResourcesUniqueIdArray.containsAll(expectedNotAbstractResourcesUniqueIdArray));
+
+		/*
+		 * java.lang.AssertionError: Expected abstract resources list:
+		 * [tosca.nodes.Compute, tosca.nodes.ObjectStorage,
+		 * tosca.nodes.BlockStorage, tosca.nodes.LoadBalancer,
+		 * tosca.nodes.Network.Port] Actual: [resourceforproperty216,
+		 * tosca.nodes.Compute, tosca.nodes.Database, resourceforproperty217,
+		 * resourceforproperty217, tosca.nodes.ObjectStorage,
+		 * tosca.nodes.BlockStorage, tosca.nodes.LoadBalancer,
+		 * tosca.nodes.network.Port, tosca.nodes.network.Network,
+		 * resourceforproperty217, resourceforproperty217,
+		 * resourceforproperty217, resourceforproperty217,
+		 * resourceforproperty217, resourceforproperty217,
+		 * resourceforproperty217, resourceforproperty217,
+		 * resourceforproperty217, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317,
+		 * resourceforproperty317, resourceforproperty317]
+		 */
+
+		// Create resource (not certified)
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		String resourceName = "TestResource";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String category = ServiceCategoriesEnum.MOBILITY.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.0";
+		String contactId = "Peter";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		// assertEquals("Check response code after create user", 201,
+		// restResponse.getErrorCode().intValue());
+
+		// Get not abstract resources
+		getResourceNotAbstarctResponse = getNotAbstractResources();
+		// Check that received 200.
+		assertEquals("Check response code after get abstract resources", STATUS_CODE_GET_SUCCESS,
+				getResourceNotAbstarctResponse.getErrorCode().intValue());
+		// Verify that all the resources not abstract
+		assertTrue("One or more resources are abstract", isAllResourcesNotAbstract(getResourceNotAbstarctResponse));
+		// Verify that all the resources are certified
+		assertTrue("Not all the resources are certified", isAllResourcesCertified(getResourceNotAbstarctResponse));
+
+		// Compare expected list of abstract resources to actual list of
+		// abstract resources.
+		// expectedNotAbstractResourcesUniqueIdArray = new
+		// ArrayList<String>(Arrays.asList("tosca.nodes.compute.1.0",
+		// "tosca.nodes.objectstorage.1.0", "tosca.nodes.blockstorage.1.0",
+		// "tosca.nodes.loadbalancer.1.0", "tosca.nodes.network.port.1.0"));
+
+		// actualNotAbstarctResourcesUniqueIdArray =
+		// restResponseToListByHeader(getResourceNotAbstarctResponse,
+		// "uniqueId");
+
+		actualNotAbstarctResourcesUniqueIdArray = restResponseToListByHeader(getResourceNotAbstarctResponse, "name");
+
+		Collections.sort(actualNotAbstarctResourcesUniqueIdArray);
+		Collections.sort(expectedNotAbstractResourcesUniqueIdArray);
+
+		for (String expectedResource : expectedNotAbstractResourcesUniqueIdArray) {
+			if (false == actualNotAbstarctResourcesUniqueIdArray.contains(expectedResource)) {
+				// System.out.println("Not found abstract resource " +
+				// expectedResource);
+			}
+		}
+		assertTrue(
+				"Expected abstract resources list: " + expectedNotAbstractResourcesUniqueIdArray.toString()
+						+ " Actual: " + actualNotAbstarctResourcesUniqueIdArray.toString(),
+				actualNotAbstarctResourcesUniqueIdArray.containsAll(expectedNotAbstractResourcesUniqueIdArray));
+		// assertTrue("Expected abstract resources list: "+
+		// expectedNotAbstractResourcesUniqueIdArray.toString()+ " Actual:
+		// "+actualNotAbstarctResourcesUniqueIdArray.toString(),expectedNotAbstractResourcesUniqueIdArray.equals(actualNotAbstarctResourcesUniqueIdArray));
+
+		// restore the resources
+		// ImportResourceCITest.restoreToOriginalState(originalState);
+
+	}
+
+	protected RestResponse getNotAbstractResources() throws Exception {
+		HttpRequest httpRequest = new HttpRequest();
+
+		String url = String.format(Urls.GET_ALL_NOT_ABSTRACT_RESOURCES, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
+
+		RestResponse getResourceNotAbstarctResponse = httpRequest.httpSendGet(url, headersMap);
+
+		return getResourceNotAbstarctResponse;
+	}
+
+	protected List<String> restResponseToListByHeader(RestResponse restResponse, String restResponseHeader) {
+		JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
+		JsonArray jsonArray = jelement.getAsJsonArray();
+
+		List<String> restResponseArray = new ArrayList<>();
+
+		for (int i = 0; i < jsonArray.size(); i++) {
+			JsonObject jobject = (JsonObject) jsonArray.get(i);
+			String header = jobject.get(restResponseHeader).toString();
+			header = header.replace("\"", "");
+			restResponseArray.add(header);
+		}
+
+		return restResponseArray;
+
+	}
+
+	protected boolean isAllResourcesNotAbstract(RestResponse restResponse) {
+		JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
+		JsonArray jsonArray = jelement.getAsJsonArray();
+
+		for (int i = 0; i < jsonArray.size(); i++) {
+			JsonObject jobject = (JsonObject) jsonArray.get(i);
+
+			if (jobject.get("abstract").getAsBoolean()) {
+				return false;
+			}
+
+		}
+		return true;
+
+	}
+
+	protected boolean isEmptyList(RestResponse restResponse) {
+		JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
+		JsonArray jsonArray = jelement.getAsJsonArray();
+
+		if (jsonArray.size() == 0) {
+			return true;
+		}
+		return false;
+	}
+
+	protected boolean isAllResourcesCertified(RestResponse restResponse) {
+		JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
+		JsonArray jsonArray = jelement.getAsJsonArray();
+
+		String certified = "CERTIFIED";
+		String lifecycleState;
+
+		for (int i = 0; i < jsonArray.size(); i++) {
+			JsonObject jobject = (JsonObject) jsonArray.get(i);
+			lifecycleState = jobject.get("lifecycleState").getAsString();
+			if (!lifecycleState.equals(certified)) {
+				return false;
+			}
+
+		}
+		return true;
+	}
+
+	@Test(enabled = false)
+	public void getEmptyNonAbstractResourcesList() throws Exception {
+		// remove all the not abstract resources
+		Map<NormativeTypesEnum, Boolean> originalState = ImportGenericResourceCITest.removeAllNormativeTypeResources();
+
+		// Get not abstract resources
+		RestResponse getResourceNotAbstarctResponse = getNotAbstractResources();
+		// Check that received 200.
+		assertEquals("Check response code after get abstract resources", STATUS_CODE_GET_SUCCESS,
+				getResourceNotAbstarctResponse.getErrorCode().intValue());
+		// Verify empty list
+		assertTrue("Received list is not empty", isEmptyList(getResourceNotAbstarctResponse));
+
+		// restore the resources
+		// ImportResourceCITest.restoreToOriginalState(originalState);
+		// import the resources
+		ImportGenericResourceCITest.importAllNormativeTypesResources(UserRoleEnum.ADMIN);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java
new file mode 100644
index 0000000..feb7b6f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java
@@ -0,0 +1,372 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class ResourceApiTest extends ComponentBaseTest {
+
+	protected final String contentTypeHeaderData = "application/json";
+	protected final String acceptHeaderDate = "application/json";
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ResourceApiTest() {
+		super(name, ResourceApiTest.class.getName());
+	}
+
+	// Keep
+	@Test
+	public void updateResourceMetadataSuccess() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncModifierDetails.setUserId("jh0003");
+		RestResponse restResponse = createResourceForUpdate(sdncModifierDetails);
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		// set resource details
+		ResourceReqDetails resourceDetails = new ResourceReqDetails();
+		resourceDetails.setDescription("updatedDescription");
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		// Duplicate tags are allowed and should be de-duplicated by the server
+		// side
+		resourceTags.add(resourceRespJavaObject.getName());
+		resourceTags.add("tag1");
+		resourceTags.add("tag1");
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		resourceDetails.setTags(resourceTags);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.NETWORK_L2_3_ROUTERS.getCategory(),
+				ResourceCategoryEnum.NETWORK_L2_3_ROUTERS.getSubCategory());
+		resourceDetails.setVendorName("OracleUp");
+		resourceDetails.setVendorRelease("1.5Up");
+		resourceDetails.setContactId("pe1116");
+
+		resourceDetails.setIcon(resourceRespJavaObject.getIcon());
+		resourceDetails.setName(resourceRespJavaObject.getName());
+		resourceDetails.setDerivedFrom(resourceRespJavaObject.getDerivedFrom());
+
+		// ResourceReqDetails resourceDetails = new
+		// ResourceReqDetails(resourceName, description, resourceTags, category,
+		// derivedFrom, vendorName, vendorRelease, contactId, null);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceRespJavaObject.getUniqueId());
+		RestResponse updateResourceResponse = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
+
+		// resourceDetails.setResourceName(resourceRespJavaObject.getResourceName());
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails,
+				ResponseParser.convertResourceResponseToJavaObject(updateResourceResponse.getResponse()));
+
+		// Delete resource
+		deleteResource(resourceRespJavaObject.getUniqueId(), sdncModifierDetails.getUserId());
+
+	}
+
+	protected void deleteResource(String resourceUniqueId, String httpCspUserId) throws Exception {
+		RestResponse res = ResourceRestUtils.deleteResource(resourceUniqueId, httpCspUserId);
+
+		// System.out.println("Delete resource was finished with response: " +
+		// res.getErrorCode());
+	}
+
+	protected RestResponse createResourceForUpdate(User sdncModifierDetails) throws Exception {
+
+		ResourceReqDetails resourceDetails = getResourceObj();
+
+		// create resource
+		return ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+	}
+
+	public ResourceReqDetails getResourceObj() {
+		// set resource details
+		String resourceName = "ResourceForUpdate" + (int) (Math.random() * 100);
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		// String category = ResourceCategoriesEnum.MOBILITY.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "pe1116";
+		String icon = "myICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
+		return resourceDetails;
+	}
+
+	// -------------------------------------------------------------------
+
+	protected ResourceReqDetails defineResourse_Benny(int n) {
+		String resourceName = "cisco" + String.valueOf(n);
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add("tag1");
+		String category = ServiceCategoriesEnum.MOBILITY.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "borderElement";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		return resourceDetails;
+	}
+
+	@Test
+	public void getAllAbstractResources() throws Exception {
+		RestResponse abstractResources = CatalogRestUtils.getAbstractResources();
+
+		int status = abstractResources.getErrorCode();
+		assertTrue(status == 200);
+		String json = abstractResources.getResponse();
+		JSONArray array = (JSONArray) JSONValue.parse(json);
+		for (Object o : array) {
+			JSONObject value = (JSONObject) o;
+			Boolean element = (Boolean) value.get("abstract");
+			assertTrue(element);
+		}
+
+	}
+
+	@Test
+	public void getAllNotAbstractResources() throws Exception {
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+			String url = String.format(Urls.GET_ALL_NOT_ABSTRACT_RESOURCES, config.getCatalogBeHost(),
+					config.getCatalogBePort());
+			HttpGet httpget = new HttpGet(url);
+
+			httpget.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+
+			httpget.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+
+			httpget.addHeader(HttpHeaderEnum.USER_ID.getValue(),
+					ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+
+			// System.out.println("Executing request " +
+			// httpget.getRequestLine());
+			CloseableHttpResponse response = httpclient.execute(httpget);
+			int status = response.getStatusLine().getStatusCode();
+			assertTrue(status == 200);
+			try {
+				String json = EntityUtils.toString(response.getEntity());
+				JSONArray array = (JSONArray) JSONValue.parse(json);
+				for (Object o : array) {
+					JSONObject value = (JSONObject) o;
+					Boolean element = (Boolean) value.get("abstract");
+					assertTrue(!element);
+				}
+
+			} finally {
+				response.close();
+			}
+		} finally {
+			httpclient.close();
+		}
+	}
+
+	@Test
+	public void updateResourceMetadata_methodNotAllowed() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		// set resource details
+		String resourceName = "ResForUpdate";
+		String description = "updatedDescription";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add("tag1");
+		resourceTags.add("tag2");
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add("tosca.nodes.root");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		String vendorName = "OracleUp";
+		String vendorRelease = "1.5Up";
+		String contactId = "pe1117";
+		String icon = "myICON.jpgUp";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				"NotExistsId");
+
+		RestResponse updateResourceResponse = http.httpSendByMethod(url, "POST", userBodyJson, headersMap);
+
+		assertNotNull("Check error code exists in response after wrong update resource",
+				updateResourceResponse.getErrorCode());
+		assertEquals("Check error code after update resource", 405, updateResourceResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void validateResourceNameTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncModifierDetails.setUserId("jh0003");
+
+		ResourceReqDetails resourceDetails = getResourceObj();
+
+		// create resource
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		Resource resourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		try {
+
+			// check invalid
+			String url = String.format(Urls.VALIDATE_RESOURCE_NAME, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetails.getName());
+
+			HttpGet httpget = new HttpGet(url);
+
+			httpget.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+
+			httpget.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+
+			httpget.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+			// System.out.println("Executing request " +
+			// httpget.getRequestLine());
+			CloseableHttpResponse response = httpclient.execute(httpget);
+			int status = response.getStatusLine().getStatusCode();
+			assertTrue(status == 200);
+			try {
+				String json = EntityUtils.toString(response.getEntity());
+				JSONObject object = (JSONObject) JSONValue.parse(json);
+				Boolean element = (Boolean) object.get("isValid");
+				assertTrue(!element);
+
+			} finally {
+				response.close();
+			}
+			// check valid
+			url = String.format(Urls.VALIDATE_RESOURCE_NAME, config.getCatalogBeHost(), config.getCatalogBePort(),
+					resourceDetails.getName() + "temp");
+
+			httpget = new HttpGet(url);
+
+			httpget.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+
+			httpget.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+
+			httpget.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+			// System.out.println("Executing request " +
+			// httpget.getRequestLine());
+			response = httpclient.execute(httpget);
+			status = response.getStatusLine().getStatusCode();
+			assertTrue(status == 200);
+			try {
+				String json = EntityUtils.toString(response.getEntity());
+				JSONObject object = (JSONObject) JSONValue.parse(json);
+				Boolean element = (Boolean) object.get("isValid");
+				assertTrue(element);
+
+			} finally {
+				response.close();
+			}
+		} finally {
+			httpclient.close();
+		}
+
+		// Delete resource
+		ResourceRestUtils.deleteResource(resourceDetails, sdncModifierDetails, "0.1");
+
+	}
+
+	// -------------------------------------------------------------------
+	// //Benny Tal
+	// @Test
+	// public void createResource_Benny() throws Exception {
+	// for (int i = 0; i < 100; i++) {
+	// ResourceReqDetails resourceDetails = defineResourse_Benny(i);
+	//
+	// ResourceRestUtils.createResource(resourceDetails,
+	// UserUtils.getDesignerDetails());
+	// // resourceUtils.deleteResource(resourceDetails,
+	// UserUtils.getDesignerDetails(), "0.1");
+	// }
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java
new file mode 100644
index 0000000..f4a4fa1
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import java.io.IOException;
+
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.testng.ITestContext;
+import org.testng.annotations.DataProvider;
+
+public class SampleDataProvider {
+
+	@DataProvider
+	public static Object[][] getResourceByType(ITestContext context) throws IOException, Exception {
+		return new Object[][] {
+				{ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true) },
+				{ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true) },
+				{ AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true) } };
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java
new file mode 100644
index 0000000..3002523
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.testng.annotations.Test;
+
+public class SimultaneousApiTest extends ComponentBaseTest {
+
+	protected static ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+
+	@Rule
+	public static TestName name = new TestName();
+
+	static String httpCspUserId = "km2000";
+	static String userFirstName = "Kot";
+	static String userLastName = "Matroskin";
+	static String email = "km2000@intl.sdc.com";
+	static String role = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getRole();
+
+	public SimultaneousApiTest() {
+		super(name, SimultaneousApiTest.class.getName());
+
+	}
+
+	public static class WorkerThread implements Runnable {
+		CountDownLatch countDownLatch;
+		int threadIndex;
+
+		public WorkerThread(int threadIndex, CountDownLatch countDownLatch) {
+			this.threadIndex = threadIndex;
+			this.countDownLatch = countDownLatch;
+		}
+
+		@Override
+		public void run() {
+			System.out.println("**** Thread started " + threadIndex);
+			try {
+				RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
+						ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+				String id = ResponseParser.getUniqueIdFromResponse(createResource);
+				// System.out.println("**** Thread " + threadIndex + " create
+				// resource status " + createResource.getErrorCode() + " id = "
+				// + id + " error " + createResource.getResponse());
+				// assertEquals("**** create resource: " +
+				// createResource.getErrorCode() + " thread " + threadIndex,
+				// 201, status);
+			} catch (Exception e) {
+				// System.out.println("**** Thread " + threadIndex + " exception
+				// " + e);
+			}
+			countDownLatch.countDown();
+			// System.out.println("**** Thread finished " + threadIndex);
+
+		}
+
+		// public void run_() {
+		// System.out.println("**** Thread started " + threadIndex);
+		// try {
+		// UserUtils userUtils = new UserUtils();
+		// User userDetails = new User(userFirstName, userLastName,
+		// httpCspUserId, email, role , 0L);
+		// RestResponse response =
+		// userUtils.createUserTowardsCatalogBe(userDetails,
+		// userUtils.getUserDetailesAdmin());
+		// System.out.println("**** Thread " + threadIndex + " create resource
+		// status " + response.getErrorCode() + " response " +
+		// response.getResponse());
+		//// assertEquals("**** create resource: " +
+		// createResource.getErrorCode() + " thread " + threadIndex, 201,
+		// status);
+		// } catch (Exception e) {
+		// System.out.println("**** Thread " + threadIndex + " exception " + e);
+		// }
+		// countDownLatch.countDown();
+		// System.out.println("**** Thread finished " + threadIndex);
+		//
+		// }
+	}
+
+	@Test
+	public void create2Resources() throws InterruptedException {
+		int threadCount = 5;
+		CountDownLatch countDownLatch = new CountDownLatch(threadCount);
+		ExecutorService executor = Executors.newFixedThreadPool(threadCount);
+		for (int i = 0; i < threadCount; i++) {
+			Runnable worker = new WorkerThread(i + 1, countDownLatch);
+			executor.execute(worker);
+		}
+		countDownLatch.await();
+		// System.out.println(" finished ");
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java
new file mode 100644
index 0000000..9d519c8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java
@@ -0,0 +1,2650 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.openecomp.sdc.common.util.ValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class UpdateResourceMetadataTest extends ComponentBaseTest {
+	private static Logger logger = LoggerFactory.getLogger(UpdateResourceMetadataTest.class.getName());
+	protected List<String> Empty_List = new ArrayList<String>();
+	protected String extendedChars;
+
+	protected final String contentTypeHeaderData = "application/json";
+	protected final String acceptHeaderDate = "application/json";
+	protected final String CHARSET_ISO_8859 = "charset=ISO-8859-1";
+
+	public static TestName name = new TestName();
+	protected User sdncModifierDetails;
+	protected ResourceReqDetails resourceDetails;
+
+	public UpdateResourceMetadataTest() {
+		super(name, UpdateResourceMetadataTest.class.getName());
+
+	}
+
+	public String extendedCharsStringBuilder() throws Exception {
+		char[] extendedCharsArray = new char[128];
+		char ch = 128;
+		for (int i = 0; i < extendedCharsArray.length - 1; i++) {
+			extendedCharsArray[i] = ch;
+			ch++;
+		}
+		extendedChars = new String(extendedCharsArray);
+		return extendedChars;
+
+	}
+
+	@BeforeMethod
+	public void setup() throws Exception {
+		sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		resourceDetails = defineResourse();
+
+	}
+
+	// Keep
+	@Test
+	public void UpdateDerivedFromSuccess() throws Exception {
+
+		String oldDerivedFromName = NormativeTypesEnum.ROOT.getNormativeName();
+		String newDerivedFromName = NormativeTypesEnum.SOFTWARE_COMPONENT.getNormativeName();
+
+		// Getting both derived from resources for validation
+		/*
+		 * RestResponse resourceByNameAndVersion =
+		 * resourceUtils.getResourceByNameAndVersion(sdncModifierDetails,
+		 * oldDerivedFromName, "1.0");
+		 * assertEquals("Check response code after get database normative", 200,
+		 * resourceByNameAndVersion.getErrorCode().intValue()); Resource
+		 * databaseNormative =
+		 * resourceUtils.parseResourceResp(resourceByNameAndVersion);
+		 * 
+		 * resourceByNameAndVersion =
+		 * resourceUtils.getResourceByNameAndVersion(sdncModifierDetails,
+		 * newDerivedFromName, "1.0");
+		 * assertEquals("Check response code after get database normative", 200,
+		 * resourceByNameAndVersion.getErrorCode().intValue()); Resource
+		 * lbNormative =
+		 * resourceUtils.parseResourceResp(resourceByNameAndVersion);
+		 */
+
+		// Derived from set to Database
+		List<String> derivedFrom = new ArrayList<>();
+		derivedFrom.add(oldDerivedFromName);
+		resourceDetails.setDerivedFrom(derivedFrom);
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		AssertJUnit.assertEquals("Check response code after create resource", 201,
+				restResponse.getErrorCode().intValue());
+		Resource currentResource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		derivedFrom.clear();
+		derivedFrom.add(newDerivedFromName);
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResource.getUniqueId(), "");
+		AssertJUnit.assertEquals("Check response code after create resource", 200,
+				updatedRestResponse.getErrorCode().intValue());
+
+	}
+
+	protected ResourceReqDetails defineUpdateResourceWithNonUpdatableFields(Resource resourceBeforeUpdate) {
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceBeforeUpdate.getName());
+
+		updatedResourceDetails.setVersion("mumu");
+		updatedResourceDetails.setIsAbstract(true);
+		updatedResourceDetails.setIsHighestVersion(true);
+		updatedResourceDetails.setCreatorUserId("df4444");
+		updatedResourceDetails.setCreatorFullName("John Doe");
+		updatedResourceDetails.setLastUpdaterUserId("gf5646");
+		updatedResourceDetails.setLastUpdaterFullName("Viktor Tzoy");
+		updatedResourceDetails.setCreationDate(new Long(4444));
+		updatedResourceDetails.setLastUpdateDate(new Long("534535"));
+		updatedResourceDetails.setLifecycleState(LifecycleStateEnum.READY_FOR_CERTIFICATION);
+		updatedResourceDetails.setCost("6.1");
+		updatedResourceDetails.setLicenseType("Installation");
+		updatedResourceDetails.setUUID("dfsfsdf");
+		return updatedResourceDetails;
+	}
+
+	public void UpdateResourceNotFoundTest() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		String resourceName = "cisco4";
+		// update resource
+		String description = "updatedDescription";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.MOBILITY.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "newOracle";
+		String vendorRelease = "2.5";
+		String contactId = "jh0003";
+		String icon = "myICON";
+
+		ResourceReqDetails updatedResourceDetails = new ResourceReqDetails(resourceName, description, resourceTags,
+				category, derivedFrom, vendorName, vendorRelease, contactId, icon);
+		updatedResourceDetails.setUniqueId("dummyId");
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, "0.1");
+
+		// validate response
+		AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after update resource",
+				updatedRestResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after update resource", 404,
+				updatedRestResponse.getErrorCode().intValue());
+		// String resourceId =
+		// UniqueIdBuilder.buildResourceUniqueId(resourceName, "0.1");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), Arrays.asList("dummyId"),
+				updatedRestResponse.getResponse());
+
+		resourceName = "";
+		// resourceId = UniqueIdBuilder.buildResourceUniqueId(resourceName,
+		// "0.1");
+		updatedResourceDetails = defineUpdatedResourse(resourceName);
+		updatedResourceDetails.setUniqueId("dummyId");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+				"0.1");
+		AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after update resource",
+				updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), Arrays.asList("dummyId"),
+				updatedRestResponse.getResponse());
+
+	}
+
+	public char[] getInValidChars() throws Exception {
+
+		char[] extendedCharsArray = new char[59];
+		char ch = 1;
+		for (int i = 0; i < 44; i++) {
+			extendedCharsArray[i] = ch;
+			ch++;
+		}
+		ch = 58;
+		for (int i = 44; i < 51; i++) {
+			extendedCharsArray[i] = ch;
+			ch++;
+		}
+		ch = 91;
+		for (int i = 51; i < 55; i++) {
+			extendedCharsArray[i] = ch;
+			ch++;
+		}
+		ch = 123;
+		for (int i = 55; i < 59; i++) {
+			extendedCharsArray[i] = ch;
+			ch++;
+		}
+		return extendedCharsArray;
+	}
+
+	public char[] getTagInValidFormatChars() throws Exception {
+		// Tag format is the same as defined for "Resource Name" :
+		// Allowed characters: Alphanumeric (a-zA-Z0-9), space (' '), underscore
+		// ('_'), dash ('-'), dot ('.')
+		char[] notValidCharsArray = new char[30];
+		char ch = 33;
+		for (int i = 0; i < 12; i++) {
+			notValidCharsArray[i] = ch;
+			ch++;
+		}
+		notValidCharsArray[13] = 47;
+		ch = 58;
+		for (int i = 14; i < 21; i++) {
+			notValidCharsArray[i] = ch;
+			ch++;
+		}
+		ch = 91;
+		for (int i = 21; i < 24; i++) {
+			notValidCharsArray[i] = ch;
+			ch++;
+		}
+		notValidCharsArray[24] = 96;
+		ch = 123;
+		for (int i = 25; i < 30; i++) {
+			notValidCharsArray[i] = ch;
+			ch++;
+		}
+		return notValidCharsArray;
+	}
+
+	public void Validation_UpdateWithIncompleteJsonBodyTest() throws Exception {
+		// init ADMIN user
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// define and create resource
+		ResourceReqDetails resourceDetails = defineResourse();
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "0.1");
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.0");
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.1");
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceId = resourceDetails.getUniqueId();
+		resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
+
+		// build Json Object
+		JSONObject jsonObject = JsonObjectBuilder(resourceDetails);
+
+		List<String> resource = new ArrayList<>();
+		resource.add("Resource");
+
+		// remove Description
+		UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "description",
+				ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), resource);
+		// remove Tags
+		UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "tags",
+				ActionStatus.COMPONENT_MISSING_TAGS.name(), Empty_List);
+		// remove Category
+		UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "category",
+				ActionStatus.COMPONENT_MISSING_CATEGORY.name(), resource);
+		// remove VendorName
+		UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "vendorName",
+				ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List);
+		// remove VendorRelease
+		UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "vendorRelease",
+				ActionStatus.MISSING_VENDOR_RELEASE.name(), Empty_List);
+		// remove AT&T Contact
+		UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "contactId",
+				ActionStatus.COMPONENT_MISSING_CONTACT.name(), resource);
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails, "0.1");
+		// validate response
+		AssertJUnit.assertNotNull("check response object is not null after get resource", getRestResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after get resource",
+				getRestResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after update resource", 200,
+				getRestResponse.getErrorCode().intValue());
+
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "0.1");
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.0");
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.1");
+	}
+
+	// End of validation tests
+	// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	protected ResourceReqDetails defineUpdatedResourse(String resourceName) {
+		String description = "updatedDescription";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		// Duplicate tags are allowed and should be de-duplicated by server side
+		resourceTags.add(resourceName);
+		resourceTags.add("tag1");
+		resourceTags.add("tag1");
+		resourceTags.add("tag2");
+		resourceTags.add("tag2");
+		String category = ServiceCategoriesEnum.VOIP.getValue();
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
+		String vendorName = "updatedOracle";
+		String vendorRelease = "3.5";
+		String contactId = "jh0001";
+		String icon = "myUpdatedICON";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
+
+		return resourceDetails;
+	}
+
+	protected ResourceReqDetails defineResourse() {
+		String resourceName = "cisco4";
+		String description = "description";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());// "tosca.nodes.Root");
+		String vendorName = "Oracle";
+		String vendorRelease = "1.5";
+		String contactId = "jh0003";
+		String icon = "objectStorage";
+
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
+				derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
+
+		return resourceDetails;
+	}
+
+	protected RestResponse createResource(User sdncModifierDetails, ResourceReqDetails resourceDetails)
+			throws Exception {
+		// clean ES DB
+		DbUtils.cleanAllAudits();
+
+		// create resource
+		RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+
+		// validate response
+		AssertJUnit.assertNotNull("check response object is not null after create resource", restResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create resource",
+				restResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create resource", 201,
+				restResponse.getErrorCode().intValue());
+
+		return restResponse;
+	}
+
+	protected RestResponse TryUpdateByAnotherVerb(ResourceReqDetails updatedResourceDetails, User sdncModifierDetails,
+			String uri) throws Exception {
+		// delete resource
+		Config config;
+		RestResponse ResourceResponse;
+		try {
+			config = Utils.getConfig();
+			Map<String, String> headersMap = new HashMap<String, String>();
+			headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+			headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+			HttpRequest http = new HttpRequest();
+			String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(),
+					config.getCatalogBePort(), updatedResourceDetails.getName() + ".0.1");
+
+			if (uri == "GET") {
+				ResourceResponse = http.httpSendGet(url, headersMap);
+			} else if (uri == "POST") {
+				Gson gson = new Gson();
+				String userBodyJson = gson.toJson(updatedResourceDetails);
+				ResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
+			} else if (uri == "DELETE") {
+				ResourceResponse = http.httpSendDelete(url, headersMap);
+			} else
+				return null;
+
+			return ResourceResponse;
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		return null;
+
+	}
+
+	protected JSONObject JsonObjectBuilder(ResourceReqDetails resourceDetails) throws JSONException {
+		// json object: resourceName and icon are must
+		JSONObject jObject = new JSONObject();
+
+		List<String> tagsList = Arrays.asList(resourceDetails.getName());
+		List<String> derivedFromList = Arrays.asList("[tosca.nodes.Root]");
+
+		jObject.put("name", resourceDetails.getName());
+		jObject.put("description", "updatedDescription");
+		jObject.put("tags", tagsList);
+		jObject.put("category", ServiceCategoriesEnum.VOIP.getValue());
+		jObject.put("derivedFrom", derivedFromList);
+		jObject.put("vendorName", "newOracle");
+		jObject.put("vendorRelease", "1.5");
+		jObject.put("contactId", "jh0003");
+		jObject.put("icon", resourceDetails.getIcon());
+
+		return jObject;
+	}
+
+	protected JSONObject RemoveFromJsonObject(JSONObject jObject, String removedPropery) {
+		jObject.remove(removedPropery);
+
+		return jObject;
+	}
+
+	// purpose: function for controlling json body fields and validating
+	// response
+	protected void UpdateAndValidateWithIncompletedJsonBody(User sdncModifierDetails, JSONObject jsonObject,
+			String resourceId, String removedField, String errorMessage, List<String> variables) throws Exception {
+
+		JSONObject jObject = new JSONObject(jsonObject, JSONObject.getNames(jsonObject));
+		// remove description from jsonObject
+		jObject = RemoveFromJsonObject(jObject, removedField);
+		// update with incomplete body.
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(jObject.toString(),
+				sdncModifierDetails, resourceId);
+		// validate response
+		AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after update resource",
+				updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(errorMessage, variables, updatedRestResponse.getResponse());
+
+	}
+
+	// purpose: function for validating error response
+	protected void UpdateAndValidate(User sdncModifierDetails, ResourceReqDetails resourceDetails,
+			String recievedMessage, List<String> variables) throws Exception {
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, "0.1");
+		// validate response
+		AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after update resource",
+				updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(recievedMessage, variables, updatedRestResponse.getResponse());
+
+	}
+
+	protected void parseResponseAndValidateNonUpdatable(ResourceReqDetails resourceDetails, RestResponse restResponse)
+			throws Exception {
+		// parse response to javaObject
+		Resource updatedResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+		AssertJUnit.assertTrue(
+				!resourceDetails.getIsHighestVersion().equals(updatedResourceRespJavaObject.isHighestVersion()));
+		AssertJUnit.assertTrue(!resourceDetails.getVersion().equals(updatedResourceRespJavaObject.getName()));
+		AssertJUnit.assertTrue(!resourceDetails.getIsAbstract().equals(updatedResourceRespJavaObject.isAbstract()));
+		AssertJUnit.assertTrue(
+				!resourceDetails.getCreatorUserId().equals(updatedResourceRespJavaObject.getCreatorUserId()));
+		AssertJUnit.assertTrue(
+				!resourceDetails.getCreatorFullName().equals(updatedResourceRespJavaObject.getCreatorFullName()));
+		AssertJUnit.assertTrue(
+				!resourceDetails.getLastUpdateDate().equals(updatedResourceRespJavaObject.getLastUpdateDate()));
+		AssertJUnit
+				.assertTrue(!resourceDetails.getCreationDate().equals(updatedResourceRespJavaObject.getCreationDate()));
+		AssertJUnit.assertTrue(
+				!resourceDetails.getLastUpdaterUserId().equals(updatedResourceRespJavaObject.getLastUpdaterUserId()));
+		AssertJUnit.assertTrue(!resourceDetails.getLastUpdaterFullName()
+				.equals(updatedResourceRespJavaObject.getLastUpdaterFullName()));
+		AssertJUnit.assertTrue(
+				!resourceDetails.getLifecycleState().equals(updatedResourceRespJavaObject.getLifecycleState()));
+		AssertJUnit.assertTrue(!resourceDetails.getCost().equals(updatedResourceRespJavaObject.getCost()));
+		AssertJUnit
+				.assertTrue(!resourceDetails.getLicenseType().equals(updatedResourceRespJavaObject.getLicenseType()));
+		AssertJUnit.assertTrue(!resourceDetails.getUUID().equals(updatedResourceRespJavaObject.getUUID()));
+
+	}
+
+	protected void parseResponseAndValidate(ResourceReqDetails ResourceDetails, RestResponse restResponse)
+			throws Exception {
+		// parse response to javaObject
+		Resource updatedResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+		// validate request vs response
+		ResourceValidationUtils.validateResourceReqVsResp(ResourceDetails, updatedResourceRespJavaObject);
+	}
+
+	public ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ResourceReqDetails resourceDetails,
+			String resourceVersion) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+
+		expectedResourceAuditJavaObject.setAction("Checkout");
+		expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.ADMIN.getUserId());
+		expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.ADMIN.getUserName());
+		expectedResourceAuditJavaObject.setStatus("200.0");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName().toLowerCase());
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(resourceVersion) - 0.1f));
+		expectedResourceAuditJavaObject.setCurrVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public enum FieldToValidate {
+		contactId, Tags, VendorName, VendorRelease, Description
+	}
+
+	@Test
+	public void UpdateBy_postTest() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// update resource - without changing resourceName
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+
+		RestResponse updatedRestResponse = TryUpdateByAnotherVerb(updatedResourceDetails, sdncModifierDetails, "POST");
+
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(resourceDetails, getRestResponse);
+
+	}
+
+	@Test
+	public void UpdateBy_getTest() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// update resource - without changing resourceName
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		RestResponse updatedRestResponse = TryUpdateByAnotherVerb(updatedResourceDetails, sdncModifierDetails, "GET");
+
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(resourceDetails, getRestResponse);
+
+	}
+
+	@Test
+	public void UpdateBy_deleteTest() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// update resource - without changing resourceName
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		RestResponse updatedRestResponse = TryUpdateByAnotherVerb(updatedResourceDetails, sdncModifierDetails,
+				"DELETE");
+
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		RestResponse getRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(resourceDetails, getRestResponse);
+
+	}
+
+	// TODO DE
+	// @Ignore("")
+	@Test
+	public void UpdateWithInvaldJsonBodyTest() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
+		String resourceId = resourceDetails.getUniqueId();
+
+		// update Descirption value
+		String description = "updatedDescription";
+
+		// send update with incompleted json, only description string
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(description, sdncModifierDetails,
+				resourceId);
+
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("check error code after update resource", 400, updatedRestResponse.getErrorCode().intValue());
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(resourceDetails, getRestResponse);
+
+	}
+
+	// @Test
+	// public void UpdateResourceModifierNotOwnerStateTest() throws Exception {
+	//
+	//
+	// RestResponse restResponse = createResource(sdncModifierDetails,
+	// resourceDetails);
+	// String resourceName = resourceDetails.getName();
+	//
+	// // new user parameters
+	// String userFirstName = "Kot";
+	// String userLastName = "Matroskin";
+	// String role = "ADMIN";
+	// User sdncUserDetails = new User(userFirstName, userLastName,
+	// httpCspUserId, email, role,null);
+	// RestResponse deleteUserResponse = userUtils.deleteUser(sdncUserDetails,
+	// ElementFactory.getDefaultUser(UserRoleEnum.ADMIN));
+	//
+	// RestResponse createUserResponse = UserUtils.createUser(sdncUserDetails,
+	// ElementFactory.getDefaultUser(UserRoleEnum.ADMIN));
+	//
+	// User updatedSdncModifierDetails = new User(userFirstName, userLastName,
+	// httpCspUserId, email,role,null);
+	// ResourceReqDetails updatedResourceDetails =
+	// defineUpdatedResourse(resourceName);
+	// RestResponse updatedRestResponse =
+	// ResourceRestUtils.updateResource(updatedResourceDetails,
+	// updatedSdncModifierDetails, resourceDetails.getUniqueId(), "");
+	//
+	// // validate response
+	// assertNotNull("check response object is not null after update resource",
+	// updatedRestResponse);
+	// assertNotNull("check error code exists in response after update
+	// resource", updatedRestResponse.getErrorCode());
+	// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(),
+	// Empty_List, updatedRestResponse.getResponse());
+	//
+	// RestResponse getRestResponse =
+	// ResourceRestUtils.getResource(sdncModifierDetails,
+	// resourceDetails.getUniqueId());
+	// assertNotNull("check response object is not null after update resource",
+	// getRestResponse);
+	// parseResponseAndValidate(resourceDetails, getRestResponse);
+	//
+	//
+	// }
+
+	@Test
+	public void UpdateResourceNameSensitiveTest() throws Exception {
+		User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+		String resourceName = "Ab";
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		// Delete resources
+		RestResponse response = null;
+		response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
+				updatedResourceDetails.getName(), "0.1");
+		BaseRestUtils.checkDeleteResponse(response);
+		response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
+				updatedResourceDetails.getName(), "0.2");
+		BaseRestUtils.checkDeleteResponse(response);
+
+		RestResponse restResponse = createResource(sdncModifierDetails, updatedResourceDetails);
+		assertEquals("create resource failed", 201, restResponse.getErrorCode().intValue());
+
+		// check-in Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(updatedResourceDetails,
+				sdncModifierDetails, resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// String resourceCertifyVersion = "0.1";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(updatedResourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		updatedResourceDetails.setName("ABC_-bt.aT");
+		ArrayList<String> resourceTag = new ArrayList<String>();
+		resourceTag.add(0, "ABC_-bt.aT");
+		updatedResourceDetails.setTags(resourceTag);
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, updatedResourceDetails.getUniqueId(), "");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(updatedResourceDetails, updatedRestResponse);
+
+		// Delete resources
+		response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
+				updatedResourceDetails.getName(), "0.1");
+		BaseRestUtils.checkDeleteResponse(response);
+		response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
+				updatedResourceDetails.getName(), "0.2");
+		BaseRestUtils.checkDeleteResponse(response);
+
+	}
+
+	@Test
+	public void UpdateIcon_InegativeFlow() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		List<String> resourceList = new ArrayList<String>();
+		resourceList.add(0, "Resource");
+		// check InValid Characters
+		char[] notValidCharsArray = new char[59];
+		notValidCharsArray = getInValidChars();
+		// update metadata details
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		RestResponse updatedRestResponse;
+
+		for (int i = 0; i < notValidCharsArray.length; i++) {
+			// change icon of metadata
+			updatedResourceDetails.setIcon("MyIcon" + notValidCharsArray[i]);
+			// PUT request
+			updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+					resourceDetails.getUniqueId(), "");
+			// validate response
+			assertNotNull("check response object is not null after update resource", updatedRestResponse);
+			assertNotNull("check error code exists in response after update resource",
+					updatedRestResponse.getErrorCode());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_ICON.name(), resourceList,
+					updatedRestResponse.getResponse());
+			assertEquals("Check response code after updating resource icon", 400,
+					updatedRestResponse.getErrorCode().intValue());
+			assertEquals("Check response code after updating resource icon", "Bad Request",
+					updatedRestResponse.getResponseMessage().toString());
+
+		}
+
+		// empty icon
+		String updateIcon = "";
+		updatedResourceDetails.setIcon(updateIcon);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), resourceList,
+				updatedRestResponse.getResponse());
+
+		// Icon length more then 25 characters
+		resourceList.add(1, "25");
+		updatedResourceDetails.setIcon("1234567890_-qwertyuiopASDNNN");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT.name(), resourceList,
+				updatedRestResponse.getResponse());
+		assertEquals("Check response code after create resource", 400, updatedRestResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating resource icon", "Bad Request",
+				updatedRestResponse.getResponseMessage().toString());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResource_NoTagsEqualToResourceName() throws Exception {
+
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		ResourceReqDetails updatedResourceDetails = defineResourse();
+		updatedResourceDetails.setName("updatedResourceName");
+		List<String> tags = updatedResourceDetails.getTags();
+
+		for (Iterator<String> iter = tags.listIterator(); iter.hasNext();) {
+			String a = iter.next();
+			if (a.equals("updatedResourceName")) {
+				iter.remove();
+			}
+		}
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME.name(),
+				resourceList, updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource icon", 400,
+				updatedRestResponse.getErrorCode().intValue());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResourceName_negativeFlow() throws Exception {
+		// The validation are done in Tag's validation
+		User sdncAdminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		RestResponse updatedRestResponse;
+		RestResponse restResponse = createResource(sdncAdminModifierDetails, resourceDetails);
+		assertEquals("create resource failed", 201, restResponse.getErrorCode().intValue());
+		String uniqueId = resourceDetails.getUniqueId();
+		String resourceName = resourceDetails.getName();
+		// check InValid Characters
+		char[] notValidCharsArray = new char[59];
+		notValidCharsArray = getInValidChars();
+		ArrayList<String> resource_Name = new ArrayList<String>();
+		List<String> resourceList = new ArrayList<String>();
+
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceList.add(0, "Resource");
+
+		// update metadata details
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		for (int i = 0; i < notValidCharsArray.length; i++, resource_Name.clear()) {
+			if (i != 1 && i != 46
+					&& /*
+						 * i != 8 && i != 9 && i != 10 && i != 11 && i != 12 &&
+						 */ i != 31) // space ("") and dot(.)
+			{
+				// change resourceName parameter
+				updatedResourceDetails.setName("UpdatedResourceName" + notValidCharsArray[i]);
+				resource_Name.add("UpdatedResourceName" + notValidCharsArray[i]);
+				updatedResourceDetails.setTags(resource_Name);
+				updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+						sdncAdminModifierDetails, uniqueId, "");
+				// validate response
+				// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_TAG.name(),
+				// Empty_List, updatedRestResponse.getResponse());
+				ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPONENT_NAME.name(), resourceList,
+						updatedRestResponse.getResponse());
+
+			}
+		}
+
+		// resourceName length more then 50 characters
+		// Duplicate tags are allowed and should be de-duplicated by server side
+		resource_Name.add(resourceName);
+		resource_Name.add("tag1");
+		resource_Name.add("tag1");
+		resource_Name.add("tag2");
+		resource_Name.add("tag2");
+
+		resourceList.add(1, "1024");
+		// updatedResourceDetails.setName("123456789012345678901234567890123456789012345678901");
+		updatedResourceDetails.setName(new String(new char[1025]).replace("\0", "a"));
+		// resource_Name.add("123456789012345678901234567890123456789012345678901");
+		updatedResourceDetails.setTags(resource_Name);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncAdminModifierDetails,
+				uniqueId, "");
+		// validate response
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name(), resourceList,
+				updatedRestResponse.getResponse());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncAdminModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+		// delete resource
+		RestResponse response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncAdminModifierDetails,
+				updatedResourceDetails.getName(), "0.1");
+		BaseRestUtils.checkDeleteResponse(response);
+	}
+
+	@Test
+	public void UpdateResourceInformation_NotCheckedOut() throws Exception {
+
+		String resourceBaseVersion = "0.1";
+		List<String> resourceList = new ArrayList<String>();
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// CheckIn Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN); // NOT_CERTIFIED_CHECKIN
+		assertNotNull("check response object is not null after checkout resource", checkoutResource);
+		assertNotNull("check error code exists in response after checkIn resource", checkoutResource.getErrorCode());
+		assertEquals("Check response code after checkin resource", 200, checkoutResource.getErrorCode().intValue());
+
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), resourceList,
+				updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource icon", 409,
+				updatedRestResponse.getErrorCode().intValue());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResourceInformation_resourceVersion_11() throws Exception {
+
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), resourceList,
+				updatedRestResponse.getResponse());
+		// assertEquals("Check response code after updating resource icon", 409,
+		// updatedRestResponse.getErrorCode().intValue());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResourceInformation_resourceVersion_02() throws Exception {
+
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// String resourceCertifyVersion = "0.1";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after updating resource icon", 200,
+				updatedRestResponse.getErrorCode().intValue());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(updatedResourceDetails, getResourceRespJavaObject);
+
+		// delete resource
+		RestResponse response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
+				updatedResourceDetails.getName(), "0.1");
+		BaseRestUtils.checkDeleteResponse(response);
+		response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
+				updatedResourceDetails.getName(), "0.2");
+		BaseRestUtils.checkDeleteResponse(response);
+
+	}
+
+	@Test
+	public void UpdateResourceIcon_resourceVersion_11() throws Exception {
+		// Can be changed only if major version is "0".
+
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// ResourceReqDetails updatedResourceDetails =
+		// defineUpdatedResourse(resourceName);
+		ResourceReqDetails updatedResourceDetails = defineResourse();
+		// updatedResourceDetails.setVendorName("updatedVandorName");
+		updatedResourceDetails.setIcon("updatedIcon");
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_ICON_CANNOT_BE_CHANGED.name(), resourceList,
+				updatedRestResponse.getResponse());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResourceVandorName_resourceVersion_11() throws Exception {
+		// Can be changed only if the major resource version is "0".
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// ResourceReqDetails updatedResourceDetails =
+		// defineUpdatedResourse(resourceName);
+		ResourceReqDetails updatedResourceDetails = defineResourse();
+
+		updatedResourceDetails.setVendorName("updatedVandorName");
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED.name(),
+				resourceList, updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource icon", 400,
+				updatedRestResponse.getErrorCode().intValue());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResourceName_resourceVersion_11() throws Exception {
+		// Can be changed only if the major resource version is "0".
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("create resource failed", 201, restResponse.getErrorCode().intValue());
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		/*
+		 * //ResourceReqDetails updatedResourceDetails =
+		 * defineUpdatedResourse(resourceName); ResourceReqDetails
+		 * updatedResourceDetails = defineResourse();
+		 * 
+		 * updatedResourceDetails.setResourceName("updatedResourceName");
+		 * updatedResourceDetails.setIcon("updatedResourceName");
+		 */
+		resourceDetails.setName("updatedResourceName");
+		List<String> tagList = new ArrayList<String>();
+		tagList.add(0, "updatedResourceName");
+		resourceDetails.setTags(tagList);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NAME_CANNOT_BE_CHANGED.name(), resourceList,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResourceTag_resourceVersion_11() throws Exception {
+		// Tag Can be updated when major version is "0".
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// ResourceReqDetails updatedResourceDetails =
+		// defineUpdatedResourse(resourceName);
+		ResourceReqDetails updatedResourceDetails = defineResourse();
+		// updatedResourceDetails.setVendorName("updatedVandorName");
+
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add("NewTag");
+		resourceTags.add(resourceDetails.getName());
+
+		updatedResourceDetails.setTags(resourceTags);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(updatedResourceDetails, getRestResponse);
+
+	}
+
+	@Test
+	public void UpdateAllowedParames_resourceVersion_11() throws Exception {
+
+		// Tag, contactId, vendorRelease,tags And description - Can be also
+		// updated when major version is NOT "0".
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// ResourceReqDetails updatedResourceDetails =
+		// defineUpdatedResourse(resourceName);
+		ResourceReqDetails updatedResourceDetails = defineResourse();
+		// updatedResourceDetails.setVendorName("updatedVandorName");
+
+		// updated allowed parameters when major resource version is NOT "0"
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add("NewTag");
+		resourceTags.add(resourceDetails.getName());
+		updatedResourceDetails.setTags(resourceTags);
+		updatedResourceDetails.setDescription("UpdatedDescription");
+		updatedResourceDetails.setVendorRelease("5.1");
+		updatedResourceDetails.setContactId("bt750h");
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(updatedResourceDetails, getRestResponse);
+
+	}
+
+	@Test
+	public void UpdateResourceDerivedFrom_resourceVersion_11() throws Exception {
+		// DerivedFrom parameter - Can be updated when major version is "0".
+		User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		String resourceBaseVersion = "0.1";
+
+		// create resource
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String resourceName = resourceDetails.getName();
+
+		// resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
+		// restResponse);
+
+		// Certify Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
+				resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		String resourceCertifyVersion = "1.0";
+		logger.debug("Changing resource life cycle ");
+		checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// ResourceReqDetails updatedResourceDetails =
+		// defineUpdatedResourse(resourceName);
+		ResourceReqDetails updatedResourceDetails = defineResourse();
+		ArrayList<String> drivenFrom = new ArrayList<String>();
+		drivenFrom.add(0, "tosca.nodes.Container.Application");
+		updatedResourceDetails.setDerivedFrom(drivenFrom);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		ResourceRestUtils.checkSuccess(updatedRestResponse);
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+	}
+
+	@Test
+	public void UpdateResource_vendorNameValidation() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		String updatedVendorName = "";
+		String uniqueId = resourceDetails.getUniqueId();
+		resourceDetails.setVendorName(updatedVendorName);
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, uniqueId, "");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		// update resource vendorName metadata: 1 characters
+		updatedVendorName = "	";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		// update resource vendorName metadata: 25 characters
+		updatedVendorName = "Verification and validati";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// update resource vendorName metadata: 26 characters
+		updatedVendorName = "Verification and validatii";
+		// set vendorName
+		List<String> myList = new ArrayList<String>();
+		myList.add(0, "25");
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		// update resource VendorRelease metadata: forbidden characters
+		updatedVendorName = "A1<";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1>";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1:";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1\"";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1/";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1\\";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1|";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1?";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorName = "A1*";
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		// update resource vendorName metadata: null
+		updatedVendorName = null;
+		// set vendorName
+		resourceDetails.setVendorName(updatedVendorName);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResource_vendorReleaseValidation() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		RestResponse updatedRestResponse;
+		String uniqueId = resourceDetails.getUniqueId();
+		String updatedVendorRelease;
+		// set VendorRelease
+
+		// update resource VendorRelease metadata: 1 characters
+		updatedVendorRelease = "1";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// update resource VendorRelease metadata: 25 characters
+		updatedVendorRelease = "(!#1.00000000000000000000";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// update resource VendorRelease metadata: 26 characters
+		updatedVendorRelease = "(!#1.000000000000000000005";// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT.name(),
+				Arrays.asList("" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH), updatedRestResponse.getResponse());
+
+		// UpdateAndValidate(sdncModifierDetails, resourceDetails,
+		// ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT.name(),
+		// Arrays.asList(""+ValidationUtils.VENDOR_RELEASE_MAX_LENGTH));
+
+		// update resource VendorRelease metadata: forbidden characters
+		updatedVendorRelease = "A1<";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1>";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1:";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1\"";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1/";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1\\";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1|";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1?";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		updatedVendorRelease = "A1*";
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		// update resource VendorRelease metadata: null
+		updatedVendorRelease = null;
+		// set VendorRelease
+		resourceDetails.setVendorRelease(updatedVendorRelease);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_RELEASE.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResource_contactIdValidation() throws Exception { // [a-zA-Z]{2}[0-9]{3}[a-zA-Z0-9]{1}
+																			// (6
+																			// characters
+																			// now,
+																			// may
+																			// be
+																			// expanded
+																			// up
+																			// to
+																			// 8
+																			// characters
+																			// in
+																			// the
+																			// future).
+																			// Convert
+																			// Upper
+																			// case
+																			// character
+																			// to
+																			// lower
+																			// case
+		RestResponse updatedRestResponse;
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		String uniqueId = resourceDetails.getUniqueId();
+
+		List<String> myList = new ArrayList<String>();
+		myList.add(0, "Resource");
+		String updatedcontactId = "";
+		resourceDetails.setContactId(updatedcontactId);
+
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "ab12345";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "      ";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "ab 50h";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "ab123c";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		updatedcontactId = "cd789E";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+
+		resourceDetails.setContactId(updatedcontactId.toLowerCase());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		updatedcontactId = "ef4567";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		updatedcontactId = "AA012A";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+
+		resourceDetails.setContactId(updatedcontactId.toLowerCase());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		updatedcontactId = "CD012c";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+
+		resourceDetails.setContactId(updatedcontactId.toLowerCase());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		updatedcontactId = "EF0123";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+
+		resourceDetails.setContactId(updatedcontactId.toLowerCase());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		////////////////////////////// **************//////////////////////////////
+		List<String> resource = Arrays.asList("Resource");
+		updatedcontactId = "01345a";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "0y000B";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "Y1000b";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "abxyzC";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "cdXYZc";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "efXY1D";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "EFabcD";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "EFABCD";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "EFABC1";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "efui1D";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "efui1!";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "ef555!";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = ",f555";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		updatedcontactId = "EF55.5";
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		// update resource contactId metadata: extended character set (128–255)
+		resourceDetails.setContactId(extendedCharsStringBuilder());
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+		// update resource contactId metadata: null
+		updatedcontactId = null;
+		resourceDetails.setContactId(updatedcontactId);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), myList,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResource_TagsFieldValidation() throws Exception {
+		RestResponse updatedRestResponse;
+		// define and create resource
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		String uniqueId = resourceDetails.getUniqueId();
+
+		String updatedTagField = "";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(updatedTagField);
+		// set description
+		resourceDetails.setTags(resourceTags);
+		List<String> variables = Arrays.asList("Resource", "tag");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
+				updatedRestResponse.getResponse());
+
+		// update resource tags metadata: empty
+		resourceTags = new ArrayList<String>();
+		// set Tags
+		resourceDetails.setTags(resourceTags);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_TAGS.name(), Empty_List,
+				updatedRestResponse.getResponse());
+
+		// update resource description metadata: 1 characters
+		updatedTagField = "A";
+		resourceTags = new ArrayList<String>();
+		resourceTags.add(updatedTagField);
+		resourceTags.add(resourceDetails.getName());
+		// set description
+		resourceDetails.setTags(resourceTags);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// OK - tag up to 50 chars
+		updatedTagField = "The Indian-crested.porcupine_The Indian cresteddds";
+		resourceTags.add(updatedTagField);
+		resourceDetails.setTags(resourceTags);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// OK - sum is 1024, 50x20+48+20(commas)+6(cisco4 - resource name)
+		String updatedTagField1 = "The Indian-crested.porcupine_The Indian crestedd01";
+		String updatedTagField2 = "The Indian-crested.porcupine_The Indian crestedd02";
+		String updatedTagField3 = "The Indian-crested.porcupine_The Indian crestedd03";
+		String updatedTagField4 = "The Indian-crested.porcupine_The Indian crestedd04";
+		String updatedTagField5 = "The Indian-crested.porcupine_The Indian crestedd05";
+		String updatedTagField6 = "The Indian-crested.porcupine_The Indian crestedd06";
+		String updatedTagField7 = "The Indian-crested.porcupine_The Indian crestedd07";
+		String updatedTagField8 = "The Indian-crested.porcupine_The Indian crestedd08";
+		String updatedTagField9 = "The Indian-crested.porcupine_The Indian crestedd09";
+		String updatedTagField10 = "The Indian-crested.porcupine_The Indian crestedd10";
+		String updatedTagField11 = "The Indian-crested.porcupine_The Indian crestedd11";
+		String updatedTagField12 = "The Indian-crested.porcupine_The Indian crestedd12";
+		String updatedTagField13 = "The Indian-crested.porcupine_The Indian crestedd13";
+		String updatedTagField14 = "The Indian-crested.porcupine_The Indian crestedd14";
+		String updatedTagField15 = "The Indian-crested.porcupine_The Indian crestedd15";
+		String updatedTagField16 = "The Indian-crested.porcupine_The Indian crestedd16";
+		String updatedTagField17 = "The Indian-crested.porcupine_The Indian crestedd17";
+		String updatedTagField18 = "The Indian-crested.porcupine_The Indian crestedd18";
+		String updatedTagField19 = "The Indian-crested.porcupine_The Indian crestaa";
+
+		resourceTags = new ArrayList<String>();
+		resourceTags.add(updatedTagField);
+		resourceTags.add(updatedTagField1);
+		resourceTags.add(updatedTagField2);
+		resourceTags.add(updatedTagField3);
+		resourceTags.add(updatedTagField4);
+		resourceTags.add(updatedTagField5);
+		resourceTags.add(updatedTagField6);
+		resourceTags.add(updatedTagField7);
+		resourceTags.add(updatedTagField8);
+		resourceTags.add(updatedTagField9);
+		resourceTags.add(updatedTagField10);
+		resourceTags.add(updatedTagField11);
+		resourceTags.add(updatedTagField12);
+		resourceTags.add(updatedTagField13);
+		resourceTags.add(updatedTagField14);
+		resourceTags.add(updatedTagField15);
+		resourceTags.add(updatedTagField16);
+		resourceTags.add(updatedTagField17);
+		resourceTags.add(updatedTagField18);
+		resourceTags.add(updatedTagField19);
+		resourceTags.add(resourceDetails.getName());
+		// set description
+		resourceDetails.setTags(resourceTags);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// Add another tag-exceeds limit
+		resourceTags.add("d");
+		resourceDetails.setTags(resourceTags);
+		ArrayList<String> myArray = new ArrayList<String>();
+		myArray.add(0, "1024");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT.name(), myArray,
+				updatedRestResponse.getResponse());
+
+		// Tag exceeds limit - 51
+		resourceTags = new ArrayList<String>();
+		updatedTagField = "The Indian-crested.porcupine_The Indian crestedddsw";
+		resourceTags.add(updatedTagField);
+		resourceTags.add(resourceDetails.getName());
+		// set description
+		resourceDetails.setTags(resourceTags);
+		myArray.remove(0);
+		myArray.add(0, "50");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name(), myArray,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResource_DesriptionFieldValidation() throws Exception {
+		// define and create resource
+		RestResponse updatedRestResponse;
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		String uniqueId = resourceDetails.getUniqueId();
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		List<String> resource = new ArrayList<>();
+		resource.add("Resource");
+		// update resource description metadata: 0 characters
+		String updatedDescription = "";
+		// set description
+		resourceDetails.setDescription(updatedDescription);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), resource,
+				updatedRestResponse.getResponse());
+
+		// update resource description metadata: null
+		updatedDescription = null;
+		// set description
+		resourceDetails.setDescription(updatedDescription);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), resource,
+				updatedRestResponse.getResponse());
+
+		// update resource description metadata: 1 characters
+		updatedDescription = "A";
+		// set description
+		resourceDetails.setDescription(updatedDescription);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// update resource description metadata: 1024 characters
+		updatedDescription = "The Indian crested porcupine *{Hystrix indica}*, or Indian porcupine is a member of the Old World porcupines."
+				+ "It is quite an adaptable rodent, found throughout southern Asia and the Middle East."
+				+ "It is tolerant of several different habitats: mountains, tropical and subtropical grasslands, scrublands, and forests."
+				+ "It is a large rodent, growing more than 0.9 m = (3 ft) long and weighing 14.5 kg = (32 lb)! [citation needed] It is covered in multiple layers of quills."
+				+ "The longest quills grow from its shoulders to about a third of the animal's length."
+				+ "Its tail is covered in short, hollow quills that can rattle when threatened."
+				+ "It has broad feet and long claws for digging. When attacked, the Indian crested porcupine raises its quills and rattles the hollow quills on its tail."
+				+ "If the predator persists past these threats, the porcupine launches a backwards assault, hoping to stab its attacker with its quills."
+				+ "It does this so effectively that most brushes between predators and the Indian porcupine end in death or severe injury";
+		// set description
+		resourceDetails.setDescription(updatedDescription);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		parseResponseAndValidate(resourceDetails, updatedRestResponse);
+
+		// update resource description metadata: 1025 characters
+		updatedDescription = "The Indian crested porcupine *{Hystrix indica}*, or Indian porcupine is a member of the Old World porcupines."
+				+ "It is quite an adaptable rodent, found throughout southern Asia and the Middle East."
+				+ "It is tolerant of several different habitats: mountains, tropical and subtropical grasslands, scrublands, and forests."
+				+ "It is a large rodent, growing more than 0.9 m = (3 ft) long and weighing 14.5 kg = (32 lb)! [citation needed] It is covered in multiple layers of quills."
+				+ "The longest quills grow from its shoulders to about a third of the animal's length."
+				+ "Its tail is covered in short, hollow quills that can rattle when threatened."
+				+ "It has broad feet and long claws for digging. When attacked, the Indian crested porcupine raises its quills and rattles the hollow quills on its tail."
+				+ "If the predator persists past these threats, the porcupine launches a backwards assault, hoping to stab its attacker with its quills."
+				+ "It does this so effectively that most brushes between predators and the Indian porcupine end in death or severe injury.";
+		// set description
+		resourceDetails.setDescription(updatedDescription);
+		resource.add(1, "1024");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
+				"");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT.name(), resource,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResource_TagsFormatValidation() throws Exception {
+		char[] notValidCharsArray = getTagInValidFormatChars();
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check recourse created ", 201, restResponse.getErrorCode().intValue());
+		String resourceName = resourceDetails.getName();
+
+		// update tag details
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		ArrayList<String> resourceTags = new ArrayList<String>();
+
+		String updatedTagField;
+		RestResponse updatedRestResponse;
+		List<String> variables = Arrays.asList("Resource", "tag");
+
+		for (int i = 0; i < notValidCharsArray.length; i++) {
+			updatedTagField = "UpdatedTag" + notValidCharsArray[i];
+			resourceTags = new ArrayList<String>();
+			resourceTags.add(updatedTagField);
+			resourceTags.add(resourceDetails.getName());
+			// set description
+			updatedResourceDetails.setTags(resourceTags);
+
+			updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+					resourceDetails.getUniqueId(), "");
+			// validate response
+			assertNotNull("check response object is not null after update resource", updatedRestResponse);
+			assertNotNull("check error code exists in response after update resource",
+					updatedRestResponse.getErrorCode());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
+					updatedRestResponse.getResponse());
+			assertEquals("Check response code after updating resource icon", 400,
+					updatedRestResponse.getErrorCode().intValue());
+			assertEquals("Check response code after updating resource icon", "Bad Request",
+					updatedRestResponse.getResponseMessage().toString());
+
+		}
+
+	}
+
+	@Test
+	public void UpdateResourceCategory_negativeFlow() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after update resource", 201, restResponse.getErrorCode().intValue());
+		Resource resourceBeforeUpdate = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		String uniqueID = resourceDetails.getUniqueId();
+
+		// Update resource Category Successfully
+		ResourceReqDetails updatedResourceDetails = resourceDetails;
+
+		updatedResourceDetails.removeAllCategories();
+		updatedResourceDetails.addCategoryChain(ServiceCategoriesEnum.MOBILITY.getValue(),
+				ResourceCategoryEnum.APPLICATION_L4_DATABASE.getSubCategory());
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+
+		// validate response
+		List<String> resourceList = new ArrayList<String>();
+		resourceList.add(0, "Resource");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CATEGORY.name(), resourceList,
+				updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource", 400, updatedRestResponse.getErrorCode().intValue());
+
+		// Updating resource category
+		updatedResourceDetails = defineUpdateResourceWithNonUpdatableFields(resourceBeforeUpdate);
+		updatedResourceDetails.addCategory("");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		// validate response
+		resourceList = new ArrayList<String>();
+		resourceList.add(0, "Resource");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), resourceList,
+				updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource", 400, updatedRestResponse.getErrorCode().intValue());
+
+		// Updating resource category
+		updatedResourceDetails = defineUpdateResourceWithNonUpdatableFields(resourceBeforeUpdate);
+		updatedResourceDetails.addCategory("XXXXXX");
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		// validate response
+		resourceList = new ArrayList<String>();
+		resourceList.add(0, "Resource");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CATEGORY.name(), resourceList,
+				updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource", 400, updatedRestResponse.getErrorCode().intValue());
+
+		// CheckIn Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN); // NOT_CERTIFIED_CHECKIN
+		assertEquals("Check response code after checkin resource", 200, checkoutResource.getErrorCode().intValue());
+
+		// Update resource Category
+		updatedResourceDetails = defineUpdateResourceWithNonUpdatableFields(resourceBeforeUpdate);
+		updatedResourceDetails.addCategory(ServiceCategoriesEnum.VOIP.getValue());
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		// verify response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), Empty_List,
+				updatedRestResponse.getResponse());
+		assertEquals("Check response code after updating resource", 409, updatedRestResponse.getErrorCode().intValue());
+
+		// CheckIn Resource
+		logger.debug("Changing resource life cycle ");
+		RestResponse checkinResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT); // NOT_CERTIFIED_CHECKIN
+		assertNotNull("check response object is not null after checkout resource", checkoutResource);
+		assertNotNull("check error code exists in response after checkIn resource", checkoutResource.getErrorCode());
+		assertEquals("Check response code after checkin resource", 200, checkoutResource.getErrorCode().intValue());
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails, uniqueID);
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(resourceDetails, getRestResponse);
+
+	}
+
+	@Test
+	public void UpdateResourceCategorySuccessfully() throws Exception {
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after update resource", 201, restResponse.getErrorCode().intValue());
+		Resource resourceBeforeUpdate = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		// Update resource Category Successfully
+		ResourceReqDetails updatedResourceDetails = resourceDetails;
+
+		updatedResourceDetails.removeAllCategories();
+		updatedResourceDetails.addCategoryChain(ResourceCategoryEnum.APPLICATION_L4_DATABASE.getCategory(),
+				ResourceCategoryEnum.APPLICATION_L4_DATABASE.getSubCategory());
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncModifierDetails, resourceDetails.getUniqueId(), "");
+
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
+		// parseResponseAndValidateNonUpdatable(updatedResourceDetails,
+		// updatedRestResponse);
+		parseResponseAndValidate(updatedResourceDetails, updatedRestResponse);
+
+		// validate category updated
+		assertTrue(updatedResourceDetails.getCategories().get(0).getName()
+				.equals(ResourceCategoryEnum.APPLICATION_L4_DATABASE.getCategory()));
+
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
+				resourceDetails.getUniqueId());
+		assertNotNull("check response object is not null after update resource", getRestResponse);
+		parseResponseAndValidate(updatedResourceDetails, getRestResponse);
+
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, updatedResourceDetails.getName(), "0.1");
+	}
+
+	// Benny
+
+	@Test
+	public void Validation_UpdateIcon() throws Exception {
+		// Fields to update (Forbidden)
+		String _updatedIcon = "mySecondIcon.Jpg";
+
+		// administrator permissions
+		User sdncAdminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// define and create resource
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncAdminModifierDetails, resourceDetails.getName(), "0.1");
+
+		RestResponse restResponse = createResource(sdncAdminModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		String resourceName = resourceDetails.getName();
+
+		// update metadata details
+		ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
+		// change icon of metadata
+		updatedResourceDetails.setIcon(_updatedIcon);
+		// PUT request
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
+				sdncAdminModifierDetails, resourceDetails.getUniqueId(), "");
+
+		// validate response
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_ICON.name(),
+				Arrays.asList("Resource"), updatedRestResponse.getResponse());
+
+		// empty icon
+		_updatedIcon = "";
+		updatedResourceDetails.setIcon(_updatedIcon);
+		updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncAdminModifierDetails,
+				resourceDetails.getUniqueId(), "");
+		assertNotNull("check response object is not null after update resource", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(),
+				Arrays.asList("Resource"), updatedRestResponse.getResponse());
+
+		// get resource with original name. original metadata should be returned
+		RestResponse getRestResponse = ResourceRestUtils.getResource(sdncAdminModifierDetails,
+				resourceDetails.getUniqueId());
+		// validate response
+		assertNotNull("check response object is not null after get resource", getRestResponse);
+		assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
+
+		// parse updated response to javaObject
+		Resource getResourceRespJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(getRestResponse.getResponse());
+		// validate that metadata was not changed
+		ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
+
+		ResourceRestUtils.deleteResourceByNameAndVersion(sdncAdminModifierDetails, updatedResourceDetails.getName(),
+				"0.1");
+
+	}
+
+	@Test
+	public void UpdateResourceTypeSuccess() throws Exception {
+		// LCS is CheckOut
+		String newResourceType = ResourceTypeEnum.VL.toString();
+		String currentResourceType = resourceDetails.getResourceType();
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		Resource currentResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		resourceDetails.setResourceType(newResourceType);
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
+		assertEquals("Check response code after create resource", 200, updatedRestResponse.getErrorCode().intValue());
+		Resource updatedResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(updatedRestResponse.getResponse());
+		// assertTrue("Check resource type after update resource",
+		// updatedResourceJavaObject.getResourceType().toString().equals(resourceType));
+		assertTrue("Check resource type after update resource",
+				updatedResourceJavaObject.getResourceType().toString().equals(currentResourceType));
+
+	}
+
+	@Test
+	public void UpdateResourceTypeAndNameSuccess() throws Exception {
+		// LCS is CheckOut
+		String newResourceType = ResourceTypeEnum.VL.toString();
+		String currentResourceType = resourceDetails.getResourceType();
+		String newResourceName = "new Name";
+
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		Resource currentResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		resourceDetails.setResourceType(newResourceType);
+		resourceDetails.setName(newResourceName);
+		List<String> tags = resourceDetails.getTags();
+		tags.add(newResourceName);
+		resourceDetails.setTags(tags);
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
+		assertEquals("Check response code after create resource", 200, updatedRestResponse.getErrorCode().intValue());
+		Resource updatedResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(updatedRestResponse.getResponse());
+		assertTrue("Check resource type after update resource",
+				updatedResourceJavaObject.getResourceType().toString().equals(currentResourceType));
+		assertTrue("Check resource name after update resource",
+				updatedResourceJavaObject.getName().equals(newResourceName));
+
+	}
+
+	@Test
+	public void UpdateResourceTypeAfterResourceCertification() throws Exception {
+
+		String newResourceType = ResourceTypeEnum.VF.toString();
+		String currentResourceType = resourceDetails.getResourceType();
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		Resource currentResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		resourceDetails.setResourceType(newResourceType);
+		restResponse = LifecycleRestUtils.certifyResource(resourceDetails);
+		assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
+		currentResourceJavaObject = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
+		assertEquals("Check response code after create resource", 200, updatedRestResponse.getErrorCode().intValue());
+		Resource updatedResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(updatedRestResponse.getResponse());
+		// assertTrue("Check resource type after update resource",
+		// updatedResourceJavaObject.getResourceType().toString().equals(newResourceType));
+		assertTrue("Check resource type after update resource",
+				updatedResourceJavaObject.getResourceType().toString().equals(currentResourceType));
+
+	}
+
+	@Test
+	public void UpdateResourceTypeCheckInLCS() throws Exception {
+
+		String resourceType = ResourceTypeEnum.VL.toString();
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		Resource currentResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		resourceDetails.setResourceType(resourceType);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
+
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+
+		assertNotNull("check response object is not null after create resouce", updatedRestResponse);
+		assertNotNull("check error code exists in response after create resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(),
+				updatedRestResponse.getErrorCode());
+
+		List<String> variables = new ArrayList<>();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResourceTypeCertifiedLCS() throws Exception {
+
+		String resourceType = ResourceTypeEnum.VL.toString();
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		Resource currentResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		restResponse = LifecycleRestUtils.certifyResource(resourceDetails);
+		assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
+
+		resourceDetails.setResourceType(resourceType);
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+
+		assertNotNull("check response object is not null after create resouce", updatedRestResponse);
+		assertNotNull("check error code exists in response after create resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(),
+				updatedRestResponse.getErrorCode());
+
+		List<String> variables = new ArrayList<>();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				updatedRestResponse.getResponse());
+
+	}
+
+	@Test
+	public void UpdateResourceTypeInvalidType() throws Exception {
+
+		String resourceType = "INVALID TYPE";
+		RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
+		assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
+		Resource currentResourceJavaObject = ResponseParser
+				.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		resourceDetails.setResourceType(resourceType);
+		RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
+				sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
+
+		assertNotNull("check response object is not null after update resouce", updatedRestResponse);
+		assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
+		assertEquals("Check response code after update resource", errorInfo.getCode(),
+				updatedRestResponse.getErrorCode());
+
+		List<String> variables = new ArrayList<>();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
+				updatedRestResponse.getResponse());
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java
new file mode 100644
index 0000000..5905010
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java
@@ -0,0 +1,481 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
+public class VFResourceInstanceNameCRUD extends ComponentBaseTest {
+
+	protected static ServiceReqDetails serviceDetails;
+	protected static ResourceReqDetails resourceDetailsVFC;
+	protected static ResourceReqDetails resourceDetailsVL;
+	protected static ResourceReqDetails resourceDetailsVF;
+	protected static ResourceReqDetails resourceDetailsCP;
+	protected static ComponentInstanceReqDetails resourceInstanceReqDetailsVF;
+	protected static ComponentInstanceReqDetails resourceInstanceReqDetailsVFC;
+	protected static ComponentInstanceReqDetails resourceInstanceReqDetailsVL;
+	protected static ComponentInstanceReqDetails resourceInstanceReqDetailsCP;
+	protected static User sdncDesignerDetails1;
+	protected static User sdncTesterDeatails1;
+	protected static User sdncAdminDetails1;
+	protected static ArtifactReqDetails heatArtifactDetails;
+	protected static ArtifactReqDetails defaultArtifactDetails;
+	protected static int maxLength = 50;
+	protected static Resource resourceVF = null;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public VFResourceInstanceNameCRUD() {
+		super(name, VFResourceInstanceNameCRUD.class.getName());
+	}
+
+	@BeforeMethod
+
+	public void init() throws Exception {
+
+		// serviceDetails = ElementFactory.getDefaultService();
+		// resourceDetailsVFC =
+		// ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VFC.toString(),
+		// "resourceVFC");
+		// resourceDetailsVF =
+		// ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF.toString(),
+		// "resourceVF3");
+		// resourceDetailsVL =
+		// ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VL.toString(),
+		// "resourceVL");
+		// resourceDetailsCP =
+		// ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CP.toString(),
+		// "resourceCP");
+		sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// heatArtifactDetails =
+		// ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+
+		Either<Resource, RestResponse> resourceDetailsCP_01e = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsCP_01e.left().value(), UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CHECKIN, true);
+		resourceDetailsCP = new ResourceReqDetails(resourceDetailsCP_01e.left().value());
+		Either<Resource, RestResponse> resourceDetailsVL_01e = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsVL_01e.left().value(), UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CHECKIN, true);
+		resourceDetailsVL = new ResourceReqDetails(resourceDetailsVL_01e.left().value());
+		Either<Resource, RestResponse> resourceDetailsVF_01e = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF = new ResourceReqDetails(resourceDetailsVF_01e.left().value());
+		Either<Resource, RestResponse> resourceDetailsVFC_01e = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFC_01e.left().value(), UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CHECKIN, true);
+		resourceDetailsVFC = new ResourceReqDetails(resourceDetailsVFC_01e.left().value());
+
+		resourceInstanceReqDetailsVFC = ElementFactory.getDefaultComponentInstance("VFC", resourceDetailsVFC);
+		resourceInstanceReqDetailsVF = ElementFactory.getDefaultComponentInstance("VF", resourceDetailsVF);
+		resourceInstanceReqDetailsVL = ElementFactory.getDefaultComponentInstance("VL", resourceDetailsVL);
+		resourceInstanceReqDetailsCP = ElementFactory.getDefaultComponentInstance("CP", resourceDetailsCP);
+		sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+	}
+
+	@Test
+	public void addResourceInstanceToVF() throws Exception {
+
+		createVFWithCertifiedResourceInstance(resourceDetailsCP, resourceInstanceReqDetailsCP);
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 1");
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	@Test
+	public void updateResourceInstanceName() throws Exception {
+
+		// update resource instance name
+		String resourceInstanceUpdatedName = "resource New 2";
+
+		ResourceReqDetails updatedResourceDetailsVLC = changeResouceName(resourceDetailsVFC,
+				resourceInstanceUpdatedName);
+		createVFWithCertifiedResourceInstance(updatedResourceDetailsVLC, resourceInstanceReqDetailsVFC);
+
+		resourceInstanceReqDetailsVFC.setName(resourceInstanceUpdatedName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetailsVFC, sdncDesignerDetails1, resourceVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		assertTrue(updateResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceUpdatedName);
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	@Test
+	public void updateResourceInstanceNameToNextGeneratedName() throws Exception {
+
+		// update resource instance name
+		String resourceInstanceUpdatedName = resourceInstanceReqDetailsCP.getName() + " 2";
+
+		ResourceReqDetails updatedResourceDetailsVL = changeResouceName(resourceDetailsVL, resourceInstanceUpdatedName);
+		createVFWithCertifiedResourceInstance(updatedResourceDetailsVL, resourceInstanceReqDetailsVL);
+		resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
+
+		// add second resource instance
+		RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
+				sdncDesignerDetails1, resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	@Test
+	public void normolizeUpdatedResourceInstanceName() throws Exception {
+
+		String resourceInstanceUpdatedName = "resource   new -  .2";
+		String normalizedName = "resourcenew2";
+
+		ResourceReqDetails updatedResourceDetailsVL = changeResouceName(resourceDetailsVL, resourceInstanceUpdatedName);
+
+		createVFWithCertifiedResourceInstance(updatedResourceDetailsVL, resourceInstanceReqDetailsVL);
+		// update resource instance name
+		resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
+
+		// add second resource instance
+		RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
+				sdncDesignerDetails1, resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	@Test
+	public void updatedResourceInstanceNameToEmpty() throws Exception {
+
+		createVFWithCertifiedResourceInstance(resourceDetailsVL, resourceInstanceReqDetailsVL);
+		String resourceInstanceUpdatedName = "";
+		String resourceInstancePreviousName = resourceDetailsCP.getName();
+
+		// add second resource instance
+		RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
+				sdncDesignerDetails1, resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails1, resourceVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code after RI update request", 200,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+		// change request
+		// ErrorInfo errorInfo =
+		// Utils.parseYaml(ActionStatus.MISSING_COMPONENT_NAME.name());
+		// utils.validateResponseCode(updateResourceInstanceResponse,
+		// errorInfo.getCode(), "update resource instance");
+		//
+		// List<String> variables = Arrays.asList("Resource Instance");
+		// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_COMPONENT_NAME.name(),
+		// variables, updateResourceInstanceResponse.getResponse());
+
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
+		resourceInstanceExpectedListName.add(resourceInstancePreviousName + " 3");
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	@Test
+	public void updatedResourceNameLengthExceedMaximumCharacters() throws Exception {
+
+		String resourceInstancePreviousName = resourceDetailsCP.getName();
+		// update resource instance name
+		String resourceInstanceUpdatedName = "a";
+		for (int i = 0; i < maxLength; i++) {
+			resourceInstanceUpdatedName += "b";
+		}
+		// ResourceReqDetails updatedResourceDetailsVL =
+		// changeResouceName(resourceDetailsVL, resourceInstanceUpdatedName);
+
+		createVFWithCertifiedResourceInstance(resourceDetailsVL, resourceInstanceReqDetailsVL);
+		// add second resource instance
+		RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
+				sdncDesignerDetails1, resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		String prevName = resourceInstanceReqDetailsCP.getName();
+		resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails1, resourceVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name());
+		// utils.validateResponseCode(updateResourceInstanceResponse,
+		// errorInfo.getCode(), "update resource instance");
+
+		List<String> variables = Arrays.asList("Resource Instance", "50");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name(), variables,
+				updateResourceInstanceResponse.getResponse());
+
+		resourceInstanceReqDetailsCP.setName(prevName);
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	@Test
+	public void updatedResourceNameWithUnSupportedCharacters() throws Exception {
+
+		createVFWithCertifiedResourceInstance(resourceDetailsVL, resourceInstanceReqDetailsVL);
+		String resourceInstancePreviousName = resourceDetailsCP.getName();
+		// update resource instance name
+		String resourceInstanceUpdatedName = "a???<>";
+
+		// add second resource instance
+		RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
+				sdncDesignerDetails1, resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		String prevValue = resourceInstanceReqDetailsCP.getName();
+		resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails1, resourceVF.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_COMPONENT_NAME.name());
+		// ResourceRestUtils.validateResponseCode(updateResourceInstanceResponse,
+		// errorInfo.getCode(), "update resource instance");
+
+		List<String> variables = Arrays.asList("Resource Instance");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPONENT_NAME.name(), variables,
+				updateResourceInstanceResponse.getResponse());
+
+		resourceInstanceReqDetailsCP.setName(prevValue);
+
+		// validate RI name
+		List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
+		List<String> resourceInstanceListName = new ArrayList<String>();
+		for (int i = 0; i < resourceInstances.size(); i++) {
+			resourceInstanceListName.add(resourceInstances.get(i).getName());
+		}
+		List<String> resourceInstanceExpectedListName = new ArrayList<String>();
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
+		resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
+		String message = "resource instance name";
+		Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
+
+	}
+
+	private static ResourceReqDetails changeResouceName(ResourceReqDetails resourceDet,
+			String resourceInstanceUpdatedName) throws Exception {
+
+		ResourceReqDetails updatedResourceDetails = new ResourceReqDetails();
+		updatedResourceDetails = resourceDet;
+		updatedResourceDetails.setName(resourceInstanceUpdatedName);
+		List<String> tags = new ArrayList<String>();
+		tags.add(resourceInstanceUpdatedName);
+		updatedResourceDetails.setTags(tags);
+		Gson gson = new Gson();
+		String updatedResourceBodyJson = gson.toJson(updatedResourceDetails);
+		RestResponse response = LifecycleRestUtils.changeResourceState(resourceDet, sdncDesignerDetails1,
+				resourceDet.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertTrue("change LS state to CHECKOUT, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		response = ResourceRestUtils.updateResourceMetadata(updatedResourceBodyJson, sdncDesignerDetails1,
+				updatedResourceDetails.getUniqueId());
+		assertEquals("Check response code after updateresource name", 200, response.getErrorCode().intValue());
+		response = LifecycleRestUtils.changeResourceState(updatedResourceDetails, sdncDesignerDetails1,
+				resourceDet.getVersion(), LifeCycleStatesEnum.CHECKIN);
+
+		return updatedResourceDetails;
+
+	}
+
+	// private Component changeResouceName(Resource resourceDet, String
+	// resourceInstanceUpdatedName) throws Exception{
+	//
+	// User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	// Resource updatedResourceDetails = resourceDet;
+	// RestResponse response =
+	// LifecycleRestUtils.changeComponentState(updatedResourceDetails,
+	// defaultUser, LifeCycleStatesEnum.CHECKOUT, "state changed");
+	// assertTrue("change LS state to CHECKOUT, returned status:" +
+	// response.getErrorCode(),response.getErrorCode() == 200);
+	// updatedResourceDetails.setName(resourceInstanceUpdatedName);
+	// List<String> tags = new ArrayList<String>();
+	// tags.add(resourceInstanceUpdatedName);
+	// updatedResourceDetails.setTags(tags);
+	// Gson gson = new Gson();
+	// ResourceReqDetails resourceReqDetails = new
+	// ResourceReqDetails(updatedResourceDetails);
+	// String updatedResourceBodyJson = gson.toJson(resourceReqDetails);
+	// response = ResourceRestUtils.updateResource(updatedResourceBodyJson,
+	// defaultUser, updatedResourceDetails.getUniqueId());
+	// assertEquals("Check response code after updateresource name", 200,
+	// response.getErrorCode().intValue());
+	// response =
+	// LifecycleRestUtils.changeComponentState(updatedResourceDetails,
+	// defaultUser, LifeCycleStatesEnum.CHECKIN, "state changed");
+	// assertEquals("Check response code after updateresource name", 200,
+	// response.getErrorCode().intValue());
+	//
+	// return updatedResourceDetails;
+	//
+	// }
+
+	private void createVFWithCertifiedResourceInstance(ResourceReqDetails resourceDetails,
+			ComponentInstanceReqDetails resourceInstanceReqDetails) throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails1,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after CHECKOUT", 200, response.getErrorCode().intValue());
+
+		// add heat artifact to resource and certify
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1,
+				resourceDetails.getUniqueId());
+		assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		response = LifecycleRestUtils.certifyResource(resourceDetails);
+		assertEquals("Check response code after CERTIFY request", 200, response.getErrorCode().intValue());
+
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		resourceInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncDesignerDetails1,
+				resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+	}
+
+	protected Resource convertResourceGetResponseToJavaObject(ResourceReqDetails resourceDetails) throws IOException {
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails1);
+		assertEquals("Check response code after get resource", 200, response.getErrorCode().intValue());
+		return ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java
new file mode 100644
index 0000000..8a17c3c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java
@@ -0,0 +1,319 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.AssocType;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import fj.data.Either;
+
+public class ValidateExtendedVfData extends ComponentBaseTest {
+
+	protected Resource resourceDetailsVF;
+	protected Resource resourceDetailsCP_01;
+	protected Resource resourceDetailsVL_01;
+	protected Resource resourceDetailsVFCcomp;
+
+	protected User sdncUserDetails;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ValidateExtendedVfData() {
+		super(name, ValidateExtendedVfData.class.getName());
+	}
+
+	@BeforeMethod
+	public void create() throws Exception {
+
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		Either<Resource, RestResponse> resourceDetailsVFe = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF = resourceDetailsVFe.left().value();
+		Either<Resource, RestResponse> resourceDetailsCP_01e = AtomicOperationUtils
+				.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.PORT,
+						ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsCP_01 = resourceDetailsCP_01e.left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsCP_01, UserRoleEnum.DESIGNER,
+				true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsCP_01,
+				UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsCP_01,
+				UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_NET, resourceDetailsCP_01,
+				UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsCP_01, UserRoleEnum.DESIGNER,
+				true, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+		Either<Resource, RestResponse> resourceDetailsVL_01e = AtomicOperationUtils
+				.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VL, NormativeTypesEnum.NETWORK,
+						ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVL_01 = resourceDetailsVL_01e.left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVL_01, UserRoleEnum.DESIGNER,
+				true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsVL_01,
+				UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsVL_01,
+				UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_NET, resourceDetailsVL_01,
+				UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVL_01, UserRoleEnum.DESIGNER,
+				true, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsVL_01, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+
+		Either<Resource, RestResponse> resourceDetailsVFCcompE = AtomicOperationUtils
+				.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.COMPUTE,
+						ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVFCcomp = resourceDetailsVFCcompE.left().value();
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+
+		ComponentInstance resourceDetailsCP_01ins = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(resourceDetailsCP_01, resourceDetailsVF,
+						UserRoleEnum.DESIGNER, true)
+				.left().value();
+		ComponentInstance resourceDetailsVL_01ins = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(resourceDetailsVL_01, resourceDetailsVF,
+						UserRoleEnum.DESIGNER, true)
+				.left().value();
+		ComponentInstance resourceDetailsVFCcomp_ins = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, resourceDetailsVF,
+						UserRoleEnum.DESIGNER, true)
+				.left().value();
+
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF, resourceDetailsCP_01ins,
+				resourceDetailsVL_01ins, AssocType.LINKABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF, resourceDetailsCP_01ins,
+				resourceDetailsVFCcomp_ins, AssocType.BINDABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
+
+	}
+
+	@Test
+	public void getResourceLatestVersion() throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		// resourceDetailsVF =
+		// AtomicOperationUtils.getResourceObject(resourceDetailsVF,
+		// UserRoleEnum.DESIGNER);
+		RestResponse getResourceLatestVersionResponse = ResourceRestUtils.getResourceLatestVersionList(sdncUserDetails);
+		assertTrue("response code is not 200, returned :" + getResourceLatestVersionResponse.getErrorCode(),
+				getResourceLatestVersionResponse.getErrorCode() == 200);
+
+		List<Resource> resourceList = ResourceRestUtils
+				.restResponseToResourceObjectList(getResourceLatestVersionResponse.getResponse());
+		Resource resource = ResourceRestUtils.getResourceObjectFromResourceListByUid(resourceList,
+				resourceDetailsVF.getUniqueId());
+
+		callAllCheckMethods(resource);
+	}
+
+	@Test
+	public void getFollowedResources() throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		// resourceDetailsVF =
+		// AtomicOperationUtils.getResourceObject(resourceDetailsVF,
+		// UserRoleEnum.DESIGNER);
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+
+		RestResponse getFollowedResourcesResponse = ResourceRestUtils.getFollowedList(sdncUserDetails);
+		String json = getFollowedResourcesResponse.getResponse();
+		JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
+		JSONArray resources = (JSONArray) jsonResp.get("resources");
+
+		List<Resource> resourceList = ResourceRestUtils.restResponseToResourceObjectList(resources.toString());
+		Resource resource = ResourceRestUtils.getResourceObjectFromResourceListByUid(resourceList,
+				resourceDetailsVF.getUniqueId());
+		// TODO if get followed list Api should return full object data?
+		// callAllCheckMethods(resource);
+	}
+
+	@Test
+	public void lifeCycleChekInRequest() throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		// resourceDetailsVF =
+		// AtomicOperationUtils.getResourceObject(resourceDetailsVF,
+		// UserRoleEnum.DESIGNER);
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		callAllCheckMethods(resource);
+	}
+
+	@Test
+	public void lifeCycleChekOutRequest() throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertTrue("change LC state to CHECKOUT, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		callAllCheckMethods(resource);
+	}
+
+	@Test
+	public void lifeCycleRequestForCertification() throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertTrue("change LC state to CERTIFICATIONREQUEST, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		callAllCheckMethods(resource);
+	}
+
+	@Test
+	public void lifeCycleCertificationRequest() throws Exception {
+
+		RestResponse response = AtomicOperationUtils
+				.changeComponentState(resourceDetailsVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, false)
+				.getRight();
+		assertTrue("change LC state to CERTIFY, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+		callAllCheckMethods(resource);
+	}
+
+	@Test
+	public void checkGetResourceAfterCertificationRequest() throws Exception {
+
+		RestResponse response = AtomicOperationUtils
+				.changeComponentState(resourceDetailsVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, false)
+				.getRight();
+		assertTrue("change LC state to CERTIFY, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
+
+		callAllCheckMethods(resourceDetailsVF);
+	}
+
+	@Test
+	public void updateResourceMetadata() throws Exception {
+
+		resourceDetailsVF.setDescription("stamStam");
+		ResourceReqDetails resourceDetailsVFreqD = new ResourceReqDetails(resourceDetailsVF);
+		RestResponse updateResourceResponse = ResourceRestUtils.updateResourceMetadata(resourceDetailsVFreqD,
+				sdncUserDetails, resourceDetailsVF.getUniqueId());
+		assertTrue("response code is not 200, returned :" + updateResourceResponse.getErrorCode(),
+				updateResourceResponse.getErrorCode() == 200);
+
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(updateResourceResponse.getResponse());
+
+		callAllCheckMethods(resource);
+	}
+
+	private void checkResourceInstances(Resource resource) {
+		assertNotNull("resource component Instances list is null ", resource.getComponentInstances());
+		assertTrue("resource component Instances list is empty ", !resource.getComponentInstances().equals(""));
+	}
+
+	private void checkResourceInstancesProperties(Resource resource) {
+		assertNotNull("component Instances properies list is null ", resource.getComponentInstancesProperties());
+		assertTrue("component Instances properies list is empty ",
+				!resource.getComponentInstancesProperties().equals(""));
+	}
+
+	private void checkResourceInstancesRelations(Resource resource) {
+		assertNotNull("component Instances Relations list is null ", resource.getComponentInstancesRelations());
+		assertTrue("component Instances Relations list is empty ",
+				!resource.getComponentInstancesRelations().equals(""));
+	}
+
+	private void checkResourceCapabilities(Resource resource) {
+		assertNotNull("component Instances Capabilities list is null ", resource.getCapabilities());
+		assertTrue("component Instances Capabilities list is empty ", !resource.getCapabilities().equals(""));
+	}
+
+	private void checkResourceRequirements(Resource resource) {
+		assertNotNull("component Instances Requirements list is null ", resource.getRequirements());
+		assertTrue("component Instances Requirements list is empty ", !resource.getRequirements().equals(""));
+	}
+
+	private void callAllCheckMethods(Resource resource) {
+
+		checkResourceInstances(resource);
+		checkResourceInstancesProperties(resource);
+		checkResourceInstancesRelations(resource);
+		checkResourceCapabilities(resource);
+		checkResourceRequirements(resource);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java
new file mode 100644
index 0000000..ea8b892
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VfComponentInstanceCRUDTest.java
@@ -0,0 +1,1792 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.resource;
+
+import static org.junit.Assert.assertTrue;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_ALREADY_EXISTS;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_DELETE;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_INVALID_CONTENT;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_NOT_FOUND;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.RelationshipImpl;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class VfComponentInstanceCRUDTest extends ComponentInstanceBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public VfComponentInstanceCRUDTest() {
+		super(name, VfComponentInstanceCRUDTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+		init();
+		createComponents();
+	}
+
+	// CREATE Resource
+	private void createComponents() throws Exception {
+		createAtomicResource(resourceDetailsVFC_01);
+		LifecycleRestUtils.changeResourceState(resourceDetailsVFC_01, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createAtomicResource(resourceDetailsVFC_02);
+		LifecycleRestUtils.changeResourceState(resourceDetailsVFC_02, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createAtomicResource(resourceDetailsCP_01);
+		LifecycleRestUtils.changeResourceState(resourceDetailsCP_01, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createAtomicResource(resourceDetailsCP_02);
+		LifecycleRestUtils.changeResourceState(resourceDetailsCP_02, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createAtomicResource(resourceDetailsVL_01);
+		LifecycleRestUtils.changeResourceState(resourceDetailsVL_01, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createAtomicResource(resourceDetailsVL_02);
+		LifecycleRestUtils.changeResourceState(resourceDetailsVL_02, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createVF(resourceDetailsVF_02);
+	}
+
+	@Test
+	public void createVfcInstanceByDesigner() throws Exception {
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVFC_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test(enabled = false) // DE189419
+	public void createInstanceOfVfToItself() throws Exception {
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVF_02);
+		createAtomicResourceInstance = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertTrue(createAtomicResourceInstance.getErrorCode() == STATUS_CODE_NOT_FOUND);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void createVfcInstanceByAdmin() throws Exception {
+		User user = sdncAdminDetails;
+		createVF(resourceDetailsVF_01, user);
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_01,
+				resourceDetailsVFC_01, user);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_01, 1, 0);
+	}
+
+	@Test
+	public void createCpInstance() throws Exception {
+		// Create CP instance
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void createVlInstance() throws Exception {
+		// Create VL instance
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void updateResourceInstanceNameLessMaxLegth() throws Exception {
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("xxxxXthisXstringxisx49XcharcatersXlengthXxxxxxxxx");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+
+	}
+
+	@Test
+	public void updateInstanceNameExceedMaxLegth() throws Exception {
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("xxxxXthisXstringxisx51XcharcatersXlengthXxxxxxxxxxx");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void updateResourceInstanceNameHasMaxLegth() throws Exception {
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("xxxxXthisXstringxisx50XcharcatersXlengthXxxxxxxxxx");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+	}
+
+	@Test
+	public void resourceInstanceNameIsEmpty() throws Exception {
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		resourceInstanceReqDetails.setName("");
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		String instanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"name");
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "1").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance Name ", (resourceDetailsVFC_01.getName() + " 1"),
+				instanceName);
+	}
+
+	@Test
+	public void resourceInstanceNameIsNull() throws Exception {
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		resourceInstanceReqDetails.setName(null);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		String instanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"name");
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "1").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance Name ", (resourceDetailsVFC_01.getName() + " 1"),
+				instanceName);
+	}
+
+	@Test
+	public void resourceInstanceNameValidation01() throws Exception {
+		// 2 Instances
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String instanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"name");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "1").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance Name ", (resourceDetailsVFC_01.getName() + " 1"),
+				instanceName);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		instanceNormalizedName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "name");
+		componentInstance = ResponseParser.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(),
+				ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "2").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ", (resourceDetailsVFC_01.getName() + " 2"),
+				instanceName);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void resourceInstanceNameValidation02() throws Exception {
+
+		// 2 Instances
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String instanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"name");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "1").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance Name ", (resourceDetailsVFC_01.getName() + " 1"),
+				instanceName);
+		resourceInstanceReqDetails = ElementFactory.getComponentResourceInstance(resourceDetailsCP_01);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		instanceNormalizedName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "name");
+		componentInstance = ResponseParser.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(),
+				ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsCP_01.getName() + "2").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ", (resourceDetailsCP_01.getName() + " 2"),
+				instanceName);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createVfcInstanceByTester() throws Exception { // Response 409
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncTesterDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void createVfcInstance_UserIdIsEmpty() throws Exception {
+
+		User sdncUserDetails = new User();
+		sdncUserDetails.setUserId("");
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncUserDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void createVfcInstance_UserIdIsNonAsdcUser() throws Exception {
+
+		User sdncUserDetails = new User();
+		sdncUserDetails.setUserId("bt4567");
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncUserDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void createAllAtomicInstances() throws Exception {
+
+		// Add to VF resource VFC, CP and VL instances
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVFC_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 3, 0);
+	}
+
+	@Test
+	public void createDefferentVfcInstances() throws Exception {
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVFC_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVFC_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createDefferentCpInstances() throws Exception {
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsCP_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createDefferentVLInstances() throws Exception {
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVL_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createSeveralInstanceOfSameVFC() throws Exception {
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVFC_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVFC_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createSeveralInstanceOfSameVL() throws Exception {
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVL_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createSeveralInstanceOfSameCP() throws Exception {
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void createInstanceOfCpToVfc() throws Exception { // Add to CP to VFC
+																// (not allowed)
+
+		ComponentInstanceReqDetails resourceInstanceReqDetailsCP = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		ComponentInstanceReqDetails resourceInstanceReqDetailsVFC = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails, resourceInstanceReqDetailsVFC.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void createInstanceVfcToCp() throws Exception { // (not allowed)
+
+		ComponentInstanceReqDetails resourceInstanceReqDetailsCP = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		ComponentInstanceReqDetails resourceInstanceReqDetailsVFC = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsVFC, sdncDesignerDetails, resourceInstanceReqDetailsCP.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void createInstanceVlToVfc() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetailsVL = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		ComponentInstanceReqDetails resourceInstanceReqDetailsVFC = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsVFC, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsVL, sdncDesignerDetails, resourceInstanceReqDetailsVFC.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void createInstanceToNonSupportedComponentType() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetailsCP = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetailsCP, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE_INSTANCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_INVALID_CONTENT,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	// ("Create instance without position is allowed")
+	@Test
+	public void createInstanceOfVlWithoutPosXAndPosY() throws Exception { // instance
+																			// does
+																			// not
+																			// have
+																			// position
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		resourceInstanceReqDetails.setPosX("");
+		resourceInstanceReqDetails.setPosY("");
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	// Create instance without position is allowed")
+	@Test
+	public void createInstanceOfVlWithPositionNull() throws Exception { // instance
+																		// does
+																		// not
+																		// have
+																		// position
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		resourceInstanceReqDetails.setPosX(null);
+		resourceInstanceReqDetails.setPosY(null);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void createResourceInstanceForNonCheckedOutVF() throws Exception {
+
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02, sdncAdminDetails,
+				"0.1", LifeCycleStatesEnum.CHECKIN);
+		resourceDetailsVF_02.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		AssertJUnit.assertEquals("Check response code after create user", STATUS_CODE_SUCCESS,
+				checkInResponse.getErrorCode().intValue());
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				createResourceInstanceResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createResourceInstanceVfCheckedOutByOtherUser() throws Exception {
+
+		// Admin try to add RI to VF which is checked-Out By Designer
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncAdminDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void createResourceInstanceForNonExistingVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, "blablabla", ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				createResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	// Delete
+	@Test
+	public void deleteVfcInstanceByDesigner() throws Exception {
+
+		// Create RI
+		RestResponse createResourceInstanceResponse = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVFC_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = deleteAtomicInstanceForVF(compInstId, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkDeleteResponse(deleteResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void deleteVfcInstanceByAdmin() throws Exception {
+		createVF(resourceDetailsVF_01, sdncAdminDetails);
+		RestResponse createResourceInstanceResponse = createAtomicInstanceForVF(resourceDetailsVF_01,
+				resourceDetailsVL_01, sdncAdminDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_01, 1, 0);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = deleteAtomicInstanceForVF(compInstId, resourceDetailsVF_01,
+				sdncAdminDetails);
+		ResourceRestUtils.checkDeleteResponse(deleteResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_01, 0, 0);
+	}
+
+	@Test
+	public void deleteCpInstance() throws Exception {
+
+		RestResponse createResourceInstanceResponse = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = deleteAtomicInstanceForVF(compInstId, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkDeleteResponse(deleteResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void deleteVlInstance() throws Exception {
+
+		RestResponse createResourceInstanceResponse = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = deleteAtomicInstanceForVF(compInstId, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkDeleteResponse(deleteResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+	}
+
+	@Test
+	public void deleteOneVlInstance() throws Exception {
+
+		// RI-1
+		RestResponse createResourceInstanceResponse = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		// RI-2
+		createResourceInstanceResponse = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVL_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+		// Delete Resource instance RI-1
+		RestResponse deleteResourceInstanceResponse = deleteAtomicInstanceForVF(compInstId, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkDeleteResponse(deleteResourceInstanceResponse);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteVfcInstanceCheckedByOtherUser() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncTesterDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteInstanceNonSupportedComponentType() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE_INSTANCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_INVALID_CONTENT,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteInstanceFromNonVF() throws Exception {
+		// RI-1
+
+		ComponentInstanceReqDetails resourceInstanceVlReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceVlReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance1 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance1, ComponentTypeEnum.RESOURCE);
+		// RI-2
+		ComponentInstanceReqDetails resourceInstanceCplReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceCplReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance2 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance2, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+		// Delete VL instance from CP instance
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceInstanceCplReqDetails.getUniqueId(),
+				resourceInstanceVlReqDetails.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+	}
+
+	@Test
+	public void deleteNonExistingInstanceFromVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceVlReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceVlReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance1 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance1, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		resourceInstanceVlReqDetails.setUniqueId("1234567890");
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceVlReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteCpInstanceFromNonCheckOutVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceCpReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceCpReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance1 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance1, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02, sdncDesignerDetails,
+				"0.1", LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_SUCCESS,
+				checkInResponse.getErrorCode().intValue());
+		resourceDetailsVF_02.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceCpReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteVlInstanceFromNonCheckOutVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceVlReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceVlReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance1 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance1, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02, sdncDesignerDetails,
+				"0.1", LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_SUCCESS,
+				checkInResponse.getErrorCode().intValue());
+		resourceDetailsVF_02.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceVlReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteVfcInstanceFromNonCheckOutVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceVfcReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceVfcReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance1 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance1, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02, sdncDesignerDetails,
+				"0.1", LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_SUCCESS,
+				checkInResponse.getErrorCode().intValue());
+		resourceDetailsVF_02.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+		// Delete Resource instance
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceVfcReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteVlInstance_UserIdIsNonAsdcUser() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		// Delete Resource instance by non-ASDC User
+		User sdncUserDetails = new User();
+		sdncUserDetails.setUserId("bt4567");
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncUserDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void deleteAlreadyDeletedInstance() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_DELETE,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		deleteCompInstReqCapFromExpected(componentInstance.getUniqueId());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 0, 0);
+		deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(sdncDesignerDetails,
+				resourceDetailsVF_02.getUniqueId(), resourceInstanceReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void reCreateDeletedInstance() throws Exception {
+
+		// 2 Instances
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String instanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"name");
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "1").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance Name ", (resourceDetailsVFC_01.getName() + " 1"),
+				instanceName);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		instanceNormalizedName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "name");
+		componentInstance = ResponseParser.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(),
+				ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "2").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ", (resourceDetailsVFC_01.getName() + " 2"),
+				instanceName);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+		// Delete one instance
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), resourceInstanceReqDetails.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_DELETE,
+				deleteResourceInstanceResponse.getErrorCode().intValue());
+		deleteCompInstReqCapFromExpected(componentInstance.getUniqueId());
+		// Create same instance again
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		instanceNormalizedName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		instanceName = ResponseParser.getValueFromJsonResponse(createResourceInstanceResponse.getResponse(), "name");
+		componentInstance = ResponseParser.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(),
+				ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "3").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance Name ", (resourceDetailsVFC_01.getName() + " 3"),
+				instanceName);
+
+	}
+
+	// Update
+	@Test
+	public void updateVfcInstanceNameByDesigner() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("abcd");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName, "abcd");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, "abcd");
+	}
+
+	@Test
+	public void updateVfcInstanceNameByAdmin() throws Exception {
+		User user = sdncAdminDetails;
+		createVF(resourceDetailsVF_01, user);
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncAdminDetails, resourceDetailsVF_01.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_01, 1, 0);
+		vfcResourceInstanceReqDetails.setName("ABCD E");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncAdminDetails, resourceDetailsVF_01.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName, "abcde");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, "ABCD E");
+	}
+
+	@Test
+	public void updateInstanceNameAllowedCharacters() throws Exception {
+		// Allowed characters: Alphanumeric (a-zA-Z0-9), space (' '), underscore
+		// ('_'), dash ('-'), dot ('.'))
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("Abcd_1234567890-qwert-yuiop.zxcvb");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		// assertEquals("Check if RI normalizedName is correct ",
+		// riNormalizedName, "abcd_1234567890-qwert-yuiop.zxcv" );
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, "Abcd_1234567890-qwert-yuiop.zxcvb");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName,
+				"abcd1234567890qwertyuiopzxcvb");
+
+	}
+
+	@Test
+	public void updateVfcInstanceNameEmpty() throws Exception {
+		// see US534663 In case a designer removes the current resource instance
+		// name then BE has to generate again the "default" resource instance
+		// name
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = "";
+		vfcResourceInstanceReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String instanceNormalizedName = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"name");
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "2").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ", (resourceDetailsVFC_01.getName() + " 2"),
+				instanceName);
+	}
+
+	@Test
+	public void updateVfcInstanceNameNull() throws Exception {
+		// see US534663 In case a designer removes the current resource instance
+		// name then BE has to generate again the "default" resource instance
+		// name
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = null;
+		vfcResourceInstanceReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		final String updateResponse = updateResourceInstanceResponse.getResponse();
+		String instanceNormalizedName = ResponseParser.getValueFromJsonResponse(updateResponse, "normalizedName");
+		String instanceName = ResponseParser.getValueFromJsonResponse(updateResponse, "name");
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ",
+				(resourceDetailsVFC_01.getName() + "2").toLowerCase(), instanceNormalizedName);
+		AssertJUnit.assertEquals("check Resource Instance normalizedName ", (resourceDetailsVFC_01.getName() + " 2"),
+				instanceName);
+	}
+
+	@Test
+	public void updateCpInstanceName() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("AbcD");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName, "abcd");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, "AbcD");
+	}
+
+	@Test
+	public void updateVlInstanceName() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName("ABCD");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName, "abcd");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, "ABCD");
+	}
+
+	@Test
+	public void updateInstanceNameToArleadyExistInstanceName02() throws Exception {
+
+		// Create VFC instance
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance vfcComponentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(vfcComponentInstance, ComponentTypeEnum.RESOURCE);
+		// Create CP instance
+		ComponentInstanceReqDetails cpResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				cpResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance cpComponentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(cpComponentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 2, 0);
+		cpResourceInstanceReqDetails.setName(vfcComponentInstance.getName());
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				cpResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_ALREADY_EXISTS,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void updateInstanceNameMaxLength() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = "Qwertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl12345";
+		vfcResourceInstanceReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName, newName.toLowerCase());
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, newName);
+	}
+
+	@Test
+	public void updateInstanceNameExceedMaxLength() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = "Qwertyuiop1234567890asdfAhjklzxcvbnmasdfghjkl123456";
+		vfcResourceInstanceReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void updateCpInstanceCheckedByOtherUser() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = "Qwertyuiop1234567890";
+		resourceInstanceReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetails, sdncAdminDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void UpdateVfcInstance_UserIdIsNonAsdcUser() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = "Qwertyuiop1234567890";
+		resourceInstanceReqDetails.setName(newName);
+		User nonSdncUserDetails = new User();
+		nonSdncUserDetails.setUserId("bt4567");
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetails, nonSdncUserDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_RESTRICTED_OPERATION,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+	}
+
+	@Test
+	public void UpdateResourceInstanceFormNonExistingVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		// LifecycleRestUtils.changeResourceState(resourceDetailsVL_01,
+		// sdncAdminDetails, "0.1", LifeCycleStatesEnum.CHECKIN);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String newName = "Qwertyuiop1234567890";
+		resourceInstanceReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, "blablabla", ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void updateNonExistingInstanceFromVF() throws Exception {
+
+		ComponentInstanceReqDetails resourceInstanceVlReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceVlReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance1 = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance1, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		resourceInstanceVlReqDetails.setUniqueId("1234567890");
+		// String newName= "Qwertyuiop1234567890";
+		// resourceInstanceVlReqDetails.setName(newName);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				resourceInstanceVlReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				updateResourceInstanceResponse.getErrorCode().intValue());
+	}
+
+	// Update
+	@Test
+	public void updateVfcInstanceNameAsVfName() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		vfcResourceInstanceReqDetails.setName(resourceDetailsVF_02.getName());
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String resourceNameFromJsonResponse = ResponseParser.getNameFromResponse(updateResourceInstanceResponse);
+		AssertJUnit.assertEquals(resourceNameFromJsonResponse, vfcResourceInstanceReqDetails.getName());
+		String riNormalizedName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"normalizedName");
+		String riName = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "name");
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riNormalizedName,
+				resourceDetailsVF_02.getName().toLowerCase());
+		AssertJUnit.assertEquals("Check if RI normalizedName is correct ", riName, resourceDetailsVF_02.getName());
+	}
+
+	@Test
+	public void updateInstanceNameInvalidCharacters() throws Exception {
+		char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
+				'|', '\\', ',' };
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String newName = "Abcd1";
+		String updateName;
+		for (int i = 0; i < invalidChars.length; i++) {
+			updateName = newName + invalidChars[i];
+			vfcResourceInstanceReqDetails.setName(updateName);
+			RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+					vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+					ComponentTypeEnum.RESOURCE);
+			AssertJUnit.assertEquals("Check response code ", STATUS_CODE_INVALID_CONTENT,
+					updateResourceInstanceResponse.getErrorCode().intValue());
+		}
+	}
+
+	// Update Position
+	@Test
+	public void updateVfcInstancePosition() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String updatePosX = "130";
+		String updatePosY = "180";
+		vfcResourceInstanceReqDetails.setPosX(updatePosX);
+		vfcResourceInstanceReqDetails.setPosY(updatePosY);
+		vfcResourceInstanceReqDetails.setName(null);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String posXFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posX");
+		String posYFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posY");
+		AssertJUnit.assertEquals(posXFromJsonResponse, updatePosX);
+		AssertJUnit.assertEquals(posYFromJsonResponse, updatePosY);
+	}
+
+	@Test
+	public void updateVlInstancePosition() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVL_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String updatePosX = "130";
+		String updatePosY = "180";
+		vfcResourceInstanceReqDetails.setPosX(updatePosX);
+		vfcResourceInstanceReqDetails.setPosY(updatePosY);
+		vfcResourceInstanceReqDetails.setName(null);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String posXFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posX");
+		String posYFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posY");
+		AssertJUnit.assertEquals(posXFromJsonResponse, updatePosX);
+		AssertJUnit.assertEquals(posYFromJsonResponse, updatePosY);
+	}
+
+	@Test
+	public void updateCpInstancePosition() throws Exception {
+
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String updatePosX = "130";
+		String updatePosY = "180";
+		vfcResourceInstanceReqDetails.setPosX(updatePosX);
+		vfcResourceInstanceReqDetails.setPosY(updatePosY);
+		vfcResourceInstanceReqDetails.setName(null);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String posXFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posX");
+		String posYFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posY");
+		AssertJUnit.assertEquals(posXFromJsonResponse, updatePosX);
+		AssertJUnit.assertEquals(posYFromJsonResponse, updatePosY);
+	}
+
+	@Test
+	public void updateInstancePositionNegativePosition() throws Exception {
+
+		ComponentInstanceReqDetails cpResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				cpResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstance componentInstance = ResponseParser
+				.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+		addCompInstReqCapToExpected(componentInstance, ComponentTypeEnum.RESOURCE);
+		getComponentAndValidateRIs(resourceDetailsVF_02, 1, 0);
+		String updatePosX = "-100";
+		String updatePosY = "-100";
+		cpResourceInstanceReqDetails.setPosX(updatePosX);
+		cpResourceInstanceReqDetails.setPosY(updatePosY);
+		cpResourceInstanceReqDetails.setName(null);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				cpResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String posXFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posX");
+		String posYFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posY");
+		AssertJUnit.assertEquals(posXFromJsonResponse, updatePosX);
+		AssertJUnit.assertEquals(posYFromJsonResponse, updatePosY);
+	}
+
+	@Test
+	public void updateInstancesPositionSameLocationForBothInstances() throws Exception {
+
+		ComponentInstanceReqDetails cpResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				cpResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		ComponentInstanceReqDetails vfcResourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsVFC_01);
+		createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		String updatePosX = "100";
+		String updatePosY = "500";
+		vfcResourceInstanceReqDetails.setPosX(updatePosX);
+		vfcResourceInstanceReqDetails.setPosY(updatePosY);
+		vfcResourceInstanceReqDetails.setName(null);
+		cpResourceInstanceReqDetails.setPosX(updatePosX);
+		cpResourceInstanceReqDetails.setPosY(updatePosY);
+		cpResourceInstanceReqDetails.setName(null);
+		RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				vfcResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		String posXFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posX");
+		String posYFromJsonResponse = ResponseParser
+				.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(), "posY");
+		AssertJUnit.assertEquals(posXFromJsonResponse, updatePosX);
+		AssertJUnit.assertEquals(posYFromJsonResponse, updatePosY);
+		updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
+				cpResourceInstanceReqDetails, sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(),
+				ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(updateResourceInstanceResponse);
+		posXFromJsonResponse = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"posX");
+		posYFromJsonResponse = ResponseParser.getValueFromJsonResponse(updateResourceInstanceResponse.getResponse(),
+				"posY");
+		AssertJUnit.assertEquals(posXFromJsonResponse, updatePosX);
+		AssertJUnit.assertEquals(posYFromJsonResponse, updatePosY);
+	}
+
+	@Test
+	public void createAllAtomicInstancesTestGetReqCapAPI_suc() throws Exception {
+
+		// Add to VF resource VFC, CP and VL instances
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVFC_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+
+		getVfResourceReqCapUsingAPI(3, 0, sdncDesignerDetails);
+
+	}
+
+	// END of Update
+
+	@Test
+	public void createAllAtomicInstancesTestGetReqCapAPIfailed() throws Exception {
+
+		// Add to VF resource VFC, CP and VL instances
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsVL_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVFC_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		resourceDetailsVF_02.setUniqueId("dummy");
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncAdminDetails,
+				resourceDetailsVF_02);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_NOT_FOUND,
+				getResourceResponse.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void associateInVF() throws Exception {
+
+		ResourceReqDetails resourceDetailsReq = ElementFactory.getDefaultResourceByType("SoftCompRouter",
+				NormativeTypesEnum.SOFTWARE_COMPONENT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS,
+				sdncDesignerDetails.getUserId(), ResourceTypeEnum.VFC); // resourceType
+																		// = VFC
+		ResourceReqDetails resourceDetailsCap = ElementFactory.getDefaultResourceByType("MyComput",
+				NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VFC); // resourceType = VFC
+		createAtomicResource(resourceDetailsReq);
+		LifecycleRestUtils.changeResourceState(resourceDetailsReq, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createAtomicResource(resourceDetailsCap);
+		LifecycleRestUtils.changeResourceState(resourceDetailsCap, sdncAdminDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+
+		RestResponse riReqR = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsReq, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(riReqR);
+		RestResponse riCapR = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsCap, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(riCapR);
+
+		ComponentInstance riReq = ResponseParser.parseToObject(riReqR.getResponse(), ComponentInstance.class);
+		ComponentInstance riCap = ResponseParser.parseToObject(riCapR.getResponse(), ComponentInstance.class);
+
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				resourceDetailsVF_02);
+
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get("tosca.capabilities.Container");
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get("tosca.capabilities.Container");
+
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		requirementDef.setFromNode(riReq.getUniqueId());
+		requirementDef.setToNode(riCap.getUniqueId());
+
+		RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair();
+		pair.setRequirementOwnerId(riReq.getUniqueId());
+		pair.setCapabilityOwnerId(riCap.getUniqueId());
+		pair.setRequirement("host");
+		RelationshipImpl relationship = new RelationshipImpl();
+		relationship.setType("tosca.capabilities.Container");
+		pair.setRelationships(relationship);
+		pair.setCapabilityUid(capList.get(0).getUniqueId());
+		pair.setRequirementUid(reqList.get(0).getUniqueId());
+		List<RequirementAndRelationshipPair> relationships = new ArrayList<>();
+		relationships.add(pair);
+		requirementDef.setRelationships(relationships);
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_SUCCESS,
+				associateInstances.getErrorCode().intValue());
+
+		getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				resourceDetailsVF_02);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+
+		List<RequirementDefinition> list = capReqDef.getRequirements().get("tosca.capabilities.Container");
+		AssertJUnit.assertEquals("Check requirement", null, list);
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF_02.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_SUCCESS,
+				dissociateInstances.getErrorCode().intValue());
+
+		getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				resourceDetailsVF_02);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+
+		list = capReqDef.getRequirements().get("tosca.capabilities.Container");
+		AssertJUnit.assertEquals("Check requirement", 1, list.size());
+
+	}
+
+	@Test
+	public void testUnsatisfiedCpReqInVF() throws Exception {
+
+		// Certify all the needed atomic resources
+		RestResponse response = LifecycleRestUtils.certifyResource(resourceDetailsVFC_02);
+		ResourceRestUtils.checkSuccess(response);
+		response = LifecycleRestUtils.certifyResource(resourceDetailsCP_01);
+		ResourceRestUtils.checkSuccess(response);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails,
+				resourceDetailsVF_02.getUniqueId());
+		ResourceRestUtils.checkSuccess(response);
+
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String compInstName = ResponseParser.getNameFromResponse(createAtomicResourceInstance);
+		String cpCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		RestResponse submitForTesting = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02,
+				sdncDesignerDetails, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		String[] variables = new String[] { resourceDetailsVF_02.getName(), "VF", "CP (Connection Point)", compInstName,
+				"requirement", "tosca.capabilities.network.Bindable", "fulfilled" };
+		BaseValidationUtils.checkErrorResponse(submitForTesting,
+				ActionStatus.REQ_CAP_NOT_SATISFIED_BEFORE_CERTIFICATION, variables);
+
+		createAtomicResourceInstance = createAtomicInstanceForVF(resourceDetailsVF_02, resourceDetailsVFC_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String computeCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+		fulfillCpRequirement(resourceDetailsVF_02, cpCompInstId, computeCompInstId, computeCompInstId,
+				sdncDesignerDetails, ComponentTypeEnum.RESOURCE);
+
+		submitForTesting = LifecycleRestUtils.changeResourceState(resourceDetailsVF_02, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		BaseValidationUtils.checkSuccess(submitForTesting);
+	}
+
+	private void getVfResourceReqCapUsingAPI(int numberOfRIs, int numberOfRelations, User user)
+			throws IOException, Exception {
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncAdminDetails,
+				resourceDetailsVF_02);
+		AssertJUnit.assertEquals("Check response code ", STATUS_CODE_SUCCESS,
+				getResourceResponse.getErrorCode().intValue());
+		// ResourceValidationUtils.validateResp(getResourceResponse,
+		// resourceRespJavaObject);
+		// int numberOfActualRIs = resource.getComponentInstances()!=null ?
+		// resource.getComponentInstances().size() : 0;
+		// int numberOfActualRelations =
+		// resource.getComponentInstancesRelations()!=null ?
+		// resource.getComponentInstancesRelations().size() : 0;
+		// assertEquals("Check number of RIs meet the expected number",
+		// numberOfRIs ,numberOfActualRIs);
+		// assertEquals("Check number of RI relations meet the expected number",
+		// numberOfRelations ,numberOfActualRelations);
+
+		//// get VF actual Capabilities and Requirements and validate according
+		//// to expected
+		Resource vfResource = ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(),
+				Resource.class);
+		verifyReqCap(vfResource);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java
new file mode 100644
index 0000000..3d33853
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ChangeServiceDistributionStatusApiTest.java
@@ -0,0 +1,1012 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import fj.data.Either;
+
+public class ChangeServiceDistributionStatusApiTest extends ComponentBaseTest {
+
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected User sdncDesignerDetails;
+	protected User sdncAdminDetails;
+	protected User sdncGovernorDeatails;
+	protected User sdncTesterDetails;
+	protected User sdncOpsDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails;
+	protected Component resourceDetailsVFCcomp;
+	protected Component serviceDetailsCompp;
+
+	private String userRemarks = "commentTest";
+
+	private List<String> variablesAsList;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ChangeServiceDistributionStatusApiTest() throws Exception {
+		super(name, ChangeServiceDistributionStatusApiTest.class.getName());
+
+	}
+
+	@BeforeMethod
+	public void init() throws Exception {
+
+		variablesAsList = new ArrayList<String>();
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncGovernorDeatails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+		sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncOpsDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+		resourceDetailsVFCcomp = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				true, true);
+
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+		Service serviceServ = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, serviceServ,
+				UserRoleEnum.DESIGNER, true);
+
+		serviceDetails = new ServiceReqDetails(serviceServ);
+
+	}
+
+	// -----------------------------------------------T E S T
+	// S--------------------------------------------//
+
+	@Test
+	public void approveNotCertifiedService_checkout() throws Exception {
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		validateAudit("DApprove", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+	}
+
+	@Test
+	public void approveNotCertifiedService_checkedin() throws Exception {
+		RestResponse checkinResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals(200, checkinResp.getErrorCode().intValue());
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		validateAudit("DApprove", LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+	}
+
+	@Test
+	public void approveNotCertifiedService_inProgress() throws Exception {
+		RestResponse certReqResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(200, certReqResp.getErrorCode().intValue());
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name());
+		// String auditAction="DApprove";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+		// version, sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.READY_FOR_CERTIFICATION.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setStatus("403");
+		// expectedResourceAuditJavaObject.setDesc(String.format(errorInfo.getMessageId()
+		// + ": " + errorInfo.getMessage(), version,
+		// serviceDetails.getServiceName()));
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DApprove", LifecycleStateEnum.READY_FOR_CERTIFICATION,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+
+	}
+
+	@Test
+	public void approveNotCertifiedService_readyForCer() throws Exception {
+		approveNotCertifiedService_inProgress();
+		DbUtils.deleteFromEsDbByPattern("_all");
+
+		RestResponse startCertResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(200, startCertResp.getErrorCode().intValue());
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name());
+		// String auditAction="DApprove";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+		// version, sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setDprevStatus("");
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setStatus("403");
+		// expectedResourceAuditJavaObject.setDesc(String.format(errorInfo.getMessageId()
+		// + ": " + errorInfo.getMessage(), version,
+		// serviceDetails.getServiceName()));
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFICATION_IN_PROGRESS,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+	}
+
+	@Test
+	public void rejectNotCertifiedService_checkeout() throws Exception {
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+		// version, sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name());
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setDprevStatus("");
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setStatus("403");
+		// expectedResourceAuditJavaObject.setDesc(String.format(errorInfo.getMessageId()
+		// + ": " + errorInfo.getMessage(), version,
+		// serviceDetails.getServiceName()));
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+	}
+
+	@Test
+	public void rejectNotCertifiedService_checkedin() throws Exception {
+		RestResponse startCertResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertEquals(200, startCertResp.getErrorCode().intValue());
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+		// version, sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.name());
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setDprevStatus("");
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setStatus("403");
+		// expectedResourceAuditJavaObject.setDesc(String.format(errorInfo.getMessageId()
+		// + ": " + errorInfo.getMessage(), version,
+		// serviceDetails.getServiceName()));
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+	}
+
+	@Test
+	public void rejectNotCertifiedService_inProgress() throws Exception {
+		RestResponse startCertResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(200, startCertResp.getErrorCode().intValue());
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+		// version, sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.READY_FOR_CERTIFICATION.name());
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setDprevStatus("");
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setStatus("403");
+		// expectedResourceAuditJavaObject.setDesc(String.format(errorInfo.getMessageId()
+		// + ": " + errorInfo.getMessage(), version,
+		// serviceDetails.getServiceName()));
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.READY_FOR_CERTIFICATION,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+	}
+
+	@Test
+	public void rejectNotCertifiedService_readyForCer() throws Exception {
+		rejectNotCertifiedService_inProgress();
+		DbUtils.deleteFromEsDbByPattern("_all");
+
+		RestResponse startCertResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(200, startCertResp.getErrorCode().intValue());
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 403, serviceDetails.getVersion());
+
+		variablesAsList = Arrays.asList(serviceDetails.getVersion(), serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name(),
+				variablesAsList, changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+		// version, sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setDprevStatus("");
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setStatus("403");
+		// expectedResourceAuditJavaObject.setDesc(String.format(errorInfo.getMessageId()
+		// + ": " + errorInfo.getMessage(), version,
+		// serviceDetails.getServiceName()));
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFICATION_IN_PROGRESS,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				"403", ActionStatus.SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION, sdncAdminDetails);
+
+	}
+
+	@Test
+	public void approveCertifiedService_bysdncGovernorDeatails() throws Exception {
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncGovernorDeatails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(changeDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, null, null, sdncGovernorDeatails);
+	}
+
+	@Test
+	public void approveCertifiedService_bysdncAdminDetails() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(changeDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, null, null, sdncAdminDetails);
+	}
+
+	@Test
+	public void approveCertifiedService_byDesigner() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncDesignerDetails, 409, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		// String auditAction="DApprove";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncDesignerDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setStatus("409");
+		// expectedResourceAuditJavaObject.setDesc(errorInfo.getMessageId() + ":
+		// " + errorInfo.getMessage());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, "409", ActionStatus.RESTRICTED_OPERATION,
+				sdncDesignerDetails);
+	}
+
+	@Test
+	public void approveCertifiedService_byTester() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncTesterDetails, 409, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		// String auditAction="DApprove";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncTesterDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setStatus("409");
+		// expectedResourceAuditJavaObject.setDesc(errorInfo.getMessageId() + ":
+		// " + errorInfo.getMessage());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, "409", ActionStatus.RESTRICTED_OPERATION,
+				sdncTesterDetails);
+	}
+
+	@Test
+	public void approveCertifiedService_byOps() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncOpsDetails, 409, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, "409", ActionStatus.RESTRICTED_OPERATION,
+				sdncOpsDetails);
+
+	}
+
+	@Test
+	public void rejectCertifiedService_bysdncGovernorDeatails() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncGovernorDeatails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(changeDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_REJECTED);
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_REJECTED);
+
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncGovernorDeatails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_REJECTED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, null, null, sdncGovernorDeatails);
+
+	}
+
+	@Test
+	public void rejectCertifiedService_bysdncAdminDetails() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(changeDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_REJECTED);
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_REJECTED);
+
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncAdminDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_REJECTED.name());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, null, null, sdncAdminDetails);
+	}
+
+	@Test
+	public void rejectCertifiedService_byDesigner() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncDesignerDetails, 409, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncDesignerDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setStatus("409");
+		// expectedResourceAuditJavaObject.setDesc(errorInfo.getMessageId() + ":
+		// " + errorInfo.getMessage());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, "409", ActionStatus.RESTRICTED_OPERATION,
+				sdncDesignerDetails);
+	}
+
+	@Test
+	public void rejectCertifiedService_byTester() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncTesterDetails, 409, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncTesterDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setStatus("409");
+		// expectedResourceAuditJavaObject.setDesc(errorInfo.getMessageId() + ":
+		// " + errorInfo.getMessage());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, "409", ActionStatus.RESTRICTED_OPERATION,
+				sdncTesterDetails);
+	}
+
+	@Test
+	public void rejectCertifiedService_byOps() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncOpsDetails, 409, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+		// ErrorInfo errorInfo =
+		// utils.parseYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		// String auditAction="DReject";
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// ServiceValidationUtils.constructFieldsForAuditValidation(certifyService,
+		// certifyService.getVersion(), sdncOpsDetails);
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setResourceType("Service");
+		// expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.name());
+		// expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.name());
+		// expectedResourceAuditJavaObject.setDprevStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setDcurrStatus(DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED.name());
+		// expectedResourceAuditJavaObject.setStatus("409");
+		// expectedResourceAuditJavaObject.setDesc(errorInfo.getMessageId() + ":
+		// " + errorInfo.getMessage());
+		// expectedResourceAuditJavaObject.setComment(userRemarks);
+		// expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		//
+		// AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject,
+		// auditAction);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, "409", ActionStatus.RESTRICTED_OPERATION,
+				sdncOpsDetails);
+	}
+
+	@Test
+	public void approveServiceNotFound() throws Exception {
+		String previuosId = serviceDetails.getUniqueId();
+		serviceDetails.setUniqueId("dummyId");
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 404, serviceDetails.getVersion());
+		serviceDetails.setUniqueId(previuosId);
+
+		variablesAsList = Arrays.asList("dummyId");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), variablesAsList,
+				changeDistStatusAndValidate.getResponse());
+
+	}
+
+	@Test
+	public void rejectServiceNotFound() throws Exception {
+		String previuosId = serviceDetails.getUniqueId();
+		serviceDetails.setUniqueId("dummyId");
+
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 404, serviceDetails.getVersion());
+		serviceDetails.setUniqueId(previuosId);
+
+		variablesAsList = Arrays.asList("dummyId");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), variablesAsList,
+				changeDistStatusAndValidate.getResponse());
+
+	}
+
+	@Test
+	public void rejectService_emptyComment() throws Exception {
+		userRemarks = "";
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 400, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+	}
+
+	@Test
+	public void rejectService_nullComment() throws Exception {
+		userRemarks = null;
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 400, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+	}
+
+	@Test
+	public void rejectService_spaceComment() throws Exception {
+		userRemarks = " ";
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncAdminDetails, 400, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+	}
+
+	@Test
+	public void approveService_emptyComment() throws Exception {
+		userRemarks = "";
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 400, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+	}
+
+	@Test
+	public void approveService_nullComment() throws Exception {
+		userRemarks = null;
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 400, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+	}
+
+	@Test
+	public void approveService_spaceComment() throws Exception {
+		userRemarks = " ";
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse changeDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 400, certifyService.getVersion());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), new ArrayList<String>(),
+				changeDistStatusAndValidate.getResponse());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED);
+
+	}
+
+	@Test
+	public void distributionStatusChange_approve_Reject_AprroveBysdncAdminDetails() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+
+		RestResponse approveDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncGovernorDeatails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(approveDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse rejectDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, sdncGovernorDeatails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(rejectDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_REJECTED);
+
+		validateAudit("DReject", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_APPROVED,
+				DistributionStatusEnum.DISTRIBUTION_REJECTED, null, null, sdncGovernorDeatails);
+
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse secondApproveDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncAdminDetails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(secondApproveDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		validateAudit("DApprove", LifecycleStateEnum.CERTIFIED, DistributionStatusEnum.DISTRIBUTION_REJECTED,
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, null, null, sdncAdminDetails);
+
+	}
+
+	@Test
+	public void distributeNotCertifiedServiceTest() throws Exception {
+		RestResponse approveDistStatusAndValidate = changeDistStatusAndValidate(DistributionStatusEnum.DISTRIBUTED,
+				sdncGovernorDeatails, 200, serviceDetails.getVersion());
+
+		RestResponse getService = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTED);
+
+	}
+
+	@Test
+	public void distributeCertifiedServiceTest() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse approveDistStatusAndValidate = changeDistStatusAndValidate(DistributionStatusEnum.DISTRIBUTED,
+				sdncGovernorDeatails, 200, certifyService.getVersion());
+
+		RestResponse getService = ServiceRestUtils.getService(certifyService, sdncDesignerDetails);
+		getDistrubtionStatusValue(getService, DistributionStatusEnum.DISTRIBUTED);
+
+	}
+
+	@Test
+	public void approveCheckedoutCertifiedServiceTest() throws Exception {
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		RestResponse approveDistStatusAndValidate = changeDistStatusAndValidate(
+				DistributionStatusEnum.DISTRIBUTION_APPROVED, sdncGovernorDeatails, 200, certifyService.getVersion());
+		getDistrubtionStatusValue(approveDistStatusAndValidate, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+
+		RestResponse checkoutResp = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(200, checkoutResp.getErrorCode().intValue());
+		// Utils r = new Utils();
+
+		String distributionStatus = ResponseParser.getValueFromJsonResponse(checkoutResp.getResponse(),
+				"distributionStatus");
+		// Utils r1 = new Utils();
+		String lifecycleState = ResponseParser.getValueFromJsonResponse(checkoutResp.getResponse(), "lifecycleState");
+
+		assertTrue("NOT_CERTIFIED_CHECKOUT".equals(lifecycleState));
+		assertTrue("DISTRIBUTION_NOT_APPROVED".equals(distributionStatus));
+	}
+
+	private RestResponse changeDistStatusAndValidate(DistributionStatusEnum distStatus, User user, int errorCode,
+			String serviceVersion) throws Exception {
+		RestResponse distributionResponse = LifecycleRestUtils.changeDistributionStatus(serviceDetails, serviceVersion,
+				user, userRemarks, distStatus);
+		assertNotNull(distributionResponse);
+		assertNotNull(distributionResponse.getErrorCode());
+		assertEquals(errorCode, distributionResponse.getErrorCode().intValue());
+
+		if (userRemarks == " " || userRemarks == null) {
+			userRemarks = "";
+		}
+
+		return distributionResponse;
+	}
+
+	private void getDistrubtionStatusValue(RestResponse response, DistributionStatusEnum expectedDistributionValue)
+			throws Exception {
+		String actualDistributionValue = ResponseParser.getValueFromJsonResponse(response.getResponse(),
+				"distributionStatus");
+		assertEquals(expectedDistributionValue.name(), actualDistributionValue);
+	}
+
+	private void validateAudit(String Action, LifecycleStateEnum currState, DistributionStatusEnum dPrevStatus,
+			DistributionStatusEnum dCurrStatus, String status, ActionStatus errorInfoFromFile, User user)
+			throws Exception {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceDetails.getVersion(), user);
+		expectedResourceAuditJavaObject.setAction(Action);
+		expectedResourceAuditJavaObject.setResourceType("Service");
+		expectedResourceAuditJavaObject.setCurrState(currState.name());
+		expectedResourceAuditJavaObject.setDprevStatus(dPrevStatus.name());
+		expectedResourceAuditJavaObject.setDcurrStatus(dCurrStatus.name());
+		expectedResourceAuditJavaObject.setComment(userRemarks);
+		expectedResourceAuditJavaObject.setDesc("OK");
+
+		if (errorInfoFromFile != null) {
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorInfoFromFile.name());
+			expectedResourceAuditJavaObject
+					.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variablesAsList));
+		}
+
+		if (status != null)
+			expectedResourceAuditJavaObject.setStatus(status);
+
+		if (currState != LifecycleStateEnum.CERTIFIED) {
+			expectedResourceAuditJavaObject.setModifierName("");
+		}
+
+		AuditValidationUtils.validateAuditDistribution(expectedResourceAuditJavaObject, Action);
+	}
+
+	// private ServiceReqDetails certifyService() throws Exception
+	// {
+	// ServiceReqDetails certifyService =
+	// LifecycleRestUtils.certifyService(serviceDetails,
+	// serviceDetails.getVersion(), sdncAdminDetails);
+	//// version = certifyService.getVersion();
+	//
+	// return certifyService;
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java
new file mode 100644
index 0000000..8e95a6d
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/CreateServiceMetadataApiTest.java
@@ -0,0 +1,1304 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.json.JSONObject;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class CreateServiceMetadataApiTest extends ComponentBaseTest {
+	private static Logger logger = LoggerFactory.getLogger(CreateServiceMetadataApiTest.class.getName());
+
+	String serviceBaseVersion = "0.1";
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public CreateServiceMetadataApiTest() {
+		super(name, CreateServiceMetadataApiTest.class.getName());
+	}
+
+	@Test
+	public void createDefaultService() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// String creator =
+		// ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getUserId();
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", 201, restResponse.getErrorCode().intValue());
+
+		// validate create service response vs actual
+
+		Service service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, service, sdncUserDetails,
+				(LifecycleStateEnum) null);
+
+		// validate get service response vs actual
+		restResponse = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
+		service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, service, sdncUserDetails,
+				(LifecycleStateEnum) null);
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createDefaultServiceUserDesigner() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", 201, restResponse.getErrorCode().intValue());
+
+		// validate create service response vs actual
+
+		Service service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, service, sdncUserDetails,
+				(LifecycleStateEnum) null);
+
+		// validate get service response vs actual
+		restResponse = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
+		service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceUserNotFound() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncUserDetails.setUserId("no1234");
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		sdncUserDetails.setFirstName("");
+		sdncUserDetails.setLastName("");
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setModifierName("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceUserNotAllowed() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceEmptyName() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		String serviceName = "";
+		serviceDetails.setName(serviceName);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_COMPONENT_NAME.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("Service");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_COMPONENT_NAME.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceEmptyCategory() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		String category = "";
+
+		serviceDetails.setCategories(null);
+		// serviceDetails.addCategory(category);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("Service");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceEmptyTag() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ArrayList<String> tags = new ArrayList<String>();
+		tags.add("");
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setTags(tags);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FIELD_FORMAT.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("Service", "tag");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceEmptyDescription() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		String description = "";
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setDescription(description);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("Service");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceEmptyTags() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ArrayList<String> tags = new ArrayList<String>();
+		tags.add("");
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setTags(tags);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FIELD_FORMAT.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("Service", "tag");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceByPutHttpMethod() throws Exception {
+
+		String method = "PUT";
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+
+		RestResponse restResponse = ServiceRestUtils.createServiceByHttpMethod(serviceDetails, sdncUserDetails, method,
+				Urls.CREATE_SERVICE);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.NOT_ALLOWED.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				restResponse.getResponse());
+
+		// //validate audit
+		//
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// resourceUtils.constructFieldsForAuditValidation(serviceDetails,
+		// serviceBaseVersion, sdncUserDetails);
+		//
+		// String auditAction="Create";
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setPrevVersion("");
+		// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		// expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		//
+		// String auditDesc =
+		// AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		// expectedResourceAuditJavaObject.setDesc(auditDesc);
+		//
+		// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+		// auditAction);
+
+	}
+
+	@Test
+	public void createServiceByDeleteHttpMethod() throws Exception {
+
+		String method = "DELETE";
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+
+		RestResponse restResponse = ServiceRestUtils.createServiceByHttpMethod(serviceDetails, sdncUserDetails, method,
+				Urls.CREATE_SERVICE);
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.NOT_ALLOWED.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
+				restResponse.getResponse());
+
+		// //validate audit
+		//
+		// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		// resourceUtils.constructFieldsForAuditValidation(serviceDetails,
+		// serviceBaseVersion, sdncUserDetails);
+		//
+		// String auditAction="Create";
+		// expectedResourceAuditJavaObject.setAction(auditAction);
+		// expectedResourceAuditJavaObject.setPrevState("");
+		// expectedResourceAuditJavaObject.setPrevVersion("");
+		// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		// expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		//
+		// String auditDesc =
+		// AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		// expectedResourceAuditJavaObject.setDesc(auditDesc);
+		//
+		// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+		// auditAction);
+
+	}
+
+	@Test
+	public void createServiceTagLengthExceedLimit() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		StringBuffer tagBuffer = new StringBuffer();
+		for (int i = 0; i < 1025; i++) {
+			tagBuffer.append("a");
+		}
+		ArrayList<String> tags = new ArrayList<String>();
+		tags.add(tagBuffer.toString());
+		serviceDetails.setTags(tags);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("50");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc("50"));
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+		/*
+		 * ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+		 * ServiceValidationUtils.constructFieldsForAuditValidation(
+		 * serviceDetails, serviceBaseVersion, sdncUserDetails);
+		 * 
+		 * String auditAction="Create";
+		 * expectedResourceAuditJavaObject.setAction(auditAction);
+		 * expectedResourceAuditJavaObject.setPrevState("");
+		 * expectedResourceAuditJavaObject.setPrevVersion("");
+		 * expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.
+		 * NOT_CERTIFIED_CHECKOUT).toString());
+		 * expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().
+		 * toString()); expectedResourceAuditJavaObject.setDesc(auditDesc);
+		 * 
+		 * AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+		 * auditAction, null);
+		 */
+
+	}
+
+	@Test
+	public void createServiceAlreadyExistException() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// create service with the same name
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+
+		List<String> variables = Arrays.asList("Service", serviceDetails.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void createServiceWrongContactId() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setContactId("123as");
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		ErrorInfo errorInfo = ErrorValidationUtils
+				.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_CONTACT.name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+	}
+
+	@Test
+	public void createServiceProjectName() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setProjectCode("12345");
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		Integer expectedCode = 201;
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", expectedCode, restResponse.getErrorCode());
+		Service service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
+
+		assertEquals("12345", service.getProjectCode());
+	}
+
+	@Test
+	public void createAndGetByNameAndVersion() throws Exception {
+
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		// create
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		assertEquals("Check response code after create service", 201, restResponse.getErrorCode().intValue());
+
+		// get
+		restResponse = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails, serviceDetails.getName(),
+				serviceBaseVersion);
+		assertEquals("Check response code after get service", 200, restResponse.getErrorCode().intValue());
+
+		Service service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
+		String uniqueId = service.getUniqueId();
+		serviceDetails.setUniqueId(uniqueId);
+		ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, service, sdncUserDetails,
+				(LifecycleStateEnum) null);
+	}
+
+	//// US553874
+
+	@JsonIgnore
+	@Test
+	public void createServiceIsVNF_isFalse() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after updating Interface Artifact", 201,
+				restResponse.getErrorCode().intValue());
+
+		// get service and verify that service created with isVNF defined in
+		// serviceDetails
+		RestResponse serviceByNameAndVersion = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+				serviceDetails.getName(), serviceBaseVersion);
+		Service serviceObject = ResponseParser
+				.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, serviceObject, sdncUserDetails,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@JsonIgnore
+	@Test
+	public void createServiceIsVNF_isTrue() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after updating Interface Artifact", 201,
+				restResponse.getErrorCode().intValue());
+
+		// get service and verify that service created with isVNF defined in
+		// serviceDetails
+		RestResponse serviceByNameAndVersion = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+				serviceDetails.getName(), serviceBaseVersion);
+		Service serviceObject = ResponseParser
+				.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, serviceObject, sdncUserDetails,
+				LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+
+		// validate audit
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@JsonIgnore
+	@Test(enabled = false)
+	public void createServiceIsVNF_isNull() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		// clean audit DB before service creation
+		DbUtils.cleanAllAudits();
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertEquals("Check response code after updating Interface Artifact", 400,
+				restResponse.getErrorCode().intValue());
+		List<String> variables = Arrays.asList("VNF Service Indicator");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_DATA.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc("VNF Service Indicator"));
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+	}
+
+	@JsonIgnore
+	@Test(enabled = false)
+	public void createServiceEmptyIsVNF() throws Exception {
+
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+
+		DbUtils.cleanAllAudits();
+
+		// send create service toward BE
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", restResponse.getErrorCode(),
+				restResponse.getErrorCode());
+
+		// validate create service response vs actual
+		List<String> variables = Arrays.asList("VNF Service Indicator");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_DATA.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, serviceBaseVersion, sdncUserDetails);
+
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setAction(auditAction);
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	private RestResponse createServiceWithMissingAttribute(String serviceDetails, User sdncModifierDetails)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = ServiceRestUtils.prepareHeadersMap(sdncModifierDetails, false);
+		headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort());
+		// TODO: ADD AUTHENTICATION IN REQUEST
+		logger.debug(url);
+		logger.debug("Send POST request to create service: {}", url);
+		logger.debug("Service body: {}", serviceDetails);
+		logger.debug("Service headers: {}", headersMap);
+		RestResponse sendCreateUserRequest = http.httpSendPost(url, serviceDetails, headersMap);
+
+		return sendCreateUserRequest;
+
+	}
+
+	@JsonIgnore
+	@Test(enabled = false)
+	public void createServiceVersion_isVNFDoesNotExistInJson() throws Exception {
+
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		// clean audit DB before updating service
+		DbUtils.cleanAllAudits();
+
+		// remove isVNF from json sent to create service
+		JSONObject jObject = new JSONObject(serviceDetails);
+		jObject.remove("VNF");
+
+		// send create service toward BE
+		RestResponse restResponse = createServiceWithMissingAttribute(jObject.toString(), sdncUserDetails);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after updating Interface Artifact", 400,
+				restResponse.getErrorCode().intValue());
+		List<String> variables = new ArrayList<String>();
+		variables.add("VNF Service Indicator");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_DATA.name(), variables,
+				restResponse.getResponse());
+
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils
+				.constructFieldsForAuditValidation(serviceDetails, "0.1", sdncUserDetails);
+		String auditAction = "Create";
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		// expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc("VNF Service Indicator"));
+		AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
+
+	}
+
+	@Test
+	public void checkInvariantUuidIsImmutable() throws Exception {
+		// choose the user to create service
+		User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		Component resourceDetailsVFCcomp = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.ADMIN, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVFCcomp, UserRoleEnum.ADMIN,
+				true, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.ADMIN,
+				LifeCycleStatesEnum.CERTIFY, true);
+
+		// fill new service details
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		String invariantUuidDefinedByUser = "!!!!!!!!!!!!!!!!!!!!!!!!";
+		serviceDetails.setInvariantUUID(invariantUuidDefinedByUser);
+
+		// create service
+		RestResponse restResponseCreation = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		BaseRestUtils.checkStatusCode(restResponseCreation, "create request failed", false, 201);
+		Service service = ResponseParser.convertServiceResponseToJavaObject(restResponseCreation.getResponse());
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, service,
+				UserRoleEnum.ADMIN, true);
+
+		String invariantUUIDcreation = service.getInvariantUUID();
+
+		// validate get service response vs actual
+		RestResponse restResponseGetting = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
+		BaseRestUtils.checkSuccess(restResponseGetting);
+		service = ResponseParser.convertServiceResponseToJavaObject(restResponseGetting.getResponse());
+		String invariantUUIDgetting = service.getInvariantUUID();
+
+		assertEquals(invariantUUIDcreation, invariantUUIDgetting);
+
+		// Update service with new invariant UUID
+		RestResponse restResponseUpdate = ServiceRestUtils.updateService(serviceDetails, sdncUserDetails);
+		BaseRestUtils.checkSuccess(restResponseUpdate);
+		Service updatedService = ResponseParser.convertServiceResponseToJavaObject(restResponseUpdate.getResponse());
+		String invariantUUIDupdating = updatedService.getInvariantUUID();
+		assertEquals(invariantUUIDcreation, invariantUUIDupdating);
+
+		// Do checkin
+		RestResponse restResponseCheckin = LifecycleRestUtils.changeServiceState(serviceDetails, sdncUserDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		BaseRestUtils.checkSuccess(restResponseCheckin);
+		Service checkinService = ResponseParser.convertServiceResponseToJavaObject(restResponseCheckin.getResponse());
+		String invariantUUIDcheckin = checkinService.getInvariantUUID();
+		String version = checkinService.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcheckin);
+		assertEquals(version, "0.1");
+
+		// Do checkout
+		RestResponse restResponseCheckout = LifecycleRestUtils.changeServiceState(serviceDetails, sdncUserDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		BaseRestUtils.checkSuccess(restResponseCheckout);
+		Service checkoutService = ResponseParser.convertServiceResponseToJavaObject(restResponseCheckout.getResponse());
+		String invariantUUIDcheckout = checkoutService.getInvariantUUID();
+		version = checkoutService.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcheckout);
+		assertEquals(version, "0.2");
+
+		// do certification request
+		RestResponse restResponseCertificationRequest = LifecycleRestUtils.changeServiceState(serviceDetails,
+				sdncUserDetails, serviceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		BaseRestUtils.checkSuccess(restResponseCertificationRequest);
+		Service certificationRequestService = ResponseParser
+				.convertServiceResponseToJavaObject(restResponseCertificationRequest.getResponse());
+		String invariantUUIDcertificationRequest = certificationRequestService.getInvariantUUID();
+		version = certificationRequestService.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcertificationRequest);
+		assertEquals(version, "0.2");
+
+		// start certification
+		RestResponse restResponseStartCertification = LifecycleRestUtils.changeServiceState(serviceDetails,
+				sdncUserDetails, serviceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		BaseRestUtils.checkSuccess(restResponseStartCertification);
+		Service startCertificationRequestService = ResponseParser
+				.convertServiceResponseToJavaObject(restResponseStartCertification.getResponse());
+		String invariantUUIDStartCertification = startCertificationRequestService.getInvariantUUID();
+		version = startCertificationRequestService.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDStartCertification);
+		assertEquals(version, "0.2");
+
+		// certify
+		RestResponse restResponseCertify = LifecycleRestUtils.changeServiceState(serviceDetails, sdncUserDetails,
+				serviceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
+		BaseRestUtils.checkSuccess(restResponseCertify);
+		Service certifyService = ResponseParser.convertServiceResponseToJavaObject(restResponseCertify.getResponse());
+		String invariantUUIDcertify = certifyService.getInvariantUUID();
+		version = certifyService.getVersion();
+		assertEquals(invariantUUIDcreation, invariantUUIDcertify);
+		assertEquals(version, "1.0");
+
+	}
+
+	// US672129 Benny
+	private void getServiceValidateInvariantUuid(String serviceUniqueId, String invariantUUIDcreation)
+			throws Exception {
+		RestResponse getService = ServiceRestUtils.getService(serviceUniqueId,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, getService.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(getService));
+	}
+
+	@Test // invariantUUID generated when the component is created and never
+			// changed
+	public void serviceInvariantUuid() throws Exception {
+		User designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		User testerUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		User pmUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		Component resourceDetailsVFCcomp = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				true, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+		// create service
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setInvariantUUID("123456");
+		RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
+		assertEquals("Check response code after create resource", BaseRestUtils.STATUS_CODE_CREATED,
+				restResponse.getErrorCode().intValue());
+		Service service = ResponseParser.parseToObjectUsingMapper(restResponse.getResponse(), Service.class);
+		// invariantUUID generated when the component is created and never
+		// changed
+		String invariantUUIDcreation = ResponseParser.getInvariantUuid(restResponse);
+		// Add VF instance to service
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, service,
+				UserRoleEnum.DESIGNER, true);
+		// get resource and verify InvariantUuid is not changed
+		getServiceValidateInvariantUuid(service.getUniqueId(), invariantUUIDcreation);
+
+		// Update service with new invariant UUID
+		restResponse = ServiceRestUtils.updateService(serviceDetails, designerUser);
+		assertEquals("Check response code after create resource", BaseRestUtils.STATUS_CODE_SUCCESS,
+				restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// Checkin
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKIN);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// Checkout
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// certification request
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// start certification
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// certify
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, testerUser, LifeCycleStatesEnum.CERTIFY);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// update resource
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		serviceDetails.setDescription("updatedDescription");
+		restResponse = ServiceRestUtils.updateService(serviceDetails, designerUser);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// certification request
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// Checkout
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// certification request
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// start certification
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// cancel certification
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, testerUser,
+				LifeCycleStatesEnum.CANCELCERTIFICATION);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// start certification
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, testerUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// failure
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, testerUser,
+				LifeCycleStatesEnum.FAILCERTIFICATION);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// Checkout
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// Checkin
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKIN);
+		assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
+		assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+		// create instance
+		ProductReqDetails productDetails = ElementFactory.getDefaultProduct();
+		RestResponse createProductResponse = ProductRestUtils.createProduct(productDetails, pmUser);
+		assertEquals(BaseRestUtils.STATUS_CODE_CREATED, createProductResponse.getErrorCode().intValue());
+		ComponentInstanceReqDetails serviceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(serviceDetails);
+		RestResponse createServiceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				serviceInstanceReqDetails, pmUser, productDetails.getUniqueId(), ComponentTypeEnum.PRODUCT);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_CREATED,
+				createServiceInstanceResponse.getErrorCode().intValue());
+		getServiceValidateInvariantUuid(serviceDetails.getUniqueId(), invariantUUIDcreation);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java
new file mode 100644
index 0000000..3460cd6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java
@@ -0,0 +1,351 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cassandra.transport.Event.SchemaChange.Target;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class GetAllServiceVersions extends ComponentBaseTest {
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected User sdncDesignerDetails;
+	protected User sdncDesignerDetails2;
+	protected User sdncAdminDetails;
+	protected User sdncGovernorDeatails;
+	protected User sdncTesterDetails;
+	protected User sdncOpsDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails;
+	protected Component resourceDetailsVFCcomp;
+	protected Service serviceServ;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetAllServiceVersions() {
+		super(name, GetAllServiceVersions.class.getName());
+		;
+	}
+
+	@BeforeMethod
+	public void setUp() throws Exception {
+
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncGovernorDeatails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+		sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncOpsDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+		resourceDetailsVFCcomp = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				true, true);
+
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+		serviceServ = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, serviceServ,
+				UserRoleEnum.DESIGNER, true);
+
+		serviceDetails = new ServiceReqDetails(serviceServ);
+
+	}
+
+	@Test
+	public void GetAllServiceVersions_Version05() throws Exception {
+
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+			origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		}
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+
+	}
+
+	@Test
+	public void GetAllServiceVersions_Version01() throws Exception {
+
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_Version15() throws Exception {
+		// addMandatoryArtifactsToService();
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+		}
+
+		RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+		// serviceServ.setUniqueId(serviceDetails.getUniqueId());
+		// RestResponse changeServiceState =
+		// AtomicOperationUtils.changeComponentState(serviceServ,
+		// UserRoleEnum.ADMIN, LifeCycleStatesEnum.CERTIFY, false).getRight();
+
+		assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
+				changeServiceState.getErrorCode() == 200);
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		for (int x = 0; x < 5; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		}
+
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_Version25() throws Exception {
+		// addMandatoryArtifactsToService();
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+		}
+
+		// getting to version 1.0
+		RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+		assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
+				changeServiceState.getErrorCode() == 200);
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		// getting to version 1.5
+		for (int x = 0; x < 5; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+		}
+
+		// getting to version 2.0
+		changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+		assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
+				changeServiceState.getErrorCode() == 200);
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		// getting to version 2.5
+		for (int x = 0; x < 5; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+			origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+		}
+
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_ReadyForCertification_version05() throws Exception {
+		// addMandatoryArtifactsToService();
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+			origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+		}
+
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_CertifactionInProgress_version05() throws Exception {
+		// addMandatoryArtifactsToService();
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+			origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+		}
+
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_Certified_version10() throws Exception {
+		// addMandatoryArtifactsToService();
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		// get to version 0.5
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+
+		}
+
+		// get version 1.0
+		RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+		assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
+				changeServiceState.getErrorCode() == 200);
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_Certified_version20() throws Exception {
+		// addMandatoryArtifactsToService();
+		Map<String, String> origVersionsMap = new HashMap<String, String>();
+		// get to version 0.5
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+		}
+
+		// get version 1.0
+		RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+		assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
+				changeServiceState.getErrorCode() == 200);
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		// get version 1.5
+		for (int x = 0; x < 4; x++) {
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKIN);
+			LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+					LifeCycleStatesEnum.CHECKOUT);
+		}
+
+		// get version 2.0
+		changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+		assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
+				changeServiceState.getErrorCode() == 200);
+		origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
+
+		// validate get response
+		RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
+		Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
+		Map<String, String> getVersionsMap = res.getAllVersions();
+		assertTrue(origVersionsMap.equals(getVersionsMap));
+	}
+
+	@Test
+	public void GetAllServiceVersions_ServiceNotFound() throws Exception {
+
+		RestResponse serviceGetResponse = ServiceRestUtils.getService("123456789", sdncAdminDetails);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name());
+		assertEquals("Check response code after get service without cache", errorInfo.getCode(),
+				serviceGetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList("123456789");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), variables,
+				serviceGetResponse.getResponse());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java
new file mode 100644
index 0000000..5642ce4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java
@@ -0,0 +1,371 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.http.HttpStatus;
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.openecomp.sdc.common.datastructure.Wrapper;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
+import fj.data.Either;
+
+public class GetComponentAuditApiTest extends ComponentBaseTest {
+
+	public static final String SERVICES_API = "services";
+	public static final String RESOURCES_API = "resources";
+
+	protected User sdncAdminUser;
+	protected User sdncDesignerUser;
+	protected User sdncTesterUser;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetComponentAuditApiTest() {
+		super(name, GetComponentAuditApiTest.class.getName());
+	}
+
+	// in case tests fail, run this method as test to create mapping in ES
+	public void updateElasticSearchMapping() throws IOException {
+		Either<String, Exception> fileContentUTF8 = FileUtils
+				.getFileContentUTF8("src\\test\\resources\\CI\\other\\mapping.json");
+		AssertJUnit.assertTrue(fileContentUTF8.isLeft());
+
+		final String ES_TEMPLATE_URL = "http://%s:%s/_template/audit_template";
+		String url = String.format(ES_TEMPLATE_URL, config.getEsHost(), config.getEsPort());
+
+		RestResponse sendHttpPost = new HttpRequest().sendHttpPost(url, fileContentUTF8.left().value(), null);
+		AssertJUnit.assertTrue(sendHttpPost.getErrorCode() == HttpStatus.SC_OK);
+	}
+
+	@BeforeMethod
+	public void init() {
+		sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncDesignerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncTesterUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		;
+
+	}
+
+	@Test
+	public void testServiceAuditCertifiedVersion() throws Exception {
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		Wrapper<String> versionZeroOneIDWrapper = new Wrapper<String>(),
+				versionZeroTwoIDWrapper = new Wrapper<String>();
+
+		createBasicServiceForAudit(versionZeroOneIDWrapper, versionZeroTwoIDWrapper, serviceDetails, true);
+		// First Certification
+
+		LifecycleRestUtils.certifyService(serviceDetails);
+		// LCSbaseTest.certifyService(serviceDetails);
+		AssertJUnit.assertTrue(serviceDetails.getVersion().equals("1.0"));
+
+		// Second Certification
+		increaseServiceVersion(serviceDetails, "1.1");
+		increaseServiceVersion(serviceDetails, "1.2");
+		increaseServiceVersion(serviceDetails, "1.3");
+		increaseServiceVersion(serviceDetails, "1.4");
+		LifecycleRestUtils.certifyService(serviceDetails);
+		AssertJUnit.assertTrue(serviceDetails.getVersion().equals("2.0"));
+		String certifiedId = serviceDetails.getUniqueId();
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser, LifeCycleStatesEnum.CHECKOUT);
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser, LifeCycleStatesEnum.CHECKIN);
+
+		JsonElement element = getAuditJson(SERVICES_API, certifiedId);
+		// audits kept: 5*check ins + 4*check outs + 2*artifact payload
+		// updates(tosca) + certification request + certification start +
+		// certification success
+		// + 3 A&AI(ArtifactDelete, ArtifactUpload, ArtifactUpdate)
+		List<String> actions = new ArrayList<>();
+		JsonArray jsonArray = element.getAsJsonArray();
+		for( int i =0 ; i < jsonArray.size(); i++){
+			actions.add(jsonArray.get(i).getAsJsonObject().get(AuditingFieldsKeysEnum.AUDIT_ACTION.getDisplayName()).getAsString());
+		}
+		long checkinCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CHECKIN_RESOURCE.getName())).count();
+		assertTrue(checkinCount == 5);
+		
+		long checkOutCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CHECKOUT_RESOURCE.getName())).count();
+		assertTrue(checkOutCount == 4);
+		
+		long certificationRequestCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CERTIFICATION_REQUEST_RESOURCE.getName())).count();
+		assertTrue(certificationRequestCount == 1);
+		
+		long certificationStartCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.START_CERTIFICATION_RESOURCE.getName())).count();
+		assertTrue(certificationStartCount == 1);
+		
+		long certificationSuccessCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CERTIFICATION_SUCCESS_RESOURCE.getName())).count();
+		assertTrue(certificationSuccessCount == 1);
+		
+
+	}
+
+	protected void certifyResource(ResourceReqDetails defaultResource) throws IOException {
+		RestResponse response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		response = LifecycleRestUtils.changeResourceState(defaultResource, sdncTesterUser,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		response = LifecycleRestUtils.changeResourceState(defaultResource, sdncTesterUser, LifeCycleStatesEnum.CERTIFY);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+	}
+
+	protected JsonElement getAuditJson(String componentType, String componentId) throws IOException {
+		Map<String, String> headers = new HashMap<String, String>() {
+			{
+				put(Constants.USER_ID_HEADER, UserRoleEnum.ADMIN.getUserId());
+			}
+		};
+		String url = String.format(Urls.GET_COMPONENT_AUDIT_RECORDS, config.getCatalogBeHost(),
+				config.getCatalogBePort(), componentType, componentId);
+
+		RestResponse httpSendGet = new HttpRequest().httpSendGet(url, headers);
+		AssertJUnit.assertTrue(httpSendGet.getErrorCode() == HttpStatus.SC_OK);
+		JsonElement element = ResponseParser.parseToObject(httpSendGet.getResponse(), JsonElement.class);
+		AssertJUnit.assertTrue(element.isJsonArray());
+		return element;
+	}
+
+	protected void createBasicServiceForAudit(Wrapper<String> versionZeroOneIDWrapper,
+			Wrapper<String> versionZeroTwoIDWrapper, ServiceReqDetails serviceDetails, Boolean withResInst)
+			throws Exception {
+
+		User designerUser = sdncDesignerUser;
+
+		RestResponse response = ServiceRestUtils.createService(serviceDetails, designerUser);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_CREATED);
+		versionZeroOneIDWrapper.setInnerElement(serviceDetails.getUniqueId());
+
+		if (withResInst) {
+			Resource resourceObj = AtomicOperationUtils
+					.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+			AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceObj, UserRoleEnum.DESIGNER, true,
+					true);
+			AtomicOperationUtils.changeComponentState(resourceObj, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY,
+					true);
+			ResourceReqDetails resource = new ResourceReqDetails(resourceObj);
+			ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
+			resourceInstanceReqDetails.setComponentUid(resource.getUniqueId());
+			ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncDesignerUser,
+					serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+
+			// ServiceUtils.createCertResourceWithDeploymentArt(serviceDetails,
+			// "myResource");
+		}
+
+		response = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		AssertJUnit.assertTrue(serviceDetails.getVersion().equals("0.1"));
+
+		response = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKOUT);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		// ServiceUtils.addServiceDeploymentArtifact(serviceDetails.getUniqueId(),
+		// designerUser);
+		versionZeroTwoIDWrapper.setInnerElement(serviceDetails.getUniqueId());
+		AssertJUnit.assertTrue(serviceDetails.getVersion().equals("0.2"));
+		response = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+
+		increaseServiceVersion(serviceDetails, "0.3");
+
+		increaseServiceVersion(serviceDetails, "0.4");
+
+		increaseServiceVersion(serviceDetails, "0.5");
+
+	}
+
+	protected void increaseServiceVersion(ServiceReqDetails serviceDetails, String excpectedVersion) throws Exception {
+		RestResponse response = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		AssertJUnit.assertTrue(serviceDetails.getVersion().equals(excpectedVersion));
+		response = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser, LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+	}
+
+	protected void createBasicResourceForAudit(Wrapper<String> versionOnePointTwoIDWrapper,
+			ResourceReqDetails defaultResource) throws Exception {
+
+		RestResponse response = ResourceRestUtils.createResource(defaultResource, sdncDesignerUser);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_CREATED);
+
+		// ArtifactDefinition artifactDef = new
+		// ArtifactUtils().constructDefaultArtifactInfo();
+		// response = resourceUtils.add_artifact(defaultResource,
+		// sdncDesignerUser, defaultResource.getVersion(), artifactDef);
+		// assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerUser,
+				defaultResource.getUniqueId());
+		AssertJUnit.assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
+				LifeCycleStatesEnum.CHECKIN);
+
+		increaseResourceVersion(defaultResource, "0.2");
+
+		increaseResourceVersion(defaultResource, "0.3");
+
+		increaseResourceVersion(defaultResource, "0.4");
+
+		increaseResourceVersion(defaultResource, "0.5");
+
+		certifyResource(defaultResource);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		AssertJUnit.assertTrue(defaultResource.getVersion().equals("1.0"));
+
+		increaseResourceVersion(defaultResource, "1.1");
+
+		increaseResourceVersion(defaultResource, "1.2");
+		versionOnePointTwoIDWrapper.setInnerElement(defaultResource.getUniqueId());
+
+		increaseResourceVersion(defaultResource, "1.3");
+
+		increaseResourceVersion(defaultResource, "1.4");
+
+	}
+
+	protected void increaseResourceVersion(ResourceReqDetails defaultResource, String expectedVersion)
+			throws IOException {
+		RestResponse response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
+				LifeCycleStatesEnum.CHECKOUT);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+		AssertJUnit.assertTrue(defaultResource.getVersion().equals(expectedVersion));
+		response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
+				LifeCycleStatesEnum.CHECKIN);
+		AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
+	}
+
+	@Test
+	public void testServiceAuditLastUncertifiedVersion() throws Exception {
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		Wrapper<String> versionZeroOneIDWrapper = new Wrapper<String>(),
+				versionZeroTwoIDWrapper = new Wrapper<String>();
+
+		createBasicServiceForAudit(versionZeroOneIDWrapper, versionZeroTwoIDWrapper, serviceDetails, false);
+
+		JsonElement element = getAuditJson(SERVICES_API, versionZeroTwoIDWrapper.getInnerElement());
+
+		assertTrue(element.getAsJsonArray().size() == 3);
+
+	}
+
+	@Test
+	public void testServiceAuditFirstUncertifiedVersion() throws Exception {
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		Wrapper<String> versionZeroOneIDWrapper = new Wrapper<String>(),
+				versionZeroTwoIDWrapper = new Wrapper<String>();
+
+		createBasicServiceForAudit(versionZeroOneIDWrapper, versionZeroTwoIDWrapper, serviceDetails, false);
+
+		JsonElement element = getAuditJson(SERVICES_API, versionZeroOneIDWrapper.getInnerElement());
+
+		assertTrue(element.getAsJsonArray().size() == 3);
+
+	}
+
+	@Test
+	public void testResourceAuditUncertifiedVersion() throws Exception {
+
+		ResourceReqDetails defaultResource = ElementFactory.getDefaultResource();
+		Wrapper<String> versionOnePointTwoIDWrapper = new Wrapper<String>();
+
+		createBasicResourceForAudit(versionOnePointTwoIDWrapper, defaultResource);
+
+		JsonElement element = getAuditJson(RESOURCES_API, versionOnePointTwoIDWrapper.getInnerElement());
+
+		assertTrue(element.getAsJsonArray().size() == 3);
+
+	}
+
+	@Test
+	public void testResourceAuditCertifiedVersion() throws Exception {
+
+		ResourceReqDetails defaultResource = ElementFactory.getDefaultResource();
+		Wrapper<String> versionOnePointTwoIDWrapper = new Wrapper<String>();
+
+		createBasicResourceForAudit(versionOnePointTwoIDWrapper, defaultResource);
+
+		certifyResource(defaultResource);
+		assertTrue(defaultResource.getVersion().equals("2.0"));
+		String certifiedId = defaultResource.getUniqueId();
+
+		increaseResourceVersion(defaultResource, "2.1");
+
+		increaseResourceVersion(defaultResource, "2.2");
+
+		JsonElement element = getAuditJson(RESOURCES_API, certifiedId);
+
+		assertTrue(element.getAsJsonArray().size() == 13);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java
new file mode 100644
index 0000000..55ecf69
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetServiceLatestVersionTest.java
@@ -0,0 +1,685 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+
+public class GetServiceLatestVersionTest extends ComponentInstanceBaseTest {
+
+	protected ArtifactReqDetails heatArtifactDetails;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetServiceLatestVersionTest() {
+		super(name, GetServiceLatestVersionTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+		initMembers();
+		createAtomicResource(resourceDetailsVFC_01);
+		changeResourceStateToCertified(resourceDetailsVFC_01);
+		createAtomicResource(resourceDetailsCP_01);
+		changeResourceStateToCertified(resourceDetailsCP_01);
+		createAtomicResource(resourceDetailsVL_01);
+		changeResourceStateToCertified(resourceDetailsVL_01);
+		createVF(resourceDetailsVF_01);
+		certifyVf(resourceDetailsVF_01);
+		createService(serviceDetails_01);
+		createService(serviceDetails_02);
+		createService(serviceDetails_03);
+		createProduct(productDetails_01);
+		createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails); // create
+																									// certified
+																									// VF
+																									// instance
+																									// in
+																									// service
+		/*
+		 * RestResponse restResponse =
+		 * LifecycleRestUtils.changeServiceState(serviceDetails_01,
+		 * sdncDesignerDetails, LifeCycleStates.CHECKIN);
+		 * ResourceRestUtils.checkSuccess(restResponse);
+		 */
+	}
+
+	public void initMembers() throws Exception {
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		sdncPsDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
+		sdncPmDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		resourceDetailsVFC_01 = ElementFactory.getDefaultResourceByType("VFC100", NormativeTypesEnum.COMPUTE,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VFC.toString()); // resourceType = VFC
+		resourceDetailsVF_01 = ElementFactory.getDefaultResourceByType("VF100", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		resourceDetailsCP_01 = ElementFactory.getDefaultResourceByType("CP100", NormativeTypesEnum.PORT,
+				ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.CP.toString());
+		resourceDetailsVL_01 = ElementFactory.getDefaultResourceByType("VL100", NormativeTypesEnum.NETWORK,
+				ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VL.toString());
+		serviceDetails_01 = ElementFactory.getDefaultService("newtestservice1", ServiceCategoriesEnum.MOBILITY,
+				sdncDesignerDetails.getUserId());
+		serviceDetails_02 = ElementFactory.getDefaultService("newtestservice2", ServiceCategoriesEnum.MOBILITY,
+				sdncDesignerDetails.getUserId());
+		serviceDetails_03 = ElementFactory.getDefaultService("newtestservice3", ServiceCategoriesEnum.MOBILITY,
+				sdncDesignerDetails.getUserId());
+		productDetails_01 = ElementFactory.getDefaultProduct("product01");
+	}
+
+	@Test
+	public void getServicesLatestVersionServiceInCheckOutState() throws Exception {
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncPsDetails1);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertNull("No Service returned, one service in checkout state 0.1", servcieFromList);
+	}
+
+	@Test
+	public void getServicesLatestVersionServiceInCheckInState() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncPsDetails1);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.1"));
+	}
+
+	@Test
+	public void getServicesLatestVersionByPm() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncPmDetails1);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.1"));
+	}
+
+	@Test
+	public void getServicesLatestVersionByAdmin() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncAdminDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.1"));
+	}
+
+	@Test
+	public void getServicesLatestVersionService02CheckOutState() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		String serviceUniqueID = ResponseParser.getUniqueIdFromResponse(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceUniqueID);
+		assertTrue(servcieFromList.getVersion().equals("0.1"));
+		servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertNull(servcieFromList);
+	}
+
+	@Test
+	public void getServicesLatestVersionService02CheckInState() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.2"));
+	}
+
+	@Test
+	public void getServicesLatestVersionServiceWaitingForCertification() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.2"));
+	}
+
+	@Test
+	public void getServicesLatestVersionServiceCertificationInProgress() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.2"));
+	}
+
+	@Test
+	public void getServicesLatestVersionServiceCertificationFail() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.FAILCERTIFICATION);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.2"));
+	}
+
+	@Test
+	public void getServicesLatestVersionServiceCertifed() throws Exception {
+		certifyService(serviceDetails_01);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("1.0"));
+	}
+
+	@Test
+	public void getLatestVersionServiceHasSeveralCertifedVersion_01() throws Exception {
+		RestResponse certifyServiceResponse;
+		String serviceUniqueIdFromResponse = null;
+		int numberOfCertifiedService = 3;
+		for (int i = 0; i < numberOfCertifiedService; i++) {
+			certifyServiceResponse = certifyService(serviceDetails_01);
+			ServiceRestUtils.checkSuccess(certifyServiceResponse);
+			if (i == (numberOfCertifiedService - 1)) {
+				serviceUniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(certifyServiceResponse);
+			}
+			RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+					LifeCycleStatesEnum.CHECKOUT);
+			ServiceRestUtils.checkSuccess(restResponse);
+		}
+		// We have service with following versions : 1.0, 2.0 ,3.0 and
+		// 3.1(checkedOut)
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceUniqueIdFromResponse);
+		assertTrue(servcieFromList.getVersion().equals("3.0"));
+	}
+
+	@Test
+	public void getLatestVersionServiceHasSeveralCertifedVersions02() throws Exception {
+		RestResponse certifyServiceResponse;
+		certifyServiceResponse = certifyService(serviceDetails_01);
+		ServiceRestUtils.checkSuccess(certifyServiceResponse);
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		certifyServiceResponse = certifyService(serviceDetails_01);
+		ServiceRestUtils.checkSuccess(certifyServiceResponse);
+		// We have service with following versions : 1.0, 2.0
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("2.0"));
+	}
+
+	@Test
+	public void getLatestVersionServiceCertifedWasCheckedOutAndCheckedin() throws Exception {
+		RestResponse certifyServiceResponse;
+		int numberOfCertifiedService = 3;
+		for (int i = 0; i < numberOfCertifiedService; i++) {
+			certifyServiceResponse = certifyService(serviceDetails_01);
+			ServiceRestUtils.checkSuccess(certifyServiceResponse);
+			RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+					LifeCycleStatesEnum.CHECKOUT);
+			ServiceRestUtils.checkSuccess(restResponse);
+		}
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		// We have service with following versions : 1.0, 2.0 and 2.1(checkedIn)
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("3.1"));
+	}
+
+	@Test
+	public void getLatestVersionServiceCheckOutCertifedService() throws Exception {
+		RestResponse restResponse;
+		String serviceUniqueIdFromResponse = null;
+		RestResponse certifyServiceResponse = certifyService(serviceDetails_01);
+		ServiceRestUtils.checkSuccess(certifyServiceResponse);
+		for (int i = 0; i < 11; i++) {
+			restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+					LifeCycleStatesEnum.CHECKOUT);
+			ServiceRestUtils.checkSuccess(restResponse);
+			restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+					LifeCycleStatesEnum.CHECKIN);
+			ServiceRestUtils.checkSuccess(restResponse);
+			if (i == (10)) {
+				serviceUniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(restResponse);
+			}
+		}
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		// We have service with following versions : 1.0 and 1.11(Check-out)
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceUniqueIdFromResponse);
+		assertTrue(servcieFromList.getVersion().equals("1.11"));
+	}
+
+	@Test
+	public void getLatestVersionServiceCheckOutCheckInCertifedService() throws Exception {
+		RestResponse restResponse;
+		String serviceUniqueIdFromResponse = null;
+		RestResponse certifyServiceResponse = certifyService(serviceDetails_01);
+		ServiceRestUtils.checkSuccess(certifyServiceResponse);
+		for (int i = 0; i < 12; i++) {
+			restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+					LifeCycleStatesEnum.CHECKOUT);
+			ServiceRestUtils.checkSuccess(restResponse);
+			restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+					LifeCycleStatesEnum.CHECKIN);
+			ServiceRestUtils.checkSuccess(restResponse);
+			if (i == (11)) {
+				serviceUniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(restResponse);
+			}
+		}
+		// We have service with following versions : 1.0 and 1.11(Check-out)
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceUniqueIdFromResponse);
+		assertTrue(servcieFromList.getVersion().equals("1.12"));
+	}
+
+	@Test
+	public void getLatestVersionServiceCertifedCheckedOutAndInWaitingForCertificationState() throws Exception {
+		certifyService(serviceDetails_01); // 1.0
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ServiceRestUtils.checkSuccess(restResponse);
+		// We have service with following versions : 1.0 and 1.1(Waiting For
+		// Certification)
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("1.1"));
+	}
+
+	@Test
+	public void getLatestVersionServiceCertifedCheckedOutAndInCertificationInProgressState() throws Exception {
+		certifyService(serviceDetails_01); // 1.0
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncTesterDetails,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		ServiceRestUtils.checkSuccess(restResponse);
+		// We have service with following versions : 1.0 and 1.1(Certification
+		// In Progress)
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("1.1"));
+	}
+
+	// DE190818
+	@Test(enabled = false)
+	public void getLatestVersionByNonAsdcUser() throws Exception {
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		nonAsdcUser.setUserId("gg750g");
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(nonAsdcUser);
+		assertTrue(getServicesLatestVersion.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				getServicesLatestVersion.getResponse());
+	}
+
+	// DE190818
+	@Test(enabled = false)
+	public void getLatestVersionUserIdIsEmpty() throws Exception {
+		User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		nonAsdcUser.setUserId("");
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(nonAsdcUser);
+		assertTrue(getServicesLatestVersion.getErrorCode() == STATUS_CODE_RESTRICTED_OPERATION);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), new ArrayList<String>(),
+				getServicesLatestVersion.getResponse());
+	}
+
+	@Test
+	public void getServicesLatestVersionByTester() throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncTesterDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 1);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_01.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.1"));
+	}
+
+	@Test
+	public void getLatestVersionSeveralServicesInDifferentVersion() throws Exception {
+		RestResponse restResponse = certifyService(serviceDetails_01); // 1.0
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = certifyService(serviceDetails_01);
+		ServiceRestUtils.checkSuccess(restResponse);
+		String service1_UniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse); // serviceDetails_01
+														// version is 2.1
+														// (check-out)
+
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_02, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_02, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_02, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse); // serviceDetails_02
+														// version 0.2
+														// (Check-in)
+
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_03, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		String service3_UniqueIdFromResponse = ResponseParser.getUniqueIdFromResponse(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails_03, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse); // serviceDetails_03
+														// version 0.2
+														// (Check-out)
+
+		RestResponse getServicesLatestVersion = ServiceRestUtils.getServiceLatestVersionList(sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(getServicesLatestVersion);
+		List<Service> serviceList = restResponseToResourceObjectList(getServicesLatestVersion);
+		assertTrue(serviceList.size() == 3);
+		Service servcieFromList = getResourceObjectFromResourceListByUid(serviceList, service1_UniqueIdFromResponse);
+		assertTrue(servcieFromList.getVersion().equals("2.0"));
+		servcieFromList = getResourceObjectFromResourceListByUid(serviceList, serviceDetails_02.getUniqueId());
+		assertTrue(servcieFromList.getVersion().equals("0.2"));
+		servcieFromList = getResourceObjectFromResourceListByUid(serviceList, service3_UniqueIdFromResponse);
+		assertTrue(servcieFromList.getVersion().equals("0.1"));
+	}
+
+	///////////////////////////////////////////////////////////////
+	private RestResponse certifyService(ServiceReqDetails serviceDetails) throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKOUT);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDetails,
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		ServiceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDetails,
+				LifeCycleStatesEnum.CERTIFY);
+		ServiceRestUtils.checkSuccess(restResponse);
+		return restResponse;
+	}
+
+	protected List<Service> restResponseToResourceObjectList(RestResponse restResponse) {
+		JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
+		JsonArray jsonArray = jelement.getAsJsonArray();
+		List<Service> restResponseArray = new ArrayList<>();
+		Service service = null;
+		for (int i = 0; i < jsonArray.size(); i++) {
+			String serviceString = (String) jsonArray.get(i).toString();
+			service = ResponseParser.convertServiceResponseToJavaObject(serviceString);
+			restResponseArray.add(service);
+		}
+		return restResponseArray;
+	}
+
+	protected Service getResourceObjectFromResourceListByUid(List<Service> serviceList, String uid) {
+		if (serviceList != null && serviceList.size() > 0) {
+			for (Service service : serviceList) {
+				if (service.getUniqueId().equals(uid))
+					return service;
+			}
+		} else
+			return null;
+		return null;
+	}
+
+	private RestResponse changeResourceStateToCertified(ResourceReqDetails resourceDetails) throws Exception {
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterDetails,
+					LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponse;
+		if (restResponse.getErrorCode() == 200) {
+			restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterDetails,
+					LifeCycleStatesEnum.CERTIFY);
+			if (restResponse.getErrorCode() == 200) {
+				String newVersion = ResponseParser.getVersionFromResponse(restResponse);
+				resourceDetails.setVersion(newVersion);
+				resourceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
+				resourceDetails.setLastUpdaterUserId(sdncTesterDetails.getUserId());
+				resourceDetails.setLastUpdaterFullName(sdncTesterDetails.getFullName());
+				String uniqueIdFromRresponse = ResponseParser.getValueFromJsonResponse(restResponse.getResponse(),
+						"uniqueId");
+				resourceDetails.setUniqueId(uniqueIdFromRresponse);
+			}
+		}
+		return restResponse;
+	}
+
+	// private void certifyVf(ResourceReqDetails resource) throws Exception {
+	// RestResponse createAtomicResourceInstance =
+	// createAtomicInstanceForVFDuringSetup(resource, resourceDetailsVFC_01,
+	// sdncDesignerDetails);
+	// ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+	// createAtomicResourceInstance =
+	// createAtomicInstanceForVFDuringSetup(resource, resourceDetailsCP_01,
+	// sdncDesignerDetails);
+	// ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+	// createAtomicResourceInstance =
+	// createAtomicInstanceForVFDuringSetup(resource, resourceDetailsVL_01,
+	// sdncDesignerDetails);
+	// ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+	// //createVFInstanceDuringSetup(service, resource, sdncDesignerDetails);
+	// RestResponse response =
+	// ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails,
+	// sdncDesignerDetails, resource.getUniqueId());
+	// ResourceRestUtils.checkSuccess(response);
+	// RestResponse changeResourceStateToCertified =
+	// changeResourceStateToCertified(resource);
+	// ResourceRestUtils.checkSuccess(changeResourceStateToCertified);
+	// }
+
+	private void certifyVf(ResourceReqDetails resource) throws Exception {
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String cpCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, resourceDetailsVFC_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String computeCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resource, resourceDetailsVL_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String vlCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		// Fixing Vl/Cp req/cap
+		ComponentTypeEnum containerCompType = ComponentTypeEnum.RESOURCE;
+		User user = sdncDesignerDetails;
+		fulfillCpRequirement(resource, cpCompInstId, computeCompInstId, computeCompInstId, user, containerCompType);
+		consumeVlCapability(resource, cpCompInstId, vlCompInstId, cpCompInstId, user, containerCompType);
+
+		RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails,
+				sdncDesignerDetails, resource.getUniqueId());
+		ResourceRestUtils.checkSuccess(response);
+		RestResponse changeResourceStateToCertified = changeResourceStateToCertified(resource);
+		ResourceRestUtils.checkSuccess(changeResourceStateToCertified);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java
new file mode 100644
index 0000000..c21deaf
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ReqCapOccurrencesTest.java
@@ -0,0 +1,1191 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.http.client.ClientProtocolException;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.RelationshipImpl;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+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.User;
+import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.ImportUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class ReqCapOccurrencesTest extends ComponentInstanceBaseTest {
+
+	private ImportReqDetails importReqDetails1; // atomic resource
+	private ImportReqDetails importReqDetails2;
+	private ImportReqDetails importReqDetails3;
+	private ImportReqDetails importReqDetails4;
+	private Resource resourceVFC1;
+	private Resource resourceVFC2;
+	private Resource resourceVFC3;
+	private Resource resourceVFC4;
+	private ResourceReqDetails resourceDetailsVF100;
+	private ResourceReqDetails resourceDetailsVF200;
+	private Resource resourceVF100;
+	private Resource resourceVF200;
+	protected String testResourcesPath;
+
+	protected final String importYmlWithReq11 = "softwareComponentReq11.yml";
+	protected final String importYmlWithReq12 = "softwareComponentReq12.yml";
+	protected final String importYmlWithCap11 = "computeCap11.yml";
+	protected final String importYmlWithCap1Unbounded = "computeCap1UNBOUNDED.yml";
+	protected final String capabilitiesAndRequirementsType = "tosca.capabilities.Container";
+
+	public ReqCapOccurrencesTest() {
+		super(new TestName(), ReqCapOccurrencesTest.class.getSimpleName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+		// Do not use call init() from ComponentInstanceBaseTest
+		expectedContainerCapabilities = new LinkedHashMap<String, List<CapabilityDefinition>>();
+		expectedContainerRequirements = new LinkedHashMap<String, List<RequirementDefinition>>();
+		removedRequirements = new HashMap<>();
+		expectedContInstReqCap = new HashMap<>();
+
+		RestResponse importResourceResponse;
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		// import yml file location
+		String sourceDir = config.getResourceConfigDir();
+		final String workDir = "importToscaResourceByCreateUrl";
+		testResourcesPath = sourceDir + File.separator + workDir;
+		///// Create atomic resources /////////////////////////
+		// import VFC1 with Requirements : MIN=1 MAX=2
+		///// (tosca.capabilities.Container)
+		importReqDetails1 = ElementFactory.getDefaultImportResource("VFC1");
+		importResourceResponse = importedResource(importReqDetails1, importYmlWithReq12);
+		// resourceVFC1 =
+		// ResponseParser.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(importReqDetails1, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		resourceVFC1 = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		// import VFC2 with Capabilities : MIN 1 MAX UNBOUNDED
+		// (tosca.capabilities.Container)
+		importReqDetails2 = ElementFactory.getDefaultImportResource("VFC2");
+		importResourceResponse = importedResource(importReqDetails2, importYmlWithCap1Unbounded);
+		// resourceVFC2 =
+		// ResponseParser.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		restResponse = LifecycleRestUtils.changeResourceState(importReqDetails2, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		resourceVFC2 = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		// import VFC3 with Capabilities : MIN 1 MAX 1
+		// (tosca.capabilities.Container)
+		importReqDetails3 = ElementFactory.getDefaultImportResource("VFC3");
+		importResourceResponse = importedResource(importReqDetails3, importYmlWithCap11);
+		// resourceVFC3 =
+		// ResponseParser.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		restResponse = LifecycleRestUtils.changeResourceState(importReqDetails3, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		resourceVFC3 = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		// import VFC4 with Requirements : MIN 1 MAX 1
+		// (tosca.capabilities.Container)
+		importReqDetails4 = ElementFactory.getDefaultImportResource("VFC4");
+		importResourceResponse = importedResource(importReqDetails4, importYmlWithReq11);
+		// resourceVFC4 =
+		// ResponseParser.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
+		restResponse = LifecycleRestUtils.changeResourceState(importReqDetails4, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		resourceVFC4 = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+
+		// create VF100
+		resourceDetailsVF100 = ElementFactory.getDefaultResourceByType("VF1000", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		RestResponse createResourceVF100 = ResourceRestUtils.createResource(resourceDetailsVF100, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceVF100);
+		// create VF200
+		resourceDetailsVF200 = ElementFactory.getDefaultResourceByType("VF2000", NormativeTypesEnum.ROOT,
+				ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
+				ResourceTypeEnum.VF.toString());
+		RestResponse createResourceVF200 = ResourceRestUtils.createResource(resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createResourceVF200);
+		// Create Service
+		serviceDetails_01 = ElementFactory.getDefaultService("newtestservice1", ServiceCategoriesEnum.MOBILITY,
+				sdncDesignerDetails.getUserId());
+		RestResponse createServiceRestResponse = ServiceRestUtils.createService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createServiceRestResponse);
+
+	}
+
+	// US628514 Capability/Requirement "Occurrences" attribute in CREATE/DELETE
+	// Relation APIs
+	// Container = SERVICE , Container instance = VF
+	@Test
+	public void capAndReqOccurrencesInServiceAndHisInstancesNoAssociation() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC1 (Req MIN=1 MAX=2) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC21 (Cap MIN=1 MAX=UNBOUNDED) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "1";
+		String containerMaxReq = "2";
+		String containerMinCap = "1";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+	}
+
+	@Test
+	public void serviceInstanceAssociationReqMaxOccurrencesNotReached() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC1 (Req MIN=1 MAX=2) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC2 (Cap MIN=1 MAX=UNBOUNDED) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VFs
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+	}
+
+	@Test
+	public void serviceInstanceAssociationReqMaxOccurrencesIsReached() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC4 (Req MIN=1 MAX=1) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails4, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC2 (Cap MIN=1 MAX=UNBOUNDED) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VFs
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "0";
+		String containerMinCap = "0";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+	}
+
+	@Test
+	public void associateServiceInstanceWhenReqMaxOccurrencesAlreadyReached() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC4 (Req MIN=1 MAX=1) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails4, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC2 (Cap MIN=1 MAX=UNBOUNDED) to VF2.00
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String vf1Name = ResponseParser.getValueFromJsonResponse(createVFInstResp.getResponse(), "name");
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String vf2Name = ResponseParser.getValueFromJsonResponse(createVFInstResp.getResponse(), "name");
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VFs
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		// associate same instances again - when requirement Max Occurrences
+		// reached
+		associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncDesignerDetails,
+				serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_NOT_FOUND,
+				associateInstances.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(vf1Name);
+		varibales.add(vf2Name);
+		varibales.add("host");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_MATCH_NOT_FOUND.name(), varibales,
+				associateInstances.getResponse());
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "0";
+		String containerMinCap = "0";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+	}
+
+	@Test
+	public void serviceInstanceAssociationCapMaxOccurrencesIsReached() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC1 (Req MIN=1 MAX=2) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC3 (Cap MIN=1 MAX=1) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VFs
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+	}
+
+	@Test
+	public void associationServiceInstanceWhenCapMaxOccurrencesAlreadyReached() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC1 (Req MIN=1 MAX=2) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC3 (Cap MIN=1 MAX=1) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		// RestResponse createVFInstResp = createVFInstance(serviceDetails_01,
+		// resourceDetailsVF100, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String vf1Name = ResponseParser.getValueFromJsonResponse(createVFInstResp.getResponse(), "name");
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		// createVFInstResp = createVFInstance(serviceDetails_01,
+		// resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String vf2Name = ResponseParser.getValueFromJsonResponse(createVFInstResp.getResponse(), "name");
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VFs
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+		// associate same instances again - when requirement Max Occurrences
+		// reached
+		associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncDesignerDetails,
+				serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_NOT_FOUND,
+				associateInstances.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(vf1Name);
+		varibales.add(vf2Name);
+		varibales.add("host");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND.name(),
+				varibales, associateInstances.getResponse());
+	}
+
+	@Test
+	public void associationAndDisassociateServiceInstancesWhenReqMaxOccurrencesAlreadyReached()
+			throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC4 (Req MIN=1 MAX=1) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails4, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC3 (Cap MIN=1 MAX=1) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		RestResponse createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+				sdncDesignerDetails);
+		// RestResponse createVFInstResp = createVFInstance(serviceDetails_01,
+		// resourceDetailsVF100, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		// createVFInstResp = createVFInstance(serviceDetails_01,
+		// resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VF Instances
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "0";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+		// Disassociate 2 VF Instances
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
+				dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF100.getUniqueId()).isEmpty());
+		// get service and verify Occurrences in container and container
+		// instance requirements and Capabilities
+		getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		containerMinReq = "1";
+		containerMaxReq = "1";
+		containerMinCap = "1";
+		containerMaxCap = "1";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+	}
+
+	@Test(enabled = false)
+	public void aaaa() throws Exception, Exception {
+		RestResponse getResourseRestResponse;
+		// Add instance of VFC1 (Req MIN=1 MAX=2) to VF1000
+		ComponentInstance componentInstanceReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceReq);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Add instance of VFC3 (Cap MIN=1 MAX=1) to VF2000
+		ComponentInstance componentInstanceCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF200);
+		assertNotNull(componentInstanceCap);
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF200.getUniqueId());
+		resourceVF200 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Check-In both VFs
+		RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF100, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		restResponse = LifecycleRestUtils.changeResourceState(resourceDetailsVF200, sdncDesignerDetails,
+				LifeCycleStatesEnum.CHECKIN);
+		ResourceRestUtils.checkSuccess(restResponse);
+		// Create VF instances
+		// RestResponse createVFInstResp =
+		// createVFInstanceDuringSetup(serviceDetails_01, resourceDetailsVF100,
+		// sdncDesignerDetails);
+		RestResponse createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF100, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String vf1Name = ResponseParser.getValueFromJsonResponse(createVFInstResp.getResponse(), "name");
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// createVFInstResp = createVFInstanceDuringSetup(serviceDetails_01,
+		// resourceDetailsVF200, sdncDesignerDetails);
+		createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF200, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String vf2Name = ResponseParser.getValueFromJsonResponse(createVFInstResp.getResponse(), "name");
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// associate 2 VFs
+		String capType = capabilitiesAndRequirementsType;
+		String reqName = "host";
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList, componentInstanceReq.getUniqueId(), componentInstanceCap.getUniqueId());
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+		// get service
+		RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkSuccess(getServiceResponse);
+		Service service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType, containerMinReq,
+				containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(service, capabilitiesAndRequirementsType,
+				resourceVF200, resourceVF100);
+		// associate same instances again - when requirement Max Occurrences
+		// reached
+		associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncDesignerDetails,
+				serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_NOT_FOUND,
+				associateInstances.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(vf1Name);
+		varibales.add(vf2Name);
+		varibales.add("host");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND.name(),
+				varibales, associateInstances.getResponse());
+	}
+
+	//////////////////////////////////////////////////////////////////////////////////////////////////
+	// US628514 Capability/Requirement "Occurrences" attribute in CREATE/DELETE
+	////////////////////////////////////////////////////////////////////////////////////////////////// Relation
+	////////////////////////////////////////////////////////////////////////////////////////////////// APIs
+	// Container = VF , Container instance = VFC
+	@Test
+	public void capAndReqOccurrencesInVfAndHisInstancesNoAssociation() throws Exception, Exception {
+		// Add VFC1 and VFC2 instances in VF
+		ComponentInstance createComponentInstance1 = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(createComponentInstance1);
+		ComponentInstance createComponentInstance2 = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(createComponentInstance2);
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "1";
+		String containerMaxReq = "2";
+		String containerMinCap = "1";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC2, resourceVFC1);
+	}
+
+	@Test
+	public void vfInstanceAssociationReqMaxOccurrencesNotReached() throws Exception, Exception {
+		// Add VFC1 (with Requirements: tosca.capabilities.Container, MIN=1
+		// MAX=2) instance to VF
+		ComponentInstance componentInstanceWithReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithReq);
+		// Add VFC2 (with Capabilities: tosca.capabilities.Container, MIN=1,
+		// MAX=UNBOUNDED ) instance to VF
+		ComponentInstance componentInstanceWithCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithCap);
+		// associate Instances
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap(resourceDetailsVF100);
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(componentInstanceWithReq,
+				componentInstanceWithCap, capReqDefBeforeAssociate);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF100.getUniqueId()));
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC2, resourceVFC1);
+
+	}
+
+	@Test
+	public void vfInstanceAssociationReqMaxOccurrencesIsReached() throws Exception, Exception {
+		// Add VFC4 (with Requirements: tosca.capabilities.Container, MIN=1
+		// MAX=1) instance to VF
+		ComponentInstance componentInstanceWithReq = createComponentInstance(importReqDetails4, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithReq);
+		// Add VFC2 (with Capabilities: tosca.capabilities.Container, MIN=1,
+		// MAX=UNBOUNDED ) instance to VF
+		ComponentInstance componentInstanceWithCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithCap);
+		// associate Instances
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap(resourceDetailsVF100);
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(componentInstanceWithReq,
+				componentInstanceWithCap, capReqDefBeforeAssociate);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF100.getUniqueId()));
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "0";
+		String containerMinCap = "0";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC2, resourceVFC4);
+	}
+
+	@Test
+	public void associateVfInstanceWhenReqMaxOccurrencesAlreadyReached() throws Exception, Exception {
+		// Add VFC4 (with Requirements: tosca.capabilities.Container, MIN=1
+		// MAX=1) instance to VF
+		ComponentInstance componentInstanceWithReq = createComponentInstance(importReqDetails4, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithReq);
+		// Add VFC2 (with Capabilities: tosca.capabilities.Container, MIN=1,
+		// MAX=UNBOUNDED ) instance to VF
+		ComponentInstance componentInstanceWithCap = createComponentInstance(importReqDetails2, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithCap);
+		// associate Instances
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap(resourceDetailsVF100);
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(componentInstanceWithReq,
+				componentInstanceWithCap, capReqDefBeforeAssociate);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF100.getUniqueId()));
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "0";
+		String containerMinCap = "0";
+		String containerMaxCap = "UNBOUNDED";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC2, resourceVFC4);
+		// associate same instances again - when requirement Max Occurrences
+		// reached
+		associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_NOT_FOUND,
+				associateInstances.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(componentInstanceWithReq.getName());
+		varibales.add(componentInstanceWithCap.getName());
+		varibales.add("host");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_MATCH_NOT_FOUND.name(), varibales,
+				associateInstances.getResponse());
+
+	}
+
+	@Test
+	public void vfInstanceAssociationCapMaxOccurrencesIsReached() throws Exception, Exception {
+		// Add VFC1 (with Requirements: tosca.capabilities.Container, MIN=1
+		// MAX=2) instance to VF
+		ComponentInstance componentInstanceWithReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithReq);
+		// Add VFC3 (with Capabilities: tosca.capabilities.Container, MIN=1
+		// MAX=1 ) instance to VF
+		ComponentInstance componentInstanceWithCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithCap);
+		// associate Instances
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap(resourceDetailsVF100);
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(componentInstanceWithReq,
+				componentInstanceWithCap, capReqDefBeforeAssociate);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF100.getUniqueId()));
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC3, resourceVFC1);
+	}
+
+	@Test
+	public void associationVfInstanceWhenCapMaxOccurrencesAlreadyReached() throws Exception, Exception {
+		// Add VFC1 (with Requirements: tosca.capabilities.Container, MIN=1
+		// MAX=2) instance to VF
+		ComponentInstance componentInstanceWithReq = createComponentInstance(importReqDetails1, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithReq);
+		// Add VFC3 (with Capabilities: tosca.capabilities.Container, MIN=1
+		// MAX=1 ) instance to VF
+		ComponentInstance componentInstanceWithCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithCap);
+		// associate Instances
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap(resourceDetailsVF100);
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(componentInstanceWithReq,
+				componentInstanceWithCap, capReqDefBeforeAssociate);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", STATUS_CODE_SUCCESS, associateInstances.getErrorCode().intValue());
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF100.getUniqueId()));
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "1";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC3, resourceVFC1);
+		// associate same instances again - when requirement Max Occurrences
+		// reached
+		associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_NOT_FOUND,
+				associateInstances.getErrorCode().intValue());
+		ArrayList<String> varibales = new ArrayList<String>();
+		varibales.add(componentInstanceWithReq.getName());
+		varibales.add(componentInstanceWithCap.getName());
+		varibales.add("host");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND.name(),
+				varibales, associateInstances.getResponse());
+	}
+
+	@Test
+	public void associationAndDisassociateVfInstancesWhenReqMaxOccurrencesAlreadyReached() throws Exception, Exception {
+		// Add VFC4 (with Requirements: tosca.capabilities.Container, MIN=1
+		// MAX=1) instance to VF
+		ComponentInstance componentInstanceWithReq = createComponentInstance(importReqDetails4, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithReq);
+		// Add VFC3 (with Capabilities: tosca.capabilities.Container, MIN=1
+		// MAX=1 ) instance to VF
+		ComponentInstance componentInstanceWithCap = createComponentInstance(importReqDetails3, sdncDesignerDetails,
+				resourceDetailsVF100);
+		assertNotNull(componentInstanceWithCap);
+		// associate Instances
+		CapReqDef capReqDefBeforeAssociate = getResourceReqCap(resourceDetailsVF100);
+		RequirementCapabilityRelDef requirementDef = setRelationshipBetweenInstances(componentInstanceWithReq,
+				componentInstanceWithCap, capReqDefBeforeAssociate);
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		assertTrue(checkRealtionship(requirementDef.getFromNode(), requirementDef.getToNode(),
+				resourceDetailsVF100.getUniqueId()));
+		// GET resource
+		RestResponse getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		String containerMinReq = "0";
+		String containerMaxReq = "0";
+		String containerMinCap = "0";
+		String containerMaxCap = "0";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC3, resourceVFC4);
+		// Disassociate 2 Instances
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				sdncDesignerDetails, resourceDetailsVF100.getUniqueId(), ComponentTypeEnum.RESOURCE);
+		assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
+				dissociateInstances.getErrorCode().intValue());
+		assertTrue(getComponentInstancesRelations(resourceDetailsVF100.getUniqueId()).isEmpty());
+		// GET resource
+		getResourseRestResponse = ResourceRestUtils.getResource(sdncDesignerDetails,
+				resourceDetailsVF100.getUniqueId());
+		resourceVF100 = ResponseParser.parseToObjectUsingMapper(getResourseRestResponse.getResponse(), Resource.class);
+		// Verify Container requirements and Capabilities
+		containerMinReq = "1";
+		containerMaxReq = "1";
+		containerMinCap = "1";
+		containerMaxCap = "1";
+		verifyContainerCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				containerMinReq, containerMaxReq, containerMinCap, containerMaxCap);
+		verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(resourceVF100, capabilitiesAndRequirementsType,
+				resourceVFC3, resourceVFC4);
+	}
+
+	///////////////////////////////////////
+
+	private boolean checkRealtionship(String fromNode, String toNode, String resourceUniqueId) throws Exception {
+		List<RequirementCapabilityRelDef> componentInstancesRelations = getComponentInstancesRelations(
+				resourceUniqueId);
+		RequirementCapabilityRelDef requirementCapabilityRelDef = componentInstancesRelations.get(0);
+		boolean fromNodeCheck = requirementCapabilityRelDef.getFromNode().equals(fromNode);
+		boolean toNodeCheck = requirementCapabilityRelDef.getToNode().equals(toNode);
+
+		return fromNodeCheck && toNodeCheck;
+	}
+
+	private List<RequirementCapabilityRelDef> getComponentInstancesRelations(String resourceUniqueId)
+			throws ClientProtocolException, IOException {
+		Resource resource = getVfAsResourceObject(resourceUniqueId);
+		List<RequirementCapabilityRelDef> componenRelationInstances = resource.getComponentInstancesRelations();
+
+		return componenRelationInstances;
+	}
+
+	private Resource getVfAsResourceObject(String resourceUniqueId) throws ClientProtocolException, IOException {
+		RestResponse getResource = ResourceRestUtils.getResource(resourceUniqueId);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
+		return resource;
+	}
+
+	private RequirementCapabilityRelDef setRelationshipBetweenInstances(ComponentInstance riReq,
+			ComponentInstance riCap, CapReqDef capReqDef) throws Exception {
+
+		String capbilityUid = capReqDef.getCapabilities().get("tosca.capabilities.Container").get(0).getUniqueId();
+		String requirementUid = capReqDef.getRequirements().get("tosca.capabilities.Container").get(0).getUniqueId();
+
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		requirementDef.setFromNode(riReq.getUniqueId());
+		requirementDef.setToNode(riCap.getUniqueId());
+
+		RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair();
+		pair.setRequirementOwnerId(riReq.getUniqueId());
+		pair.setCapabilityOwnerId(riCap.getUniqueId());
+		pair.setRequirement("host");
+		RelationshipImpl relationship = new RelationshipImpl();
+		relationship.setType("tosca.capabilities.Container");
+		pair.setRelationships(relationship);
+		pair.setCapabilityUid(capbilityUid);
+		pair.setRequirementUid(requirementUid);
+		List<RequirementAndRelationshipPair> relationships = new ArrayList<>();
+		relationships.add(pair);
+		requirementDef.setRelationships(relationships);
+		return requirementDef;
+	}
+
+	private CapReqDef getResourceReqCap(ResourceReqDetails res) throws IOException {
+		RestResponse getResourceBeforeAssociate = ComponentRestUtils
+				.getComponentRequirmentsCapabilities(sdncDesignerDetails, resourceDetailsVF100);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceBeforeAssociate.getResponse(), CapReqDef.class);
+		return capReqDef;
+	}
+
+	private RestResponse importedResource(ImportReqDetails importReqDetails, String ymlFile) throws Exception {
+		importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, testResourcesPath,
+				ymlFile);
+		RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails,
+				sdncDesignerDetails, null);
+		assertEquals("Check response code after importing resource", BaseRestUtils.STATUS_CODE_CREATED,
+				importResourceResponse.getErrorCode().intValue());
+		return importResourceResponse;
+	}
+
+	private ComponentInstance createComponentInstance(ResourceReqDetails res, User user, ResourceReqDetails vf)
+			throws Exception {
+		RestResponse response = ResourceRestUtils.createResourceInstance(res, user, vf.getUniqueId());
+		ResourceRestUtils.checkCreateResponse(response);
+		ComponentInstance compInstance = ResponseParser.parseToObject(response.getResponse(), ComponentInstance.class);
+		return compInstance;
+	}
+
+	private void verifyContainerCapabilitiesAndRequirementsOccurrences(Component component,
+			String CapabilitiesAndRequirementsType, String minReqOccurrences, String maxReqOccurrences,
+			String minCapabilities, String maxCapabilities) throws Exception {
+		boolean isRequirementAppear = false;
+		boolean isCapabilityAppear = false;
+		List<RequirementDefinition> requirements;
+		List<CapabilityDefinition> capabilities;
+		requirements = component.getRequirements().get(CapabilitiesAndRequirementsType);
+		if (maxReqOccurrences == "0") {
+			assertTrue(requirements == null);
+		} // if container MAX requirement = 0
+		if (maxReqOccurrences != "0") {
+			assertNotNull(requirements);
+			for (RequirementDefinition req : requirements) {
+				switch (req.getName()) {
+				case "host":
+					assertTrue("Check Min Requirement Occurrences ", req.getMinOccurrences().equals(minReqOccurrences));
+					assertTrue("Check Max Requirement Occurrences ", req.getMaxOccurrences().equals(maxReqOccurrences));
+					isRequirementAppear = true;
+					break;
+				}
+				assertTrue(isRequirementAppear);
+				isRequirementAppear = false;
+			}
+		}
+		// Container Capabilities
+		capabilities = component.getCapabilities().get(CapabilitiesAndRequirementsType);
+		if (maxCapabilities == "0") {// if container MAX capabilities = 0
+			assertTrue(capabilities == null);
+		}
+		if (maxCapabilities != "0") {
+			assertNotNull(capabilities);
+			for (CapabilityDefinition cap : capabilities) {
+				switch (cap.getName()) {
+				case "host":
+					assertTrue("Check Min capability Occurrences ", cap.getMinOccurrences().equals(minCapabilities));
+					assertTrue("Check Max capability Occurrences ", cap.getMaxOccurrences().equals(maxCapabilities));
+					isCapabilityAppear = true;
+					break;
+				}
+				assertTrue(isCapabilityAppear);
+				isCapabilityAppear = false;
+			}
+		}
+
+	}
+
+	private void verifyContainerInstanceCapabilitiesAndRequirementsOccurrences(Component component,
+			String CapabilitiesAndRequirementsType, Resource vfWithCapabilities, Resource vfWithRequirements)
+			throws Exception {
+		boolean isCapReqAppear = false;
+		List<ComponentInstance> listOfComponentInstances = component.getComponentInstances();
+
+		for (ComponentInstance instance : listOfComponentInstances) {
+			if (instance.getComponentUid().equals(vfWithCapabilities.getUniqueId())) {
+				List<CapabilityDefinition> capFromResource = vfWithCapabilities.getCapabilities()
+						.get(CapabilitiesAndRequirementsType);
+				List<CapabilityDefinition> capFromInstance = instance.getCapabilities()
+						.get(CapabilitiesAndRequirementsType);
+				for (CapabilityDefinition resourceCap : capFromResource)
+					for (CapabilityDefinition instanceReq : capFromInstance) {
+						if (resourceCap.getUniqueId().equals(instanceReq.getUniqueId())) {
+							assertTrue("Check Min capability Occurrences ",
+									resourceCap.getMinOccurrences().equals(instanceReq.getMinOccurrences()));
+							assertTrue("Check Max capability Occurrences ",
+									resourceCap.getMaxOccurrences().equals(instanceReq.getMaxOccurrences()));
+							isCapReqAppear = true;
+							break;
+						}
+
+					}
+			}
+
+			if (instance.getComponentUid().equals(vfWithRequirements.getUniqueId())) {
+				List<RequirementDefinition> reqFromAtomicResource = vfWithRequirements.getRequirements()
+						.get(CapabilitiesAndRequirementsType);
+				List<RequirementDefinition> reqFromInstance = instance.getRequirements()
+						.get(CapabilitiesAndRequirementsType);
+				for (RequirementDefinition resourceReq : reqFromAtomicResource)
+					for (RequirementDefinition instanceReq : reqFromInstance) {
+						if (resourceReq.getUniqueId().equals(instanceReq.getUniqueId())) {
+							assertTrue("Check Min Requirement Occurrences ",
+									resourceReq.getMinOccurrences().equals(instanceReq.getMinOccurrences()));
+							assertTrue("Check Max Requirement Occurrences ",
+									resourceReq.getMaxOccurrences().equals(instanceReq.getMaxOccurrences()));
+							isCapReqAppear = true;
+							break;
+						}
+					}
+			}
+			assertTrue(isCapReqAppear);
+			isCapReqAppear = false;
+		}
+
+	}
+
+	private RequirementCapabilityRelDef getReqCapRelation(String reqCompInstId, String capCompInstId, String capType,
+			String reqName, List<CapabilityDefinition> capList, List<RequirementDefinition> reqList,
+			String vfc1UniqueId, String vfc2UniqueId) {
+		return ElementFactory.getReqCapRelation(reqCompInstId, capCompInstId, vfc1UniqueId, vfc2UniqueId, capType,
+				reqName, capList, reqList);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java
new file mode 100644
index 0000000..7181549
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/ServiceComponentInstanceCRUDTest.java
@@ -0,0 +1,1627 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.codehaus.jettison.json.JSONException;
+import org.json.JSONArray;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentInstanceBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class ServiceComponentInstanceCRUDTest extends ComponentInstanceBaseTest {
+	private static Logger log = LoggerFactory.getLogger(ServiceComponentInstanceCRUDTest.class.getName());
+	private static final String SPACE_STRING = " ";
+	private static String REQUIREMENT_NAME = "host";
+	private static String CAPABILITY_TYPE = "tosca.capabilities.Container";
+
+	private String reqOwnerId;
+	private String capOwnerId;
+
+	public ServiceComponentInstanceCRUDTest() {
+		super(new TestName(), ServiceComponentInstanceCRUDTest.class.getSimpleName());
+	}
+
+	@BeforeMethod(alwaysRun = true)
+	public void before() throws Exception {
+		init();
+		createComponents();
+	}
+
+	private void createComponents() throws Exception {
+		createAtomicResource(resourceDetailsVFC_01);
+		createAtomicResource(resourceDetailsVFC_02);
+		createAtomicResource(resourceDetailsCP_01);
+		createAtomicResource(resourceDetailsVL_01);
+		createAtomicResource(resourceDetailsVL_02);
+		createVF(resourceDetailsVF_01);
+		createVF(resourceDetailsVF_02);
+		createService(serviceDetails_01);
+		certifyResource(resourceDetailsVFC_01);
+		certifyResource(resourceDetailsVFC_02);
+		RestResponse createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resourceDetailsVF_01,
+				resourceDetailsVFC_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		reqOwnerId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+		createAtomicResourceInstance = createAtomicInstanceForVFDuringSetup(resourceDetailsVF_02, resourceDetailsVFC_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		capOwnerId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);// should
+																							// be
+																							// updated
+																							// to
+																							// getUniqueIdOfFirstInstance
+																							// in
+																							// service
+																							// context
+	}
+
+	private void certifyResource(ResourceReqDetails resource) throws Exception {
+		changeResourceLifecycleState(resource, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		changeResourceLifecycleState(resource, sdncTesterDetails.getUserId(), LifeCycleStatesEnum.STARTCERTIFICATION);
+		changeResourceLifecycleState(resource, sdncTesterDetails.getUserId(), LifeCycleStatesEnum.CERTIFY);
+	}
+
+	private void changeResourceLifecycleState(ResourceReqDetails resourceDetails, String userUserId,
+			LifeCycleStatesEnum lifeCycleStates) throws Exception {
+		RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, userUserId, lifeCycleStates);
+		LifecycleRestUtils.checkLCS_Response(response);
+	}
+
+	private void changeServiceLifecycleState(ServiceReqDetails serviceDetails, User user,
+			LifeCycleStatesEnum lifeCycleStates) throws Exception {
+		RestResponse response = LifecycleRestUtils.changeServiceState(serviceDetails, user, lifeCycleStates);
+		LifecycleRestUtils.checkLCS_Response(response);
+	}
+
+	private void createVFInstanceFailWithoutChangeState(ActionStatus actionStatus, List<String> variables,
+			ResourceReqDetails vfResource, User user, int errorCode) throws Exception {
+		RestResponse createVFInstanceSuccessfullyWithoutChangeStateResp = createVFInstance(serviceDetails_01,
+				vfResource, user);
+		checkErrorMessage(actionStatus, variables, errorCode, createVFInstanceSuccessfullyWithoutChangeStateResp);
+	}
+
+	private void createVFInstanceFail(ActionStatus actionStatus, List<String> variables, ResourceReqDetails vfResource,
+			User user, int errorCode) throws Exception, FileNotFoundException, JSONException {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, vfResource, user);
+		checkErrorMessage(actionStatus, variables, errorCode, createVFInstResp);
+	}
+
+	private void deleteVFInstanceFail(ActionStatus actionStatus, List<String> variables, ResourceReqDetails vfResource,
+			User user, int errorCode) throws Exception, FileNotFoundException, JSONException {
+		RestResponse deleteVFInstResp = deleteVFInstance(vfResource.getUniqueId(), serviceDetails_01, user);
+		checkErrorMessage(actionStatus, variables, errorCode, deleteVFInstResp);
+	}
+
+	private void createAtomicResourceInstanceFailWithoutChangeState(ActionStatus actionStatus, List<String> variables,
+			ResourceReqDetails atomicResource, User user, int errorCode)
+			throws Exception, FileNotFoundException, JSONException {
+		RestResponse createAtomicInstResp = createAtomicInstanceForService(serviceDetails_01, atomicResource, user);
+		checkErrorMessage(actionStatus, variables, errorCode, createAtomicInstResp);
+	}
+
+	private void createAtomicResourceInstanceFail(ActionStatus actionStatus, List<String> variables,
+			ResourceReqDetails atomicResource, User user, int errorCode)
+			throws Exception, FileNotFoundException, JSONException {
+		RestResponse createAtomicInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, atomicResource,
+				user);
+		checkErrorMessage(actionStatus, variables, errorCode, createAtomicInstResp);
+	}
+
+	private void deleteAtomicResourceInstanceFail(ActionStatus actionStatus, List<String> variables,
+			ResourceReqDetails atomicResource, User user, int errorCode)
+			throws Exception, FileNotFoundException, JSONException {
+		RestResponse deleteAtomicInstResp = deleteAtomicInstanceForService(atomicResource.getUniqueId(),
+				serviceDetails_01, user);
+		checkErrorMessage(actionStatus, variables, errorCode, deleteAtomicInstResp);
+	}
+
+	private void checkErrorMessage(ActionStatus actionStatus, List<String> variables, int errorCode,
+			RestResponse response) throws Exception {
+
+		log.debug(response.getResponse());
+		AssertJUnit.assertEquals(errorCode, response.getErrorCode().intValue());
+		ErrorValidationUtils.checkBodyResponseOnError(actionStatus.name(), variables, response.getResponse());
+	}
+
+	private RestResponse createCheckedinVFInstance(ServiceReqDetails containerDetails,
+			ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		changeResourceLifecycleState(compInstOriginDetails, compInstOriginDetails.getCreatorUserId(),
+				LifeCycleStatesEnum.CHECKIN);
+		return createVFInstance(containerDetails, compInstOriginDetails, modifier);
+	}
+
+	private RestResponse createCheckedinAtomicInstanceForService(ServiceReqDetails containerDetails,
+			ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
+		changeResourceLifecycleState(compInstOriginDetails, compInstOriginDetails.getCreatorUserId(),
+				LifeCycleStatesEnum.CHECKIN);
+		return createAtomicInstanceForService(containerDetails, compInstOriginDetails, modifier);
+	}
+
+	private void createVFInstanceAndAtomicResourceInstanceWithoutCheckin(ResourceReqDetails vf,
+			ResourceReqDetails atomicResource, User user) throws Exception {
+		RestResponse createVFInstance = createVFInstance(serviceDetails_01, vf, user);
+		ResourceRestUtils.checkCreateResponse(createVFInstance);
+		RestResponse atomicInstanceForService = createAtomicInstanceForService(serviceDetails_01, atomicResource, user);
+		ResourceRestUtils.checkCreateResponse(atomicInstanceForService);
+	}
+
+	private void createVFInstanceAndAtomicResourceInstanceSuccessully(ResourceReqDetails vf,
+			ResourceReqDetails atomicResource) throws Exception, IOException {
+		createVFInstanceAndAtomicResourceInstanceSuccessully(vf, atomicResource, sdncDesignerDetails);
+	}
+
+	private void createVFInstanceAndAtomicResourceInstanceSuccessully(ResourceReqDetails vf,
+			ResourceReqDetails atomicResource, User user) throws Exception, IOException {
+		changeResourceLifecycleState(vf, vf.getCreatorUserId(), LifeCycleStatesEnum.CHECKIN);
+		changeResourceLifecycleState(atomicResource, atomicResource.getCreatorUserId(), LifeCycleStatesEnum.CHECKIN);
+		createVFInstanceAndAtomicResourceInstanceWithoutCheckin(vf, atomicResource, user);
+	}
+
+	@Test
+	public void createVFInstanceSuccessfullyTest() throws Exception {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void createVFAndAtomicInstanceTest() throws Exception {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsVL_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsVL_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		getComponentAndValidateRIs(serviceDetails_01, 4, 0);
+	}
+
+	@Test
+	public void deleteAtomicInstanceTest() throws Exception {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		// 1 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		// 2 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsVL_01,
+				sdncDesignerDetails);
+		// 3 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsVL_02,
+				sdncDesignerDetails);
+		// 4 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		// To delete
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// 3 rel
+		createVFInstResp = deleteAtomicInstanceForService(compInstId, serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkDeleteResponse(createVFInstResp);
+		getComponentAndValidateRIs(serviceDetails_01, 3, 0);
+	}
+
+	@Test
+	public void deleteVFInstanceTest() throws Exception {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		// 1 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02, sdncDesignerDetails);
+		String compInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		// 2 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		createVFInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		// 3 rel
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		// 2 rel
+		createVFInstResp = deleteVFInstance(compInstId, serviceDetails_01, sdncDesignerDetails);
+		ResourceRestUtils.checkDeleteResponse(createVFInstResp);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void associateDissociateTwoVFs() throws Exception {
+
+		RestResponse createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String fromCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String toCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+
+		String capType = CAPABILITY_TYPE;
+		String reqName = REQUIREMENT_NAME;
+
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(fromCompInstId, toCompInstId, capType, reqName,
+				capList, reqList);
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<RequirementDefinition> list = capReqDef.getRequirements().get(capType);
+		AssertJUnit.assertEquals("Check requirement", null, list);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+
+		dissociateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		list = capReqDef.getRequirements().get(capType);
+		AssertJUnit.assertEquals("Check requirement", 1, list.size());
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	private RequirementCapabilityRelDef getReqCapRelation(String reqCompInstId, String capCompInstId, String capType,
+			String reqName, List<CapabilityDefinition> capList, List<RequirementDefinition> reqList) {
+		return ElementFactory.getReqCapRelation(reqCompInstId, capCompInstId, reqOwnerId, capOwnerId, capType, reqName,
+				capList, reqList);
+	}
+
+	@Test
+	public void createResourceInstanceByDifferentDesignerTest() throws Exception {
+		createVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2), 409);
+		createAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2), 409);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test
+	public void createResourceInstanceByDifferentDesignerTest_ServiceIsCheckedin() throws Exception {
+		User designer2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		changeServiceLifecycleState(serviceDetails_01, designer2, LifeCycleStatesEnum.CHECKOUT);
+
+		createVFInstanceAndAtomicResourceInstanceSuccessully(resourceDetailsVF_01, resourceDetailsCP_01, designer2);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+
+	}
+
+	@Test
+	public void createResourceInstanceByTester() throws Exception {
+		createVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), 409);
+		createAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), 409);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test
+	public void createResourceInstanceWithNotASDCUserTest() throws Exception {
+		sdncDesignerDetails.setUserId("ab0001");
+		createVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				sdncDesignerDetails, 409);
+		createAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, sdncDesignerDetails, 409);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test
+	public void createResourceInstanceWithEmptyUserIdTest() throws Exception {
+		sdncDesignerDetails.setUserId("");
+		createVFInstanceFail(ActionStatus.MISSING_INFORMATION, new ArrayList<String>(), resourceDetailsVF_01,
+				sdncDesignerDetails, 403);
+		createAtomicResourceInstanceFail(ActionStatus.MISSING_INFORMATION, new ArrayList<String>(),
+				resourceDetailsCP_01, sdncDesignerDetails, 403);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test
+	public void createResourceInstanceWithEmptyServiceUidTest() throws Exception {
+		serviceDetails_01.setUniqueId("");
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		assertEquals(404, createVFInstResp.getErrorCode().intValue());
+		RestResponse createAtomicInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		assertEquals(404, createAtomicInstResp.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createResourceInstanceWhileResourceNotExistTest() throws Exception {
+		String vfResourceUniqueId = "1234";
+		String atomicResourceUniqueId = "5678";
+
+		resourceDetailsVF_01.setUniqueId(vfResourceUniqueId);
+		resourceDetailsCP_01.setUniqueId(atomicResourceUniqueId);
+
+		createVFInstanceFailWithoutChangeState(ActionStatus.RESOURCE_NOT_FOUND,
+				new ArrayList<String>(Arrays.asList("")), resourceDetailsVF_01, sdncDesignerDetails, 404);
+		createAtomicResourceInstanceFailWithoutChangeState(ActionStatus.RESOURCE_NOT_FOUND,
+				new ArrayList<String>(Arrays.asList("")), resourceDetailsCP_01, sdncDesignerDetails, 404);
+	}
+
+	@Test
+	public void createResourceInstanceInServiceNotExistsTest() throws Exception {
+		serviceDetails_01.setUniqueId("1234");
+		createVFInstanceFail(ActionStatus.SERVICE_NOT_FOUND, new ArrayList<String>(Arrays.asList("")),
+				resourceDetailsVF_01, sdncDesignerDetails, 404);
+		createAtomicResourceInstanceFail(ActionStatus.SERVICE_NOT_FOUND, new ArrayList<String>(Arrays.asList("")),
+				resourceDetailsCP_01, sdncDesignerDetails, 404);
+	}
+
+	@Test
+	public void createResourceInstanceInCheckedinServiceTest() throws Exception {
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+
+		createVFInstanceFailWithoutChangeState(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsVF_01, sdncDesignerDetails, 409);
+		createAtomicResourceInstanceFailWithoutChangeState(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, sdncDesignerDetails, 409);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test(enabled = false)
+	public void createResourceInstance_ResourceInCheckoutStateTest() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		RestResponse createVFInstanceWithoutChangeStateResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ComponentInstanceRestUtils.checkCreateResponse(createVFInstanceWithoutChangeStateResp);
+		RestResponse createAtomicInstWithoutCheangeStateResp = createAtomicInstanceForService(serviceDetails_01,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ComponentInstanceRestUtils.checkCreateResponse(createAtomicInstWithoutCheangeStateResp);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void createResourceInstance_ResourceInCertificationRequestStateTest() throws Exception {
+		changeResourceLifecycleState(resourceDetailsVF_01, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		changeResourceLifecycleState(resourceDetailsCP_01, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+
+		createVFInstanceAndAtomicResourceInstanceSuccessully(resourceDetailsVF_01, resourceDetailsCP_01);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void createResourceInstance_startCertificationStateTest() throws Exception {
+		changeResourceLifecycleState(resourceDetailsVF_01, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		changeResourceLifecycleState(resourceDetailsCP_01, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+
+		changeResourceLifecycleState(resourceDetailsVF_01, sdncTesterDetails.getUserId(),
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+		changeResourceLifecycleState(resourceDetailsCP_01, sdncTesterDetails.getUserId(),
+				LifeCycleStatesEnum.STARTCERTIFICATION);
+
+		createVFInstanceAndAtomicResourceInstanceWithoutCheckin(resourceDetailsVF_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+
+	}
+
+	@Test
+	public void createResourceInstance_certifiedStateTest() throws Exception {
+		certifyResource(resourceDetailsVF_01);
+		certifyResource(resourceDetailsCP_01);
+
+		createVFInstanceAndAtomicResourceInstanceWithoutCheckin(resourceDetailsVF_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+	}
+
+	@Test
+	public void createResourceInstance_OneHasDifferentOwner() throws Exception {
+		User designer2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
+
+		ResourceReqDetails vfResource = new ResourceReqDetails(resourceDetailsVF_01, "0.1");
+		vfResource.setUniqueId(null);
+		vfResource.setName("newVF");
+		vfResource.setTags(new ArrayList<String>(Arrays.asList(vfResource.getName())));
+		createVF(vfResource, designer2);
+
+		RestResponse atomicInstanceForService = createCheckedinAtomicInstanceForService(serviceDetails_01,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(atomicInstanceForService);
+		createVFInstanceFailWithoutChangeState(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), vfResource,
+				designer2, 409);
+
+		getComponentAndValidateRIs(serviceDetails_01, 1, 0);
+	}
+
+	@Test
+	public void indexesOfVFInstancesTest() throws Exception {
+		String firstInstanceName = resourceDetailsVF_01.getName() + SPACE_STRING + "1";
+		String secondInstanceName = resourceDetailsVF_01.getName() + SPACE_STRING + "2";
+		String thirdInstanceName = resourceDetailsVF_01.getName() + SPACE_STRING + "3";
+
+		LifecycleRestUtils.changeResourceState(resourceDetailsVF_01, sdncDesignerDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+
+		RestResponse createFirstVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createSecondVFInstResp);
+		RestResponse createThirdVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createThirdVFInstResp);
+
+		Component service = getComponentAndValidateRIs(serviceDetails_01, 3, 0);
+		List<ComponentInstance> componentInstancesList = service.getComponentInstances();
+		for (ComponentInstance instance : componentInstancesList) {
+			String instanceName = instance.getName();
+			boolean isEqualToFirstInstanceName = instanceName.equals(firstInstanceName);
+			boolean isEqualToSecondInstanceName = instanceName.equals(secondInstanceName);
+			boolean isEqualToThirdInstanceName = instanceName.equals(thirdInstanceName);
+			assertTrue(isEqualToFirstInstanceName || isEqualToSecondInstanceName || isEqualToThirdInstanceName);
+		}
+	}
+
+	@Test
+	public void vfInstancesAmountInTwoServiceVersionsTest() throws Exception {
+		String oldServiceUniqueId = serviceDetails_01.getUniqueId();
+
+		createTwoCheckedinVFInstances();
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKOUT);
+
+		String newSerivceUniqueIdAfterChangeLifecycleState = serviceDetails_01.getUniqueId();
+		getComponentAndValidateRIsAfterChangeLifecycleState(oldServiceUniqueId, serviceDetails_01, 2, 0);
+
+		// Check old version
+		checkServiceOldVersionRIs(oldServiceUniqueId, newSerivceUniqueIdAfterChangeLifecycleState, 2, 0);
+
+		// Add one more resource instance to second version of service
+		LifecycleRestUtils.changeResourceState(resourceDetailsVL_01, sdncDesignerDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		RestResponse createAtomicResourceInstResp = createAtomicResourceInstanceToSecondServiceVersion(
+				newSerivceUniqueIdAfterChangeLifecycleState, resourceDetailsVL_01);
+		String atomicResourceUniqueId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstResp);
+		getComponentAndValidateRIsAfterAddingAtomicResourceInstance(oldServiceUniqueId, serviceDetails_01, 3, 0);
+
+		// Check that RIs are same as in the beginning - like in old version of
+		// service
+		deleteCompInstReqCapFromExpected(atomicResourceUniqueId);
+		checkServiceOldVersionRIs(oldServiceUniqueId, newSerivceUniqueIdAfterChangeLifecycleState, 2, 0);
+
+	}
+
+	private void createTwoCheckedinVFInstances() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createSecondVFInstResp);
+	}
+
+	private void getComponentAndValidateRIsAfterAddingAtomicResourceInstance(String oldComponentUniqueId,
+			ComponentReqDetails componentDetails, int numOfRIs, int numOfRelations) throws Exception {
+		getComponentAndValidateRIsAfterChangeLifecycleState(oldComponentUniqueId, componentDetails, numOfRIs,
+				numOfRelations);
+
+	}
+
+	private void checkServiceOldVersionRIs(String oldUniqueId, String newUniqueId, int numOfRIs, int numOfRelations)
+			throws IOException, Exception {
+		serviceDetails_01.setUniqueId(oldUniqueId);
+		getComponentAndValidateRIsAfterChangeLifecycleState(newUniqueId, serviceDetails_01, numOfRIs, numOfRelations);
+	}
+
+	private RestResponse createAtomicResourceInstanceToSecondServiceVersion(String secondServiceUniqueId,
+			ResourceReqDetails resourceToAdd) throws Exception {
+		serviceDetails_01.setUniqueId(secondServiceUniqueId);
+		RestResponse createAtomicResourceInstResp = createAtomicInstanceForService(serviceDetails_01, resourceToAdd,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstResp);
+		return createAtomicResourceInstResp;
+	}
+
+	@Test
+	public void createResourceInstanceToUnsupportedComponentTest() throws Exception {
+		String unsupportedType = "unsupported";
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetailsCP_01);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, sdncDesignerDetails, serviceDetails_01.getUniqueId(), unsupportedType);
+		checkErrorMessage(ActionStatus.UNSUPPORTED_ERROR, new ArrayList<String>(Arrays.asList(unsupportedType)), 400,
+				createResourceInstanceResponse);
+	}
+
+	@Test
+	public void deleteResourceInstanceByDifferentDesignerTest() throws Exception {
+
+		createVFInstanceAndAtomicResourceInstanceSuccessully(resourceDetailsVF_01, resourceDetailsCP_01);
+
+		deleteVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2), 409);
+		deleteAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2), 409);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteResourceInstanceByDifferentDesignerTest_ServiceIsCheckedin() throws Exception {
+
+		String oldServiceUniqueId = serviceDetails_01.getUniqueId();
+
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		RestResponse createAtomicResourceInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstResp);
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		changeServiceLifecycleState(serviceDetails_01, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2),
+				LifeCycleStatesEnum.CHECKOUT);
+		String newServiceUniqueId = serviceDetails_01.getUniqueId();
+
+		String oldVFInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		String newVFInstanceUniqueId = oldVFInstanceUniqueId.replaceAll(oldServiceUniqueId,
+				serviceDetails_01.getUniqueId());
+		String oldAtomicResourceInstanceUniqueId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstResp);
+		String newAtomicResourceInstanceUniqueId = oldAtomicResourceInstanceUniqueId.replaceAll(oldServiceUniqueId,
+				serviceDetails_01.getUniqueId());
+
+		deleteVFInstanceAndAtomicResourceInstanceSuccessfully(newVFInstanceUniqueId, newAtomicResourceInstanceUniqueId,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2));
+
+		serviceDetails_01.setUniqueId(oldServiceUniqueId);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+
+		serviceDetails_01.setUniqueId(newServiceUniqueId);
+		updateExpectedReqCapAfterChangeLifecycleState(oldServiceUniqueId, serviceDetails_01.getUniqueId());
+		deleteCompInstReqCapFromExpected(newVFInstanceUniqueId);
+		deleteCompInstReqCapFromExpected(newAtomicResourceInstanceUniqueId);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	private void deleteVFInstanceAndAtomicResourceInstanceSuccessfully(String vfInstanceUniqueId,
+			String atomicResourceInstanceUniqueId) throws IOException, Exception {
+		deleteVFInstanceAndAtomicResourceInstanceSuccessfully(vfInstanceUniqueId, atomicResourceInstanceUniqueId,
+				sdncDesignerDetails);
+	}
+
+	private void deleteVFInstanceAndAtomicResourceInstanceSuccessfully(String vfInstanceUniqueId,
+			String atomicResourceInstanceUniqueId, User user) throws IOException, Exception {
+		RestResponse deleteVFInstResp = deleteVFInstance(vfInstanceUniqueId, serviceDetails_01, user);
+		ResourceRestUtils.checkDeleteResponse(deleteVFInstResp);
+		RestResponse deleteAtomicResourceInsResp = deleteAtomicInstanceForService(atomicResourceInstanceUniqueId,
+				serviceDetails_01, user);
+		ResourceRestUtils.checkDeleteResponse(deleteAtomicResourceInsResp);
+	}
+
+	@Test
+	public void deleteResourceInstanceByTesterUserTest() throws Exception {
+		createVFInstanceAndAtomicResourceInstanceSuccessully(resourceDetailsVF_01, resourceDetailsCP_01);
+		deleteVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER), 409);
+		deleteAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), 409);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteResourceInstanceByNotASDCUserTest() throws Exception {
+		createVFInstanceAndAtomicResourceInstanceSuccessully(resourceDetailsVF_01, resourceDetailsCP_01);
+		User notASDCUser = new User();
+		notASDCUser.setUserId("ab0001");
+		deleteVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				notASDCUser, 409);
+		deleteAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, notASDCUser, 409);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteResourceInstanceFromCheckedinServiceTest() throws Exception {
+		createVFInstanceAndAtomicResourceInstanceSuccessully(resourceDetailsVF_01, resourceDetailsCP_01);
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		deleteVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				sdncDesignerDetails, 409);
+		deleteAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, sdncDesignerDetails, 409);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void deleteResourceInstanceWhileResourceCertifiedStateTest() throws Exception {
+		certifyResource(resourceDetailsVF_01);
+		certifyResource(resourceDetailsCP_01);
+
+		RestResponse createVFInstance = createVFInstance(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstance);
+		String vfInstUniqueId = ResponseParser.getUniqueIdFromResponse(createVFInstance);
+		RestResponse atomicInstanceForService = createAtomicInstanceForService(serviceDetails_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(atomicInstanceForService);
+		String atomicInstUniqueId = ResponseParser.getUniqueIdFromResponse(atomicInstanceForService);
+
+		deleteVFInstanceAndAtomicResourceInstanceSuccessfully(vfInstUniqueId, atomicInstUniqueId);
+
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	// fail - bug DE191849
+	@Test
+	public void deleteNotFoundResourceInstanceTest() throws Exception, Throwable {
+
+		resourceDetailsVF_01.setUniqueId("1234");
+		resourceDetailsCP_01.setUniqueId("5678");
+
+		deleteVFInstanceFail(ActionStatus.RESOURCE_NOT_FOUND, new ArrayList<String>(Arrays.asList("")),
+				resourceDetailsVF_01, sdncDesignerDetails, 404);
+		deleteAtomicResourceInstanceFail(ActionStatus.RESOURCE_NOT_FOUND, new ArrayList<String>(Arrays.asList("")),
+				resourceDetailsCP_01, sdncDesignerDetails, 404);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+
+		// {"requestError":{"serviceException":{"messageId":"SVC4503","text":"Error:
+		// Requested '%1' service was not found.","variables":["1234"]}}}>
+	}
+
+	@Test
+	public void deleteResourceInstanceFromServiceNotFoundTest() throws Exception, Throwable {
+		serviceDetails_01.setUniqueId("1234");
+		deleteVFInstanceFail(ActionStatus.SERVICE_NOT_FOUND, new ArrayList<String>(Arrays.asList("")),
+				resourceDetailsVF_01, sdncDesignerDetails, 404);
+		deleteAtomicResourceInstanceFail(ActionStatus.SERVICE_NOT_FOUND, new ArrayList<String>(Arrays.asList("")),
+				resourceDetailsCP_01, sdncDesignerDetails, 404);
+	}
+
+	@Test
+	public void deleteResourceInstanceFromUnsupportedTypeTest() throws Exception {
+		String unsupportedType = "unsupportedType";
+		RestResponse deleteVFInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(sdncDesignerDetails,
+				serviceDetails_01.getUniqueId(), resourceDetailsVF_01.getUniqueId(), unsupportedType);
+		checkErrorMessage(ActionStatus.UNSUPPORTED_ERROR, new ArrayList<String>(Arrays.asList(unsupportedType)), 400,
+				deleteVFInstanceResponse);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test
+	public void deleteResourceInstanceWithEmptyServiceUidTest() throws Exception, Throwable {
+		serviceDetails_01.setUniqueId("");
+		RestResponse deleteVFInstResp = deleteVFInstance(resourceDetailsVF_01.getUniqueId(), serviceDetails_01,
+				sdncDesignerDetails);
+		assertEquals(404, deleteVFInstResp.getErrorCode().intValue());
+	}
+
+	@Test
+	public void deleteResourceInstanceWithEmptyResourceInstanceUidTest() throws Exception, Throwable {
+		RestResponse deleteVFInstResp = deleteVFInstance("", serviceDetails_01, sdncDesignerDetails);
+		assertEquals(405, deleteVFInstResp.getErrorCode().intValue());
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	@Test
+	public void deleteResourceInstanceWithEmptyUserIdTest() throws Exception {
+		sdncDesignerDetails.setUserId("");
+		deleteVFInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(), resourceDetailsVF_01,
+				sdncDesignerDetails, 409);
+		deleteAtomicResourceInstanceFail(ActionStatus.RESTRICTED_OPERATION, new ArrayList<String>(),
+				resourceDetailsCP_01, sdncDesignerDetails, 409);
+		getComponentAndValidateRIs(serviceDetails_01, 0, 0);
+	}
+
+	// fail - bug DE188994
+	@Test
+	public void associateResourceInstanceToResourceInstanceNotFoundTest() throws Exception, Throwable {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		String capCompInstId = "1234";
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		List<CapabilityDefinition> capListBeforeAssociate = new ArrayList<CapabilityDefinition>();
+		CapabilityDefinition cap = new CapabilityDefinition();
+		cap.setUniqueId(capCompInstId);
+		capListBeforeAssociate.add(cap);
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		assocaiteInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESOURCE_INSTANCE_NOT_FOUND, 404,
+				new ArrayList<String>(Arrays.asList(capCompInstId)));
+
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capabilitiesAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> requirementsAfterAssoicate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		// AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate,
+		// requirementsAfterAssoicate);
+		// AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate,
+		// capabilitiesAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 1, 0);
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "VF100 1",
+		// "9ae76786-2a9c-4409-95cb-db32885ed07f.eece8aaf-eb9f-4aff-b9a5-a11ca11de9e5.vf1001",
+		// "host"
+		// ]
+	}
+
+	// this case is not relevant any more, it is tested as part of occurrences
+	// story
+	@Test(enabled = false)
+	public void associateOnceAgainExistingRelationTest() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		//////////////////////////////////////////////
+		// NO ERROR - RELATION ALREADY EXIST
+		// assocaiteInstancesFail(requirementDef, sdncDesignerDetails,
+		// ActionStatus.RESOURCE_INSTANCE_NOT_FOUND, 404, new
+		// ArrayList<String>(Arrays.asList(capCompInstId)));
+		//////////////////////////////////////////////
+
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListAfterAssociate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		// AssertJUnit.assertEquals("Check requirement", null,
+		// reqListAfterAssociate);
+		// AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate,
+		// capListAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+
+		// "messageId": "SVC4119",
+		// "text": "Error: No relation found between resource instances
+		// \u0027%1\u0027 and \u0027%2\u0027 for requirement \u0027%3\u0027.",
+		// "variables": [
+		// "VF100 1",
+		// "VF_admin 2",
+		// "host"
+
+	}
+
+	@Test
+	public void associateInstancesInMissingServiceTest() throws Exception {
+		serviceDetails_01.setUniqueId("1234");
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		assocaiteInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.SERVICE_NOT_FOUND, 404,
+				new ArrayList<String>(Arrays.asList("")));
+	}
+
+	@Test
+	public void associateAfterDeletingResourceTest() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		ResourceRestUtils.deleteResource(resourceDetailsVF_01.getUniqueId(), sdncDesignerDetails.getUserId());
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+
+		// for (CapabilityDefinition capabilityDefinition :
+		// capListBeforeAssociate) {
+		// if (capabilityDefinition.getType().equals(CAPABILITY_TYPE)){
+		// capabilityDefinition.setMinOccurrences("0");
+		// }
+		// }
+		//
+		// List<RequirementDefinition> reqListAfterAssociate =
+		// capReqDefAfterAssociate.getRequirements().get(CAPABILITY_TYPE);
+		//
+		// AssertJUnit.assertEquals("Check requirement", null,
+		// reqListAfterAssociate);
+		//
+		// AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate,
+		// capListAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+	}
+
+	@Test
+	public void associateInstancesInCheckedinServiceTest() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+
+		assocaiteInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESTRICTED_OPERATION, 409,
+				new ArrayList<String>());
+
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capabilitiesAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> requirementsAfterAssoicate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate, requirementsAfterAssoicate);
+		AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate, capabilitiesAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	// fail - bug DE188994
+	@Test
+	public void associateAfterCheckoutAllInstancesTest() throws Exception {
+		String firstVFUniqueId = resourceDetailsVF_01.getUniqueId();
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		String secondVFUniqueId = resourceDetailsVF_02.getUniqueId();
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		changeResourceLifecycleState(resourceDetailsVF_01, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CHECKOUT);
+		changeResourceLifecycleState(resourceDetailsVF_02, sdncDesignerDetails.getUserId(),
+				LifeCycleStatesEnum.CHECKOUT);
+
+		requirementDef.setFromNode(
+				requirementDef.getFromNode().replaceAll(firstVFUniqueId, resourceDetailsVF_01.getUniqueId()));
+		requirementDef
+				.setToNode(requirementDef.getToNode().replaceAll(secondVFUniqueId, resourceDetailsVF_02.getUniqueId()));
+
+		assocaiteInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESTRICTED_OPERATION, 409,
+				new ArrayList<String>());
+
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capabilitiesAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> requirementsAfterAssoicate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		// AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate,
+		// requirementsAfterAssoicate);
+		// AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate,
+		// capabilitiesAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+
+		// "messageId": "SVC4116",
+		// "text": "Error: Invalid Content.",
+		// "variables": [
+		// "e9dcea15-ce27-4381-a554-4278973cefb1.d0b3affd-cf92-4626-adfe-961b44103924.vf1001",
+		// "e9dcea15-ce27-4381-a554-4278973cefb1.d0b3affd-cf92-4626-adfe-961b44103924.vf1001",
+		// "host"
+		// ]
+
+	}
+
+	@Test
+	public void associateInstancesByDifferentUsersTest() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		assocaiteInstancesFail(requirementDef, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2),
+				ActionStatus.RESTRICTED_OPERATION, 409, new ArrayList<String>());
+		assocaiteInstancesFail(requirementDef, ElementFactory.getDefaultUser(UserRoleEnum.TESTER),
+				ActionStatus.RESTRICTED_OPERATION, 409, new ArrayList<String>());
+		assocaiteInstancesFail(requirementDef, ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR),
+				ActionStatus.RESTRICTED_OPERATION, 409, new ArrayList<String>());
+		assocaiteInstancesFail(requirementDef, ElementFactory.getDefaultUser(UserRoleEnum.OPS),
+				ActionStatus.RESTRICTED_OPERATION, 409, new ArrayList<String>());
+		assocaiteInstancesFail(requirementDef, ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1),
+				ActionStatus.RESTRICTED_OPERATION, 409, new ArrayList<String>());
+
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capabilitiesAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> requirementsAfterAssoicate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate, requirementsAfterAssoicate);
+		AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate, capabilitiesAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	private void assocaiteInstancesFail(RequirementCapabilityRelDef requirementDef, User user,
+			ActionStatus actionStatus, int errorCode, List<String> variables) throws IOException, Exception {
+		RestResponse associateInstancesResp = ComponentInstanceRestUtils.associateInstances(requirementDef, user,
+				serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		checkErrorMessage(actionStatus, variables, errorCode, associateInstancesResp);
+	}
+
+	private void dissoicateInstancesFail(RequirementCapabilityRelDef requirementDef, User user,
+			ActionStatus actionStatus, int errorCode, List<String> variables) throws IOException, Exception {
+		RestResponse dissoicateInstancesResp = ComponentInstanceRestUtils.dissociateInstances(requirementDef, user,
+				serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		checkErrorMessage(actionStatus, variables, errorCode, dissoicateInstancesResp);
+	}
+
+	@Test
+	public void associateWithMissingServiceUidTest() throws Exception {
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		serviceDetails_01.setUniqueId("");
+		RestResponse associateInstancesResp = ComponentInstanceRestUtils.associateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals(404, associateInstancesResp.getErrorCode().intValue());
+	}
+
+	// fail - bug DE191824
+	@Test
+	public void associateNotCompitableReqCapTest() throws Exception {
+		RestResponse createFirstAtomicResourceInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01,
+				resourceDetailsCP_01, sdncDesignerDetails);
+		String reqCompInstName = ResponseParser.getNameFromResponse(createFirstAtomicResourceInstResp);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstAtomicResourceInstResp);
+		RestResponse createSecondAtomicResourceInstResp = createCheckedinAtomicInstanceForService(serviceDetails_01,
+				resourceDetailsVL_02, sdncDesignerDetails);
+		String capCompInstName = ResponseParser.getNameFromResponse(createSecondAtomicResourceInstResp);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondAtomicResourceInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		List<String> variables = new ArrayList<String>();
+		variables.add(reqCompInstName);
+		variables.add(capCompInstName);
+		variables.add(REQUIREMENT_NAME);
+
+		assocaiteInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESOURCE_INSTANCE_MATCH_NOT_FOUND, 404,
+				variables);
+
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capabilitiesAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> requirementsAfterAssoicate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		// AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate,
+		// requirementsAfterAssoicate);
+		// AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate,
+		// capabilitiesAfterAssociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+
+		// {"requestError":{"serviceException":{"messageId":"SVC4119","text":"Error:
+		// No relation found between resource instances '%1' and '%2' for
+		// requirement '%3'.","variables":["CP100 1","VL200 2","host"]}}}>
+	}
+
+	@Test
+	public void associateInstancesInTwoServiceVersionsTest() throws Exception {
+		String oldServiceUniqueId = serviceDetails_01.getUniqueId();
+		RestResponse createFirstVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKOUT);
+		String secondServiceUniqueId = serviceDetails_01.getUniqueId();
+
+		serviceDetails_01.setUniqueId(oldServiceUniqueId);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+
+		updateCapabilitiesOwnerId(oldServiceUniqueId, capListBeforeAssociate, secondServiceUniqueId);
+		updateExpectedReqCapAfterChangeLifecycleState(oldServiceUniqueId, secondServiceUniqueId);
+		CapReqDef capReqDefAfterAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListAfterAssociate = capReqDefAfterAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListAfterAssociate = capReqDefAfterAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		// AssertJUnit.assertEquals("Check requirement", null,
+		// reqListAfterAssociate);
+		// AssertJUnit.assertEquals("Check capabilities",
+		// capListBeforeAssociate, capListAfterAssociate);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+
+		RestResponse createThirdVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqSecondCompInstId = ResponseParser.getUniqueIdFromResponse(createThirdVFInstResp);
+
+		CapReqDef capReqDefBeforeSeconderyAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeSeconderyAssociate = capReqDefBeforeSeconderyAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeSeconderyAssociate = capReqDefBeforeSeconderyAssociate
+				.getRequirements().get(CAPABILITY_TYPE);
+
+		capCompInstId = capCompInstId.replaceAll(oldServiceUniqueId, secondServiceUniqueId);
+		RequirementCapabilityRelDef secondRequirementDef = getReqCapRelation(reqSecondCompInstId, capCompInstId,
+				CAPABILITY_TYPE, REQUIREMENT_NAME, capListBeforeSeconderyAssociate, reqListBeforeSeconderyAssociate);
+		associateComponentInstancesForService(secondRequirementDef, serviceDetails_01, sdncDesignerDetails);
+
+		CapReqDef capReqDefAfterSeconderyAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListAfterSeconderyAssociate = capReqDefAfterSeconderyAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListAfterSeconderyAssociate = capReqDefAfterSeconderyAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		// AssertJUnit.assertEquals("Check requirement", null,
+		// reqListAfterSeconderyAssociate);
+		// AssertJUnit.assertEquals("Check capabilities",
+		// capListBeforeAssociate, capListAfterSeconderyAssociate);
+		getComponentAndValidateRIs(serviceDetails_01, 3, 2);
+	}
+
+	private void updateCapabilitiesOwnerId(String oldUniqueId, List<CapabilityDefinition> capList, String newUniqueId) {
+		serviceDetails_01.setUniqueId(newUniqueId);
+		for (CapabilityDefinition cap : capList) {
+			String oldOwnerId = cap.getOwnerId();
+			String newOwnerId = oldOwnerId.replaceAll(oldUniqueId, newUniqueId);
+			cap.setOwnerId(newOwnerId);
+		}
+	}
+
+	@Test
+	public void dissociateRelationNotFoundTest() throws Exception {
+		createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails);
+		String reqCompInstId = "1234";
+		createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02, sdncDesignerDetails);
+		String capCompInstId = "4567";
+
+		CapReqDef capReqDef = ComponentRestUtils.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capList, reqList);
+
+		List<String> variables = new ArrayList<String>();
+		variables.add(reqCompInstId);
+		variables.add(capCompInstId);
+		variables.add(REQUIREMENT_NAME);
+		dissoicateInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND,
+				404, variables);
+
+		CapReqDef capReqDefAfterDissociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListAfterDissociate = capReqDefAfterDissociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListAfterDissociate = capReqDefAfterDissociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		AssertJUnit.assertEquals("Check requirement", 1, reqListAfterDissociate.size());
+		AssertJUnit.assertEquals("Check requirement", reqList, reqListAfterDissociate);
+		AssertJUnit.assertEquals("Check capabilities", capList, capListAfterDissociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+
+	}
+
+	@Test
+	public void dissociateRelationInServiceNotFoundTest() throws Exception {
+		String uniqueId = "1234";
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		serviceDetails_01.setUniqueId(uniqueId);
+		dissoicateInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.SERVICE_NOT_FOUND, 404,
+				new ArrayList<String>(Arrays.asList("")));
+
+	}
+
+	@Test
+	public void dissoicateRelationWhileInstanceNotFound() throws Exception {
+		String capUniqueId = "1234";
+
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02, sdncDesignerDetails);
+		String capCompInstId = capUniqueId;
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		List<String> variables = new ArrayList<String>();
+		variables.add(reqCompInstId);
+		variables.add(capCompInstId);
+		variables.add(REQUIREMENT_NAME);
+		dissoicateInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND,
+				404, variables);
+
+		CapReqDef capReqDefAfterDissociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListAfterDissociate = capReqDefAfterDissociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListAfterDissociate = capReqDefAfterDissociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+		AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate, reqListAfterDissociate);
+		AssertJUnit.assertEquals("Check capabilities", capListBeforeAssociate, capListAfterDissociate);
+
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void dissociateWhileServiceCheckedinTest() throws Exception {
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		dissoicateInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESTRICTED_OPERATION, 409,
+				new ArrayList<String>());
+	}
+
+	@Test
+	public void dissoicateWithEmptyUserIdHeaderTest() throws Exception {
+		sdncDesignerDetails.setUserId("");
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		dissoicateInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESTRICTED_OPERATION, 409,
+				new ArrayList<String>());
+	}
+
+	@Test
+	public void dissociateWithMissingUidOfServiceTest() throws Exception {
+		serviceDetails_01.setUniqueId("");
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		RestResponse dissociateResp = ComponentInstanceRestUtils.dissociateInstances(requirementDef,
+				sdncDesignerDetails, serviceDetails_01.getUniqueId(), ComponentTypeEnum.SERVICE);
+		assertEquals(404, dissociateResp.getErrorCode().intValue());
+	}
+
+	@Test
+	public void relationDeletedAfterDeletingResourceInstanceTest() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+
+		RestResponse deleteVFInstance = deleteVFInstance(reqCompInstId, serviceDetails_01, sdncDesignerDetails);
+		ComponentInstanceRestUtils.checkDeleteResponse(deleteVFInstance);
+		getComponentAndValidateRIs(serviceDetails_01, 1, 0);
+	}
+
+	@Test
+	public void relationNotFoundInSecondVersionAfterDissociateTest() throws Exception {
+		String oldContainerUniqueIdToReplace = serviceDetails_01.getUniqueId();
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		dissociateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKOUT);
+
+		updateExpectedReqCapAfterChangeLifecycleState(oldContainerUniqueIdToReplace, serviceDetails_01.getUniqueId());
+		getComponentAndValidateRIs(serviceDetails_01, 2, 0);
+	}
+
+	@Test
+	public void dissociateOnceAgainTest() throws Exception {
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		String reqCompInsName = ResponseParser
+				.convertComponentInstanceResponseToJavaObject(createFirstVFInstResp.getResponse()).getName();
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+		String capCompInstName = ResponseParser
+				.convertComponentInstanceResponseToJavaObject(createSecondVFInstResp.getResponse()).getName();
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, CAPABILITY_TYPE,
+				REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		dissociateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+
+		List<String> variables = new ArrayList<String>();
+		variables.add(reqCompInsName);
+		variables.add(capCompInstName);
+		variables.add(REQUIREMENT_NAME);
+
+		dissoicateInstancesFail(requirementDef, sdncDesignerDetails, ActionStatus.RESOURCE_INSTANCE_RELATION_NOT_FOUND,
+				404, variables);
+	}
+
+	// fail - bug : DE191707
+	@Test
+	public void associateTwoRelations_CheckinCheckout_DissoicateOneRelationInSecondVersion() throws Exception {
+		String oldContainerUniqueIdToReplace = serviceDetails_01.getUniqueId();
+		RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createFirstVFInstResp);
+		RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createSecondVFInstResp);
+		RestResponse createThirdVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		String secondReqCompInstId = ResponseParser.getUniqueIdFromResponse(createThirdVFInstResp);
+
+		CapReqDef capReqDefBeforeAssociate = ComponentRestUtils
+				.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails, serviceDetails_01);
+		List<CapabilityDefinition> capListBeforeAssociate = capReqDefBeforeAssociate.getCapabilities()
+				.get(CAPABILITY_TYPE);
+		List<RequirementDefinition> reqListBeforeAssociate = capReqDefBeforeAssociate.getRequirements()
+				.get(CAPABILITY_TYPE);
+
+		RequirementCapabilityRelDef requirementDefFirstRelation = getReqCapRelation(reqCompInstId, capCompInstId,
+				CAPABILITY_TYPE, REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+		RequirementCapabilityRelDef requirementDefSecondRelation = getReqCapRelation(secondReqCompInstId, capCompInstId,
+				CAPABILITY_TYPE, REQUIREMENT_NAME, capListBeforeAssociate, reqListBeforeAssociate);
+
+		associateComponentInstancesForService(requirementDefFirstRelation, serviceDetails_01, sdncDesignerDetails);
+		associateComponentInstancesForService(requirementDefSecondRelation, serviceDetails_01, sdncDesignerDetails);
+		getComponentAndValidateRIs(serviceDetails_01, 3, 2);
+
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKOUT);
+		String newContainerUniqueId = serviceDetails_01.getUniqueId();
+
+		// check if dissoicate of old relation is possibile
+		// dissoicateInstancesFail(requirementDefFirstRelation,
+		// sdncDesignerDetails, actionStatus, errorCode, variables);
+		getComponentAndValidateRIs(serviceDetails_01, 3, 2);
+
+		requirementDefFirstRelation
+				.setFromNode(reqCompInstId.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+		requirementDefFirstRelation
+				.setToNode(reqCompInstId.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+
+		dissociateComponentInstancesForService(requirementDefFirstRelation, serviceDetails_01, sdncDesignerDetails);
+
+		// updateCapabilitiesOwnerId(oldContainerUniqueIdToReplace,
+		// capListBeforeAssociate, newContainerUniqueId);
+		// CapReqDef capReqDefAfterAssociate =
+		// ComponentRestUtils.getAndParseComponentRequirmentsCapabilities(sdncDesignerDetails,
+		// serviceDetails_01);
+		// List<CapabilityDefinition> capListAfterAssociate =
+		// capReqDefAfterAssociate.getCapabilities().get(CAPABILITY_TYPE);
+		// List<RequirementDefinition> reqListAfterAssociate =
+		// capReqDefAfterAssociate.getRequirements().get(CAPABILITY_TYPE);
+		// AssertJUnit.assertEquals("Check requirement", reqListBeforeAssociate,
+		// reqListAfterAssociate);
+		// AssertJUnit.assertEquals("Check requirement", capListBeforeAssociate,
+		// capListAfterAssociate);
+		updateExpectedReqCapAfterChangeLifecycleState(oldContainerUniqueIdToReplace, serviceDetails_01.getUniqueId());
+		getComponentAndValidateRIs(serviceDetails_01, 3, 1);
+	}
+
+	@Test
+	public void createResourceInstancesAndUpdatedServiceMetadataTest() throws Exception, Exception {
+		serviceDetails_02.setUniqueId(serviceDetails_01.getUniqueId());
+		createTwoCheckedinVFInstances();
+		LifecycleRestUtils.changeResourceState(resourceDetailsCP_01, sdncDesignerDetails, "0.1",
+				LifeCycleStatesEnum.CHECKIN);
+		createVFInstanceAndAtomicResourceInstanceWithoutCheckin(resourceDetailsVF_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		RestResponse updateServiceResp = ServiceRestUtils.updateService(serviceDetails_02, sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(updateServiceResp);
+		getComponentAndValidateRIs(serviceDetails_01, 4, 0);
+	}
+
+	@Test(enabled = false)
+	public void forAcceptanceUserStory() throws Exception {
+		RestResponse createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String reqCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+		createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_02, sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		String capCompInstId = ResponseParser.getUniqueIdFromResponse(createVFInstResp);
+
+		String capType = CAPABILITY_TYPE;
+		String reqName = REQUIREMENT_NAME;
+
+		RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		ResourceRestUtils.checkSuccess(getResourceResponse);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
+		List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
+
+		RequirementCapabilityRelDef requirementDef = getReqCapRelation(reqCompInstId, capCompInstId, capType, reqName,
+				capList, reqList);
+
+		associateComponentInstancesForService(requirementDef, serviceDetails_01, sdncDesignerDetails);
+		getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(sdncDesignerDetails,
+				serviceDetails_01);
+		capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
+		List<RequirementDefinition> list = capReqDef.getRequirements().get(capType);
+		AssertJUnit.assertEquals("Check requirement", null, list);
+
+		serviceDetails_02.setUniqueId(serviceDetails_01.getUniqueId());
+		RestResponse updateServiceResp = ServiceRestUtils.updateService(serviceDetails_02, sdncDesignerDetails);
+		ServiceRestUtils.checkSuccess(updateServiceResp);
+		changeServiceLifecycleState(serviceDetails_01, sdncDesignerDetails, LifeCycleStatesEnum.CHECKIN);
+		getComponentAndValidateRIs(serviceDetails_01, 2, 1);
+	}
+
+	@Test
+	public void testUnsatisfiedCpReqInService() throws Exception {
+
+		// Certify all the needed atomic resources
+		RestResponse response = LifecycleRestUtils.certifyResource(resourceDetailsCP_01);
+		ResourceRestUtils.checkSuccess(response);
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails,
+				resourceDetailsVF_02.getUniqueId());
+		ResourceRestUtils.checkSuccess(response);
+		response = LifecycleRestUtils.certifyResource(resourceDetailsVF_02);
+		ResourceRestUtils.checkSuccess(response);
+		capOwnerId = getUniqueIdOfFirstInstanceFromResponse(response);
+
+		RestResponse createAtomicResourceInstance = createVFInstance(serviceDetails_01, resourceDetailsVF_02,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String vfCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		createAtomicResourceInstance = createAtomicInstanceForService(serviceDetails_01, resourceDetailsCP_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createAtomicResourceInstance);
+		String compInstName = ResponseParser.getNameFromResponse(createAtomicResourceInstance);
+		String cpCompInstId = ResponseParser.getUniqueIdFromResponse(createAtomicResourceInstance);
+
+		RestResponse submitForTesting = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		String[] variables = new String[] { serviceDetails_01.getName(), "service", "CP (Connection Point)",
+				compInstName, "requirement", "tosca.capabilities.network.Bindable", "fulfilled" };
+		BaseValidationUtils.checkErrorResponse(submitForTesting,
+				ActionStatus.REQ_CAP_NOT_SATISFIED_BEFORE_CERTIFICATION, variables);
+
+		fulfillCpRequirement(serviceDetails_01, cpCompInstId, vfCompInstId, capOwnerId, sdncDesignerDetails,
+				ComponentTypeEnum.SERVICE);
+
+		submitForTesting = LifecycleRestUtils.changeServiceState(serviceDetails_01, sdncDesignerDetails,
+				LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		BaseValidationUtils.checkSuccess(submitForTesting);
+	}
+
+	@Test
+	public void getVFInstanceSuccessfullyTest() throws Exception {
+		RestResponse createVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
+				sdncDesignerDetails);
+		ResourceRestUtils.checkCreateResponse(createVFInstResp);
+		System.out.println("instance successfuly created");
+		RestResponse getInstancesResponce = ComponentInstanceRestUtils.getComponentInstances(ComponentTypeEnum.SERVICE,
+				serviceDetails_01.getUniqueId(), sdncDesignerDetails);
+
+		for (int i = 0; i < 1500; i++) {
+			createVFInstResp = createVFInstance(serviceDetails_01, resourceDetailsVF_01, sdncDesignerDetails);
+			ResourceRestUtils.checkCreateResponse(createVFInstResp);
+			System.out.println("instance " + i + "successfuly created");
+		}
+
+		getInstancesResponce = ComponentInstanceRestUtils.getComponentInstances(ComponentTypeEnum.SERVICE,
+				serviceDetails_01.getUniqueId(), sdncDesignerDetails);
+
+		BaseValidationUtils.checkSuccess(getInstancesResponce);
+
+	}
+
+	private String getUniqueIdOfFirstInstanceFromResponse(RestResponse response) {
+		try {
+			JSONArray value = ResponseParser.getListFromJson(response, "componentInstances");
+			return ResponseParser.getValueFromJsonResponse(value.get(0).toString(), "uniqueId");
+		} catch (Exception e) {
+			return null;
+		}
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java
new file mode 100644
index 0000000..262cb65
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/UpdateServiceMetadataTest.java
@@ -0,0 +1,2158 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.service;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.codehaus.jettison.json.JSONException;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class UpdateServiceMetadataTest extends ComponentBaseTest {
+
+	protected ArrayList<String> listForMessage = new ArrayList<String>();
+
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected User sdncDesignerDetails;
+	protected User sdncDesignerDetails2;
+	protected User sdncAdminDetails;
+	protected User sdncGovernorDeatails;
+	protected User sdncTesterDetails;
+	protected User sdncOpsDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails;
+	protected Component resourceDetailsVFCcomp;
+	protected Component serviceDetailsCompp;
+
+	@Rule
+	public static TestName name = new TestName();
+	protected ServiceReqDetails updatedServiceDetails;
+
+	public UpdateServiceMetadataTest() {
+		super(name, UpdateServiceMetadataTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void setUp() throws Exception {
+
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN4);
+		sdncGovernorDeatails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+		sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncOpsDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+		resourceDetailsVFCcomp = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				true, true);
+
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
+				LifeCycleStatesEnum.CERTIFY, true);
+		Service serviceServ = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, serviceServ,
+				UserRoleEnum.DESIGNER, true);
+
+		serviceDetails = new ServiceReqDetails(serviceServ);
+		updatedServiceDetails = updatedServiceDetails(serviceDetails);
+
+	}
+
+	protected void certifyService(ServiceReqDetails serviceDetails, String version) throws Exception {
+		LifecycleRestUtils.certifyService(serviceDetails);
+	}
+
+	protected ServiceReqDetails updatedServiceDetails(ServiceReqDetails service) {
+		ServiceReqDetails updatedServiceDetails = new ServiceReqDetails(service);
+
+		updatedServiceDetails.setDescription("updatedDescription");
+		updatedServiceDetails.setName(service.getName());
+		updatedServiceDetails.setProjectCode("987654654");
+		updatedServiceDetails.setIcon("icon-service-red3");
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("updateTag", updatedServiceDetails.getName())));
+		updatedServiceDetails.removeAllCategories();
+		updatedServiceDetails.setCategories(null);
+		updatedServiceDetails.addCategory(ServiceCategoriesEnum.VOIP.getValue());
+		updatedServiceDetails.setContactId("xy0123");
+
+		return updatedServiceDetails;
+	}
+
+	protected void addMandatoryArtifactsToService() throws Exception {
+		// TODO Andrey US575052
+		// ServiceRestUtils.addServiceMandatoryArtifacts(sdncDesignerDetails,
+		// createServiceResponse);
+	}
+
+	protected void getServiceAndValidate(ServiceReqDetails excpectedService, User creator, User updater,
+			LifecycleStateEnum lifeCycleState) throws Exception {
+		RestResponse getServiceResponse = ServiceRestUtils.getService(excpectedService.getUniqueId(),
+				sdncDesignerDetails);
+		AssertJUnit.assertNotNull("check response object is not null after updating service", getServiceResponse);
+		AssertJUnit.assertNotNull("check if error code exists in response after updating service",
+				getServiceResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after updating service", 200,
+				getServiceResponse.getErrorCode().intValue());
+		Service actualService = ResponseParser.convertServiceResponseToJavaObject(getServiceResponse.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(excpectedService, actualService, creator, updater,
+				lifeCycleState);
+	}
+
+	public void getServiceAndValidate(ServiceReqDetails excpectedService, LifecycleStateEnum lifecycleState)
+			throws Exception {
+		getServiceAndValidate(excpectedService, sdncDesignerDetails, sdncDesignerDetails, lifecycleState);
+	}
+
+	protected void validateResponse(RestResponse response, int errorCode, ActionStatus actionResponse,
+			List<String> listOfVariables) throws Exception {
+		AssertJUnit.assertNotNull("check response object is not null after updating service", response);
+		AssertJUnit.assertNotNull("check if error code exists in response after updating service",
+				response.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after updating service", errorCode,
+				response.getErrorCode().intValue());
+
+		if (actionResponse != null) {
+			ErrorValidationUtils.checkBodyResponseOnError(actionResponse.name(), listOfVariables,
+					response.getResponse());
+			return;
+		}
+
+		Service actualService = ResponseParser.convertServiceResponseToJavaObject(response.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(updatedServiceDetails, actualService,
+				sdncDesignerDetails, sdncDesignerDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	protected void validateActualVsExpected(ServiceReqDetails expectedService, RestResponse actualServiceFromResponse) {
+		Service actualService = ResponseParser
+				.convertServiceResponseToJavaObject(actualServiceFromResponse.getResponse());
+		ServiceValidationUtils.validateServiceResponseMetaData(updatedServiceDetails, actualService,
+				sdncDesignerDetails, sdncDesignerDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	protected String multipleString(String ch, int repeat) {
+		return StringUtils.repeat(ch, repeat);
+	}
+
+	protected void correctUpdate() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 200, null, listForMessage);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	protected void updateWithInvalidValue(ActionStatus invalidValue, List<String> arr) throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, invalidValue, arr);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	protected void charactersInRangeChecking(int min, int max, String field) throws Exception {
+		if (field != null) {
+			if (field == "name") {
+				for (char ch = (char) min; ch <= (char) max; ch++) {
+					updatedServiceDetails.setName("testname" + String.valueOf(ch));
+					updatedServiceDetails.setTags(
+							addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+					updateWithInvalidValue(ActionStatus.INVALID_COMPONENT_NAME,
+							new ArrayList<>(Arrays.asList("Service")));
+				}
+			} else if (field == "icon") {
+				for (char ch = (char) min; ch <= (char) max; ch++) {
+					updatedServiceDetails.setIcon("testname" + String.valueOf(ch));
+					updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_ICON,
+							new ArrayList<>(Arrays.asList("Service")));
+				}
+			} else if (field == "tags") {
+				List<String> variables = Arrays.asList("Service", "tag");
+				for (char ch = (char) min; ch <= (char) max; ch++) {
+					updatedServiceDetails.setTags(
+							new ArrayList<>(Arrays.asList(String.valueOf(ch), updatedServiceDetails.getName())));
+					updateWithInvalidValue(ActionStatus.INVALID_FIELD_FORMAT, variables);
+				}
+			} else if (field == "category") {
+				for (char ch = (char) min; ch <= (char) max; ch++) {
+					updatedServiceDetails.addCategoryChain(multipleString("1", 5) + String.valueOf(ch),
+							multipleString("1", 5) + String.valueOf(ch));
+					updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CATEGORY,
+							new ArrayList<>(Arrays.asList("Service")));
+				}
+			}
+
+			else if (field == "projectCode") {
+				for (char ch = (char) min; ch <= (char) max; ch++) {
+					updatedServiceDetails.setProjectCode(multipleString("1", 5) + String.valueOf(ch));
+					updateWithInvalidValue(ActionStatus.INVALID_PROJECT_CODE, listForMessage);
+				}
+			}
+
+			else
+				return;
+		}
+
+	}
+
+	protected void specialCharsChecking(String field) throws Exception {
+		charactersInRangeChecking(33, 44, field);
+		charactersInRangeChecking(47, 47, field);
+		charactersInRangeChecking(58, 64, field);
+		charactersInRangeChecking(91, 94, field);
+		charactersInRangeChecking(96, 96, field);
+		charactersInRangeChecking(123, 126, field);
+	}
+
+	@Test
+	public void updateServiceSuccessfully() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 200, null, listForMessage);
+
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+
+	}
+
+	protected void checkErrorResponse(ActionStatus actionStatus, ArrayList<String> arrList, RestResponse response)
+			throws Exception, JSONException {
+		ErrorValidationUtils.checkBodyResponseOnError(actionStatus.name(), arrList, response.getResponse());
+	}
+
+	protected List<String> addServiceNameToTagsList(String serviceName, List<String> tagsList) {
+		tagsList.add(serviceName);
+		return tagsList;
+
+	}
+
+	// @Test
+	// public void updateMetadateSuccessTest() throws Exception {
+	// CloseableHttpClient httpClient = HttpClients.createDefault();
+	// HttpGet httpGet =
+	// ServiceRestUtils.createGetServiceGetRquest(serviceDetails,
+	// sdncDesignerDetails);
+	// CloseableHttpResponse response = httpClient.execute(httpGet);
+	// assertTrue(response.getStatusLine().getStatusCode() == 200);
+	// String responseString = new
+	// BasicResponseHandler().handleResponse(response);
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(responseString);
+	// assertTrue("service object creation failed the returned object is null",
+	// serviceObject != null);
+	// String currentCategory = serviceObject.getCategories().get(0).getName();
+	// String currentServiceName = serviceObject.getName();
+	// String currentProjectCode = serviceObject.getProjectCode();
+	// String currentIcon = serviceObject.getIcon();
+	// String currentDescription = serviceObject.getDescription();
+	// List<String> currentTags = serviceObject.getTags();
+	//
+	// String newCategory = ServiceCategoriesEnum.VOIP.getValue();
+	// serviceDetails.addCategory(newCategory);
+	// // String newServiceName = "updated name";
+	// // serviceDetails.setServiceName(newServiceName);
+	// String newProjectCode = "68686868";
+	// serviceDetails.setProjectCode(newProjectCode);
+	// String newIcon = "updated-icon";
+	// serviceDetails.setIcon(newIcon);
+	// String newDescription = "updated description <html></html>";
+	// serviceDetails.setDescription(newDescription);
+	// List<String> newTags = new ArrayList<>();
+	// newTags.add("update1");
+	// newTags.add("update2");
+	// newTags.add(currentServiceName);
+	// serviceDetails.setTags(newTags);
+	// HttpPut httpPut =
+	// ServiceRestUtils.createUpdateServiceMetaDataPutRequest(serviceDetails,
+	// sdncDesignerDetails);
+	// response = httpClient.execute(httpPut);
+	// assertTrue(response.getStatusLine().getStatusCode() == 200);
+	// responseString = new BasicResponseHandler().handleResponse(response);
+	// String serviceUid =
+	// ServiceRestUtils.getServiceUniqueIdFromString(responseString);
+	//
+	// ServiceReqDetails details = new ServiceReqDetails();
+	// details.setUniqueId(serviceUid);
+	//
+	// httpGet = ServiceRestUtils.createGetServiceGetRquest(details,
+	// sdncDesignerDetails);
+	// response = httpClient.execute(httpGet);
+	// assertTrue(response.getStatusLine().getStatusCode() == 200);
+	// responseString = new BasicResponseHandler().handleResponse(response);
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(responseString);
+	// assertTrue("service object creation failed the returned object is null",
+	// serviceObject != null);
+	// String updatedCategory = serviceObject.getCategories().get(0).getName();
+	// String updatedServiceName = serviceObject.getName();
+	// String updatedProjectCode = serviceObject.getProjectCode();
+	// String updatedIcon = serviceObject.getIcon();
+	// String updatedDescription = serviceObject.getDescription();
+	// List<String> updatedTags = serviceObject.getTags();
+	// assertFalse("category did not cahnge",
+	// currentCategory.equals(updatedCategory));
+	// assertEquals("categoruy did not match expacted value", updatedCategory,
+	// newCategory);
+	// // assertFalse("service name did not change",
+	// currentServiceName.equals(updatedServiceName) );
+	// // assertEquals("service name did not match expacted
+	// value",updatedServiceName,newServiceName);
+	// assertFalse("projectCode did not change",
+	// currentProjectCode.equals(updatedProjectCode));
+	// assertEquals("projectCode not match expacted value", updatedProjectCode,
+	// newProjectCode);
+	// assertFalse("icon did not change", currentIcon.equals(updatedIcon));
+	// assertEquals("icon did not match expacted value", updatedIcon, newIcon);
+	// assertFalse("description did not change",
+	// currentDescription.equals(updatedDescription));
+	// assertEquals("description did not match expacted value", "updated
+	// description", updatedDescription);
+	// assertFalse("tags did not change", currentTags.containsAll(updatedTags));
+	// assertTrue("tags did not match expacted value",
+	// updatedTags.containsAll(newTags));
+	// }
+
+	@Test
+	public void updateService_ByOtherDesigner() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails2);
+		validateResponse(updateServiceResponse, 409, ActionStatus.RESTRICTED_OPERATION, listForMessage);
+
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void updateService_ByAdmin() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncAdminDetails);
+		validateResponse(updateServiceResponse, 409, ActionStatus.RESTRICTED_OPERATION, listForMessage);
+
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void updateServiceNotExist() throws Exception {
+		updatedServiceDetails.setUniqueId("nnnnn");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 404, ActionStatus.SERVICE_NOT_FOUND,
+				new ArrayList<String>(Arrays.asList("")));
+	}
+
+	@Test
+	public void updateCheckedinService() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 409, ActionStatus.RESTRICTED_OPERATION, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+	}
+
+	@Test
+	public void updateCertifiedService() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 409, ActionStatus.RESTRICTED_OPERATION, listForMessage);
+		getServiceAndValidate(serviceDetails, sdncDesignerDetails, sdncAdminDetails, LifecycleStateEnum.CERTIFIED);
+	}
+
+	// TODO Irrelevant
+	// @Test(enabled = false)
+	// public void updateService_NameCaseSensitiveTest() throws Exception {
+	// ServiceRestUtils.setServiceUniqueId(serviceDetails.getName().toUpperCase());
+	//
+	// RestResponse updateServiceResponse =
+	// ServiceRestUtils.updateService(updatedServiceDetails,
+	// sdncDesignerDetails);
+	// validateResponse(updateServiceResponse, 200, null, listForMessage);
+	//
+	// Service serviceFromJsonResponse =
+	// ResponseParser.convertServiceResponseToJavaObject(updateServiceResponse.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(updatedServiceDetails,
+	// serviceFromJsonResponse, sdncDesignerDetails, (LifecycleStateEnum)null);
+	//
+	// getServiceAndValidate(updatedServiceDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// }
+
+	// @Test
+	// public void updateApprovedDistributionServiceTest() throws Exception {
+	// // addMandatoryArtifactsToService();
+	// certifyService(serviceDetails, serviceDetails.getVersion());
+	//
+	// RestResponse approveResponse =
+	// ServiceRestUtils.sendApproveDistribution(sdncAdminDetails,
+	// serviceDetails.getUniqueId(), userRemarks);
+	// // validateResponse(approveResponse, 200, null, listForMessage);
+	//
+	// RestResponse updateServiceResponse =
+	// ServiceRestUtils.updateService(updatedServiceDetails,
+	// sdncDesignerDetails);
+	// validateResponse(updateServiceResponse, 409,
+	// ActionStatus.RESTRICTED_OPERATION, listForMessage);
+	//
+	// getServiceAndValidate(serviceDetails, sdncDesignerDetails,
+	// sdncAdminDetails,LifecycleStateEnum.CERTIFIED);
+	// }
+
+	@Test
+	public void updateServiceByMethod_delete() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.createServiceByHttpMethod(updatedServiceDetails,
+				sdncDesignerDetails, "DELETE", Urls.UPDATE_SERVICE_METADATA);
+		validateResponse(updateServiceResponse, 405, ActionStatus.NOT_ALLOWED, listForMessage);
+
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void updateServiceByMethod_get() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.createServiceByHttpMethod(updatedServiceDetails,
+				sdncDesignerDetails, "GET", Urls.UPDATE_SERVICE_METADATA);
+		validateResponse(updateServiceResponse, 405, ActionStatus.NOT_ALLOWED, listForMessage);
+
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void updateServiceByMethod_post() throws Exception {
+		RestResponse updateServiceResponse = ServiceRestUtils.createServiceByHttpMethod(updatedServiceDetails,
+				sdncDesignerDetails, "POST", Urls.UPDATE_SERVICE_METADATA);
+		validateResponse(updateServiceResponse, 405, ActionStatus.NOT_ALLOWED, listForMessage);
+
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void updateCheckoutCertifiedService() throws Exception // certify a
+																	// service
+																	// and
+																	// checkout
+																	// it
+	{
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKOUT);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.SERVICE_CATEGORY_CANNOT_BE_CHANGED, listForMessage);
+
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	// ---------------------------------------------------------Validation
+	// Tests---------------------------------------------------------
+
+	@Test
+	public void missingCategoryTest1() throws Exception {
+		List<CategoryDefinition> categories = updatedServiceDetails.getCategories();
+		CategoryDefinition categoryDefinition = categories.get(0);
+		CategoryDefinition categoryDefinition2 = categoryDefinition;
+		categoryDefinition2.setName("");
+		categories.set(0, categoryDefinition2);
+		updatedServiceDetails.setCategories(categories);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_CATEGORY, Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingCategoryTest2() throws Exception {
+		updatedServiceDetails.setCategories(null);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_CATEGORY, Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingServiceNameTest1() throws Exception {
+		updatedServiceDetails.setName(StringUtils.EMPTY);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.MISSING_COMPONENT_NAME, Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingServiceNameTest2() throws Exception {
+
+		updatedServiceDetails.setName(null);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.MISSING_COMPONENT_NAME, Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	// TODO Irrelevant
+	@Test(enabled = false)
+	public void missingProjectCodeTest1() throws Exception {
+		updatedServiceDetails.setProjectCode(StringUtils.EMPTY);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.MISSING_PROJECT_CODE, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	// TODO Irrelevant
+	@Test(enabled = false)
+	public void missingProjectCodeTest2() throws Exception {
+
+		updatedServiceDetails.setProjectCode(null);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.MISSING_PROJECT_CODE, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingIconTest1() throws Exception {
+		updatedServiceDetails.setIcon(StringUtils.EMPTY);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_ICON, Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingIconTest2() throws Exception {
+		updatedServiceDetails.setIcon(null);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_ICON, Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingDescriptionTest1() throws Exception {
+		updatedServiceDetails.setDescription(StringUtils.EMPTY);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_DESCRIPTION,
+				Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingDescriptionTest2() throws Exception {
+		updatedServiceDetails.setDescription(null);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_DESCRIPTION,
+				Arrays.asList("Service"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingTagsTest1() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<String>());
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_TAGS, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingTagsTest2() throws Exception {
+		updatedServiceDetails.setTags(null);
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.COMPONENT_MISSING_TAGS, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingTagsTest3() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList(StringUtils.EMPTY)));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.INVALID_FIELD_FORMAT,
+				Arrays.asList("Service", "tag"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void missingTagsTest4() throws Exception {
+		updatedServiceDetails
+				.setTags(new ArrayList<>(Arrays.asList(StringUtils.EMPTY, updatedServiceDetails.getName())));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		validateResponse(updateServiceResponse, 400, ActionStatus.INVALID_FIELD_FORMAT,
+				Arrays.asList("Service", "tag"));
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	// update non-settable/"updatable" parameters tests
+
+	// ------------------------------------------correct
+	// values------------------------------------------
+	@Test
+	public void contactIdValidationTest1() throws Exception {
+		updatedServiceDetails.setContactId("ab3456");
+		correctUpdate();
+	}
+
+	@Test
+	public void contactIdValidationTest2() throws Exception {
+
+		updatedServiceDetails.setContactId("cd789E");
+		correctUpdate();
+	}
+
+	@Test
+	public void contactIdValidationTest3() throws Exception {
+
+		updatedServiceDetails.setContactId("ef4567");
+		correctUpdate();
+	}
+
+	@Test
+	public void contactIdValidationTest4() throws Exception {
+		updatedServiceDetails.setContactId("AA012A");
+		correctUpdate();
+	}
+
+	@Test
+	public void contactIdValidationTest5() throws Exception {
+		updatedServiceDetails.setContactId("CD012c");
+		correctUpdate();
+	}
+
+	@Test
+	public void contactIdValidationTest6() throws Exception {
+		updatedServiceDetails.setContactId("EF0123");
+		correctUpdate();
+	}
+
+	// ------------------------------------------invalid
+	// values------------------------------------------
+	@Test
+	public void contactIdValidationTest7() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		updatedServiceDetails.setContactId("ab0001");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void contactIdValidationTest8() throws Exception {
+		// addMandatoryArtifactsToService();
+
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		updatedServiceDetails = new ServiceReqDetails(certifyService);
+		updatedServiceDetails.setContactId("ab0001");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void contactIdValidationTest9() throws Exception {
+		updatedServiceDetails.setContactId("01345a");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, Arrays.asList("Service"));
+	}
+
+	@Test
+	public void contactIdValidationTest10() throws Exception {
+		updatedServiceDetails.setContactId("0y000B");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, Arrays.asList("Service"));
+	}
+
+	@Test
+	public void contactIdValidationTest11() throws Exception {
+		updatedServiceDetails.setContactId("Y1000b");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, Arrays.asList("Service"));
+	}
+
+	@Test
+	public void contactIdValidationTest12() throws Exception {
+		updatedServiceDetails.setContactId("abxyzC");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, Arrays.asList("Service"));
+	}
+
+	@Test
+	public void contactIdValidationTest13() throws Exception {
+		updatedServiceDetails.setContactId("cdXYZc");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest14() throws Exception {
+		updatedServiceDetails.setContactId("efXY1D");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest15() throws Exception {
+		updatedServiceDetails.setContactId("EFabcD");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest16() throws Exception {
+		updatedServiceDetails.setContactId("EFABCD");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest17() throws Exception {
+		updatedServiceDetails.setContactId("EFABC1");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest18() throws Exception {
+		updatedServiceDetails.setContactId("efui1D");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest19() throws Exception {
+		updatedServiceDetails.setContactId("efui1!");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest20() throws Exception {
+		updatedServiceDetails.setContactId("ef555!");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest21() throws Exception {
+		updatedServiceDetails.setContactId(",f555");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest22() throws Exception {
+		updatedServiceDetails.setContactId("EF55.5");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest23() throws Exception {
+		updatedServiceDetails.setContactId("ab000");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest24() throws Exception {
+		updatedServiceDetails.setContactId("ab000c0");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest25() throws Exception {
+		updatedServiceDetails.setContactId("  ab0001");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CONTACT, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void contactIdValidationTest26() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKOUT);
+		updatedServiceDetails = new ServiceReqDetails(serviceDetails);
+		updatedServiceDetails.setContactId("xy0002");
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest1() throws Exception {
+		updatedServiceDetails.setName(multipleString("a", 49));
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest2() throws Exception {
+		updatedServiceDetails.setName(multipleString("b", 50));
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest3() throws Exception {
+		updatedServiceDetails.setName("testNamE");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest4() throws Exception {
+		updatedServiceDetails.setName("Testname");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest5() throws Exception {
+		updatedServiceDetails.setName("Test_name");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest6() throws Exception {
+		updatedServiceDetails.setName("Test name");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest7() throws Exception {
+		updatedServiceDetails.setName("Test-name");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest8() throws Exception {
+		updatedServiceDetails.setName("Test.name");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest9() throws Exception {
+		updatedServiceDetails.setName("...1...");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest10() throws Exception {
+		updatedServiceDetails.setName("-a_1. Arrrrrr");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest11() throws Exception {
+		updatedServiceDetails.setName("Testname1234567890");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		correctUpdate();
+	}
+
+	@Test
+	public void serviceNameValidationTest14() throws Exception {
+		updatedServiceDetails.setName(StringUtils.SPACE); // one space with
+															// nothing
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		// updateWithInvalidValue(ActionStatus.INVALID_COMPONENT_NAME, new
+		// ArrayList<>(Arrays.asList("Service")));
+		validateResponse(updateServiceResponse, 400, ActionStatus.MISSING_COMPONENT_NAME,
+				new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	// ------------------------------------------invalid
+	// values------------------------------------------
+	@Test
+	public void serviceNameValidationTest12() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		updatedServiceDetails.setName("TestNamE");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
+	}
+
+	@Test
+	public void serviceNameValidationTest13() throws Exception {
+		updatedServiceDetails.setName(multipleString("c", 51));
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		updateWithInvalidValue(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT,
+				new ArrayList<>(Arrays.asList("Service", "50")));
+	}
+
+	@Test
+	public void serviceNameValidationTest15() throws Exception {
+		specialCharsChecking("name");
+	}
+
+	@Test
+	public void serviceNameValidationTest16() throws Exception {
+		// addMandatoryArtifactsToService();
+		LifecycleRestUtils.certifyService(serviceDetails);
+		updatedServiceDetails.setName("testnamename");
+		updatedServiceDetails.setCategories(serviceDetails.getCategories());
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+		getServiceAndValidate(serviceDetails, sdncDesignerDetails, sdncTesterDetails, LifecycleStateEnum.CERTIFIED);
+	}
+
+	@Test
+	public void serviceNameValidationTest17() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKOUT);
+		updatedServiceDetails.setName("TestNamE");
+		updatedServiceDetails.setCategories(serviceDetails.getCategories());
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		RestResponse updateServiceResponse2 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		validateResponse(updateServiceResponse2, 400, ActionStatus.SERVICE_NAME_CANNOT_BE_CHANGED, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void serviceNameValidationTest18() throws Exception {
+		updatedServiceDetails.setName("  testname  ");
+		updatedServiceDetails
+				.setTags(addServiceNameToTagsList(updatedServiceDetails.getName(), updatedServiceDetails.getTags()));
+		RestResponse updateServiceResponse1 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse1);
+		assertNotNull(updateServiceResponse1.getErrorCode());
+		assertEquals(200, updateServiceResponse1.getErrorCode().intValue());
+		updatedServiceDetails.setName(updatedServiceDetails.getName());
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse1);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void iconValidationTest1() throws Exception {
+		updatedServiceDetails.setIcon(multipleString("a", 24));
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest2() throws Exception {
+		updatedServiceDetails.setIcon(multipleString("b", 25));
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest3() throws Exception {
+		updatedServiceDetails.setIcon("testNamE");
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest4() throws Exception {
+		updatedServiceDetails.setIcon("Testname");
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest5() throws Exception {
+		updatedServiceDetails.setIcon("Test_name");
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest6() throws Exception {
+		updatedServiceDetails.setIcon("Test-name");
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest7() throws Exception {
+		updatedServiceDetails.setIcon("Testname1234567890");
+		correctUpdate();
+	}
+
+	@Test
+	public void iconValidationTest8() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		updatedServiceDetails.setIcon("TestNamE");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void iconValidationTest9() throws Exception {
+		// addMandatoryArtifactsToService();
+		LifecycleRestUtils.certifyService(serviceDetails);
+		updatedServiceDetails.setIcon("testnamename");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	// ------------------------------------------invalid
+	// values------------------------------------------
+	@Test
+	public void iconValidationTest10() throws Exception {
+		updatedServiceDetails.setIcon("Test name");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_ICON, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void iconValidationTest11() throws Exception {
+		updatedServiceDetails.setIcon(StringUtils.SPACE); // one space with
+															// nothing
+		updateWithInvalidValue(ActionStatus.COMPONENT_MISSING_ICON, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void iconValidationTest12() throws Exception {
+		updatedServiceDetails.setIcon("Test.name");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_ICON, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void iconValidationTest13() throws Exception {
+		specialCharsChecking("icon");
+		charactersInRangeChecking(46, 46, "icon");
+	}
+
+	@Test
+	public void iconValidationTest14() throws Exception {
+		updatedServiceDetails.setIcon(multipleString("c", 26));
+		updateWithInvalidValue(ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT,
+				new ArrayList<>(Arrays.asList("Service", "25")));
+	}
+
+	@Test
+	public void iconValidationTest15() throws Exception {
+		// addMandatoryArtifactsToService();
+		RestResponse certifyServiceResp = LifecycleRestUtils.certifyService(serviceDetails);
+		Service certifyServiceServ = ResponseParser
+				.convertServiceResponseToJavaObject(certifyServiceResp.getResponse());
+		ServiceReqDetails certifyService = new ServiceReqDetails(certifyServiceServ);
+		updatedServiceDetails = new ServiceReqDetails(certifyService);
+		updatedServiceDetails.setIcon("testnamename");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void iconValidationTest16() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKOUT);
+		updatedServiceDetails = new ServiceReqDetails(serviceDetails);
+		updatedServiceDetails.setIcon("TestNamE");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.SERVICE_ICON_CANNOT_BE_CHANGED, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void iconValidationTest17() throws Exception {
+		updatedServiceDetails.setIcon("  Icon  ");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_ICON, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void categoryValidationTest1() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		updatedServiceDetails.addCategory(ServiceCategoriesEnum.VOIP.getValue());
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void categoryValidationTest2() throws Exception {
+		// updatedServiceDetails.addCategory("someCategory");
+		updatedServiceDetails.setCategories(null);
+		updatedServiceDetails.addCategoryChain("someCategory", null);
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CATEGORY, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void categoryValidationTest3() throws Exception {
+		updatedServiceDetails.setCategories(null);
+		updatedServiceDetails.addCategoryChain("SomeCategory10", null);
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CATEGORY, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void categoryValidationTest4() throws Exception {
+		updatedServiceDetails.setCategories(null);
+		updatedServiceDetails.addCategoryChain("some Category", null);
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_CATEGORY, new ArrayList<>(Arrays.asList("Service")));
+	}
+
+	@Test
+	public void categoryValidationTest5() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		updatedServiceDetails = new ServiceReqDetails(serviceDetails);
+		updatedServiceDetails.addCategory("Network L1-3");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void categoryValidationTest6() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKOUT);
+		updatedServiceDetails = new ServiceReqDetails(serviceDetails);
+		updatedServiceDetails = serviceDetails;
+		List<CategoryDefinition> categories = updatedServiceDetails.getCategories();
+		CategoryDefinition categoryDefinition = categories.get(0);
+		CategoryDefinition categoryDefinition2 = categoryDefinition;
+		categoryDefinition2.setName("ccc");
+		categories.set(0, categoryDefinition2);
+		updatedServiceDetails.setCategories(categories);
+		RestResponse updateServiceResponse2 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		validateResponse(updateServiceResponse2, 400, ActionStatus.SERVICE_CATEGORY_CANNOT_BE_CHANGED, listForMessage);
+		getServiceAndValidate(serviceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void categoryValidationTest7() throws Exception {
+		updatedServiceDetails.removeAllCategories();
+		updatedServiceDetails.addCategory(ServiceCategoriesEnum.NETWORK_L3.getValue());
+		correctUpdate();
+	}
+
+	@Test
+	public void categoryValidationTest8() throws Exception {
+		updatedServiceDetails.setCategories(null);
+		updatedServiceDetails.addCategoryChain("Network L1-3", null);
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest1() throws Exception {
+		updatedServiceDetails
+				.setTags(new ArrayList<>(Arrays.asList(multipleString("a", 49), updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest2() throws Exception {
+		updatedServiceDetails
+				.setTags(new ArrayList<>(Arrays.asList(multipleString("B", 50), updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest3() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(
+				Arrays.asList(multipleString("A", 50), multipleString("B", 50), updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest5() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("testTaG", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest6() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("Testtag", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest7() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("Test_tag", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest8() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("Test tag", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest9() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("Test-tag", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest10() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("Test.tag", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest11() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("...1...", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest12() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("-a_1. Arrrrrr", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest13() throws Exception {
+		updatedServiceDetails
+				.setTags(new ArrayList<>(Arrays.asList("Testtag1234567890", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest14() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("1", "2", "2", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest15() throws Exception {
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKIN);
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("TestTaG", updatedServiceDetails.getName())));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void tagsValidationTest16() throws Exception {
+		// addMandatoryArtifactsToService();
+		LifecycleRestUtils.certifyService(serviceDetails);
+		updatedServiceDetails = new ServiceReqDetails(serviceDetails);
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("testtagtag", updatedServiceDetails.getName())));
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		checkErrorResponse(ActionStatus.RESTRICTED_OPERATION, listForMessage, updateServiceResponse);
+	}
+
+	@Test
+	public void tagsValidationTest17() throws Exception {
+		// addMandatoryArtifactsToService();
+		certifyService(serviceDetails, serviceDetails.getVersion());
+		LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
+				LifeCycleStatesEnum.CHECKOUT);
+		updatedServiceDetails = new ServiceReqDetails(serviceDetails);
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("TestTaG", updatedServiceDetails.getName())));
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest18() throws Exception {
+		int lengthOfServiceName = updatedServiceDetails.getName().length();
+		int maxLengthTag = 50;
+		int tagsCount = 1024 - lengthOfServiceName;
+		ArrayList<String> tagsList = new ArrayList<>();
+		tagsList.add(updatedServiceDetails.getName());
+		while (tagsCount > maxLengthTag) {
+			tagsList.add(multipleString("a", maxLengthTag));
+			tagsCount -= maxLengthTag + 1
+					+ 1/* (50 and comma of each tag + one space, totally 52) */;
+		}
+		tagsList.add(multipleString("a", tagsCount));
+		updatedServiceDetails.setTags(tagsList);
+		correctUpdate();
+	}
+
+	@Test
+	public void tagsValidationTest19() throws Exception {
+		updatedServiceDetails.setTags(new ArrayList<>(Arrays.asList("   Tag   ", updatedServiceDetails.getName())));
+		RestResponse updateServiceResponse1 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse1);
+		assertNotNull(updateServiceResponse1.getErrorCode());
+		assertEquals(200, updateServiceResponse1.getErrorCode().intValue());
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse1);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void tagsValidationTest20() throws Exception {
+		ArrayList<String> tagsList = new ArrayList<>();
+		tagsList.add(updatedServiceDetails.getName());
+		tagsList.add("");
+		updatedServiceDetails.setTags(tagsList);
+		updateWithInvalidValue(ActionStatus.INVALID_FIELD_FORMAT, Arrays.asList("Service", "tag"));
+	}
+
+	// ------------------------------------------invalid
+	// values------------------------------------------
+
+	@Test
+	public void tagsValidationTest21() throws Exception {
+		ArrayList<String> tagsList = new ArrayList<>();
+		tagsList.add("onetag");
+		updatedServiceDetails.setTags(tagsList);
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME, listForMessage);
+
+	}
+
+	@Test
+	public void tagsValidationTest22() throws Exception {
+		specialCharsChecking("tags");
+	}
+
+	@Test
+	public void descriptionValidationTest1() throws Exception {
+		updatedServiceDetails.setDescription(multipleString("a", 1023));
+		correctUpdate();
+	}
+
+	@Test
+	public void descriptionValidationTest2() throws Exception {
+		updatedServiceDetails.setDescription(multipleString("a", 1024));
+		correctUpdate();
+	}
+
+	@Test
+	public void descriptionValidationTest3() throws Exception {
+		updatedServiceDetails.setDescription(multipleString("aB", 1024 / 2));
+		correctUpdate();
+	}
+
+	@Test
+	public void descriptionValidationTest4() throws Exception {
+		updatedServiceDetails.setDescription("1234567890");
+		correctUpdate();
+	}
+
+	@Test
+	public void descriptionValidationTest5() throws Exception {
+		updatedServiceDetails.setDescription("desc ription");
+		correctUpdate();
+	}
+
+	@Test
+	public void descriptionValidationTest6() throws Exception {
+		updatedServiceDetails.setDescription("desc\tription");
+		RestResponse updateServiceResponse1 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse1);
+		assertNotNull(updateServiceResponse1.getErrorCode());
+		assertEquals(200, updateServiceResponse1.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("desc ription");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse1);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest7() throws Exception {
+		updatedServiceDetails.setDescription("desc      ription     ");
+		RestResponse updateServiceResponse2 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse2);
+		assertNotNull(updateServiceResponse2.getErrorCode());
+		assertEquals(200, updateServiceResponse2.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("desc ription");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse2);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest8() throws Exception {
+		updatedServiceDetails.setDescription("desc" + StringUtils.LF + "ription");
+		RestResponse updateServiceResponse3 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse3);
+		assertNotNull(updateServiceResponse3.getErrorCode());
+		assertEquals(200, updateServiceResponse3.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("desc ription");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse3);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest9() throws Exception {
+		updatedServiceDetails.setDescription("<html>Hello, <b>world!</b></html>");
+		RestResponse updateServiceResponse4 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse4);
+		assertNotNull(updateServiceResponse4.getErrorCode());
+		assertEquals(200, updateServiceResponse4.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("Hello, world!");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse4);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest10() throws Exception {
+		updatedServiceDetails.setDescription("\uC2B5");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_DESCRIPTION, new ArrayList<>(Arrays.asList("Service")));
+
+	}
+
+	@Test
+	public void descriptionValidationTest10_a() throws Exception {
+		updatedServiceDetails.setDescription("文");
+		updateWithInvalidValue(ActionStatus.COMPONENT_INVALID_DESCRIPTION, new ArrayList<>(Arrays.asList("Service")));
+
+	}
+
+	@Test
+	public void descriptionValidationTest10_b() throws Exception {
+		updatedServiceDetails.setDescription("\uC2B5abc");
+		RestResponse updateServiceResponse5 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse5);
+		assertNotNull(updateServiceResponse5.getErrorCode());
+		assertEquals(200, updateServiceResponse5.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("abc");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse5);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+
+	}
+
+	@Test
+	public void descriptionValidationTest11() throws Exception {
+		updatedServiceDetails.setDescription("&<>");
+		RestResponse updateServiceResponse6 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse6);
+		assertNotNull(updateServiceResponse6.getErrorCode());
+		assertEquals(200, updateServiceResponse6.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("&amp;&lt;&gt;");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse6);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest12() throws Exception {
+		updatedServiceDetails.setDescription("文 test");
+		RestResponse updateServiceResponse7 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse7);
+		assertNotNull(updateServiceResponse7.getErrorCode());
+		assertEquals(200, updateServiceResponse7.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("test");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse7);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest13() throws Exception {
+		updatedServiceDetails.setDescription("   description");
+		RestResponse updateServiceResponse8 = ServiceRestUtils.updateService(updatedServiceDetails,
+				sdncDesignerDetails);
+		assertNotNull(updateServiceResponse8);
+		assertNotNull(updateServiceResponse8.getErrorCode());
+		assertEquals(200, updateServiceResponse8.getErrorCode().intValue());
+		updatedServiceDetails.setDescription("description");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse8);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	}
+
+	@Test
+	public void descriptionValidationTest14() throws Exception {
+		updatedServiceDetails.setDescription(multipleString("a", 1025));
+		updateWithInvalidValue(ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT,
+				new ArrayList<>(Arrays.asList("Service", "1024")));
+	}
+
+	@Test
+	public void projectCodeValidationTest1() throws Exception {
+		String desc = StringUtils.EMPTY;
+		for (int i = 0; i < 10; i++) {
+			desc += Integer.toString(i);
+			if (i >= 4) {
+				updatedServiceDetails.setProjectCode(desc);
+				correctUpdate();
+			}
+		}
+	}
+
+	@Test
+	public void projectCodeValidationTest2() throws Exception {
+		updatedServiceDetails.setProjectCode(multipleString("1", 6));
+		correctUpdate();
+	}
+
+	@Test
+	public void projectCodeValidationTest3() throws Exception {
+		this.specialCharsChecking("projectCode");
+	}
+
+	// TODO Irrelevant
+	@Test(enabled = false)
+	public void projectCodeValidationTest4() throws Exception {
+		updatedServiceDetails.setProjectCode(multipleString(" ", 5) + "99999");
+		RestResponse updateServiceResponse = ServiceRestUtils.updateService(updatedServiceDetails, sdncDesignerDetails);
+		assertNotNull(updateServiceResponse);
+		assertNotNull(updateServiceResponse.getErrorCode());
+		assertEquals(200, updateServiceResponse.getErrorCode().intValue());
+		updatedServiceDetails.setProjectCode("12345");
+		validateActualVsExpected(updatedServiceDetails, updateServiceResponse);
+		getServiceAndValidate(updatedServiceDetails, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+
+	}
+
+	@Test
+	public void projectCodeValidationTest5() throws Exception {
+		updatedServiceDetails.setProjectCode(multipleString("0", 11));
+		updateWithInvalidValue(ActionStatus.INVALID_PROJECT_CODE, listForMessage);
+	}
+
+	@Test
+	public void projectCodeValidationTest6() throws Exception {
+		updatedServiceDetails.setProjectCode(multipleString("1", 4));
+		updateWithInvalidValue(ActionStatus.INVALID_PROJECT_CODE, listForMessage);
+	}
+
+	@Test
+	public void projectCodeValidationTest7() throws Exception {
+		updatedServiceDetails.setProjectCode("123456789");
+		correctUpdate();
+	}
+
+	// ////US553874
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion01_isVNF_toTrue() throws Exception{
+	//
+	// //choose the user to create service
+	// User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//
+	// //Update Service IsVNF to True
+	// restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 200, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion02_isVNF_toFalse() throws Exception{
+	//
+	// //choose the user to create service
+	// User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//
+	// //Update Service IsVNF to True
+	// restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 200, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion01_isVNF_TrueToNull() throws Exception{
+	//
+	// //choose the user to create service
+	// User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//
+	// //Update Service IsVNF to True
+	// restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 400, restResponse.getErrorCode().intValue());
+	// List<String> variables = Arrays.asList("VNF Service Indicator");
+	// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_DATA.name(),
+	// variables, restResponse.getResponse());
+	//
+	// //get service and verify that service created with isVNF is remained with
+	// isVNF = true
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion01_isVNF_FalseToNull() throws Exception{
+	//
+	// //choose the user to create service
+	// User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//
+	// //Update Service IsVNF to True
+	// restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 400, restResponse.getErrorCode().intValue());
+	// List<String> variables = Arrays.asList("VNF Service Indicator");
+	// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_DATA.name(),
+	// variables, restResponse.getResponse());
+	//
+	// //get service and verify that service created with isVNF is remained with
+	// isVNF = true
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion02_IsVNF_toTrue() throws Exception{
+	//
+	// //choose the user to create service
+	// User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// LifecycleRestUtils.changeServiceState(serviceDetails,
+	// sdncDesignerDetails, serviceDetails.getVersion(),
+	// LifeCycleStatesEnum.CHECKIN);
+	// LifecycleRestUtils.changeServiceState(serviceDetails,
+	// sdncDesignerDetails, serviceDetails.getVersion(),
+	// LifeCycleStatesEnum.CHECKOUT);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//
+	// //Update Service IsVNF to True
+	// restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 200, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion02_IsVNF_toFalse() throws Exception{
+	//
+	// //choose the user to create service
+	// User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// LifecycleRestUtils.changeServiceState(serviceDetails,
+	// sdncDesignerDetails, serviceDetails.getVersion(),
+	// LifeCycleStatesEnum.CHECKIN);
+	// LifecycleRestUtils.changeServiceState(serviceDetails,
+	// sdncDesignerDetails, serviceDetails.getVersion(),
+	// LifeCycleStatesEnum.CHECKOUT);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//
+	// //Update Service IsVNF to false
+	// restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// //restResponse =
+	// ServiceRestUtils.updateService(serviceDetails.getUniqueId(),
+	// serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 200, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion11_IsVNF_toFalse() throws Exception{
+	// // Can't update isVNF when service version is 1.X
+	// User sdncUserDetails =
+	// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// //String serviceUniqueName =
+	// ServiceRestUtils.getServiceUniqueId(serviceByNameAndVersion);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceRestUtils.constructFieldsForAuditValidation(serviceDetails, "0.1",
+	// sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//// ServiceRestUtils.addServiceMandatoryArtifacts(sdncUserDetails,
+	// restResponse);
+	// RestResponse response =
+	// ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+	// sdncUserDetails, serviceDetails.getUniqueId(),
+	// ComponentTypeEnum.SERVICE);
+	// assertTrue("response code is not 201, returned: " +
+	// response.getErrorCode(),response.getErrorCode() == 201);
+	// RestResponse changeServiceState =
+	// LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+	// assertTrue("certify service request returned status:" +
+	// changeServiceState.getErrorCode(),changeServiceState.getErrorCode() ==
+	// 200);
+	// LifecycleRestUtils.changeServiceState(serviceDetails, sdncUserDetails,
+	// LifeCycleStatesEnum.CHECKOUT);
+	//
+	// //Update Service IsVNF to false
+	// restResponse = ServiceRestUtils.updateService(serviceDetails,
+	// sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating service metadata", 400,
+	// restResponse.getErrorCode().intValue());
+	// List<String> variables = new ArrayList<String>();
+	// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_IS_VNF_CANNOT_BE_CHANGED.name(),
+	// variables, restResponse.getResponse());
+	//
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "1.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	//
+	// }
+	//
+	// @JsonIgnore
+	// @Test
+	// public void UpdateServiceVersion11_IsVNF_toTrue() throws Exception{
+	// // Can't update isVNF when service version is 1.X
+	// User sdncUserDetails =
+	// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	// // new service details
+	// // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+	// // clean audit DB before updating service
+	// DbUtils.cleanAllAudits();
+	// ServiceRestUtils.deleteServiceById(serviceDetails.getUniqueId(),
+	// sdncUserDetails.getUserId());
+	// serviceDetails = ElementFactory.getDefaultService();
+	//
+	// //send create service toward BE
+	// RestResponse restResponse =
+	// ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating Interface Artifact",
+	// 201, restResponse.getErrorCode().intValue());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// RestResponse serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "0.1");
+	// Service serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// //String serviceUniqueName =
+	// ServiceRestUtils.getServiceUniqueId(serviceByNameAndVersion);
+	//
+	// //validate audit
+	// ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	// ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails,
+	// "0.1", sdncUserDetails);
+	// String auditAction="Create";
+	// expectedResourceAuditJavaObject.setPrevState("");
+	// expectedResourceAuditJavaObject.setPrevVersion("");
+	// expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// expectedResourceAuditJavaObject.setStatus("201");
+	// expectedResourceAuditJavaObject.setDesc("OK");
+	// AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
+	// auditAction, null, false);
+	//
+	//// ServiceRestUtils.addServiceMandatoryArtifacts(sdncUserDetails,
+	// restResponse);
+	// RestResponse response =
+	// ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails,
+	// sdncUserDetails, serviceDetails.getUniqueId(),
+	// ComponentTypeEnum.SERVICE);
+	// assertTrue("response code is not 201, returned: " +
+	// response.getErrorCode(),response.getErrorCode() == 201);
+	// RestResponse changeServiceState =
+	// LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
+	// assertTrue("certify service request returned status:" +
+	// changeServiceState.getErrorCode(),changeServiceState.getErrorCode() ==
+	// 200);
+	// LifecycleRestUtils.changeServiceState(serviceDetails, sdncUserDetails,
+	// LifeCycleStatesEnum.CHECKOUT);
+	//
+	// //Update Service IsVNF to false
+	// restResponse = ServiceRestUtils.updateService(serviceDetails,
+	// sdncUserDetails);
+	// assertNotNull("check error code exists in response after create service",
+	// restResponse.getErrorCode());
+	// assertEquals("Check response code after updating service metadata", 400,
+	// restResponse.getErrorCode().intValue());
+	// List<String> variables = new ArrayList<String>();
+	// ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_IS_VNF_CANNOT_BE_CHANGED.name(),
+	// variables, restResponse.getResponse());
+	//
+	// //get service and verify that service created with isVNF defined in
+	// serviceDetails
+	// serviceByNameAndVersion =
+	// ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails,
+	// serviceDetails.getName(), "1.1");
+	// serviceObject =
+	// ResponseParser.convertServiceResponseToJavaObject(serviceByNameAndVersion.getResponse());
+	// ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails,
+	// serviceObject, sdncUserDetails,
+	// LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java
new file mode 100644
index 0000000..24afcec
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java
@@ -0,0 +1,756 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.user;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.http.HttpStatus;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.utils.UserStatusEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedUserCRUDAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.users.UserResponseMessageEnum;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.UserValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.google.gson.reflect.TypeToken;
+
+/**
+ * @author alitvinsky
+ *
+ */
+public class ActivateDeActivateDeleteUser extends ComponentBaseTest {
+	private static Logger logger = LoggerFactory.getLogger(ActivateDeActivateDeleteUser.class.getName());
+	protected Gson gson = new Gson();
+	protected User sdncAdminUser;
+
+	@BeforeMethod
+	public void init() {
+		sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+	}
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ActivateDeActivateDeleteUser() {
+		super(name, ActivateDeActivateDeleteUser.class.getName());
+	}
+
+	@Test
+	public void authorizeDeActivatedUser() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+			// deActivate created user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
+			validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
+
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+			RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+
+			AssertJUnit.assertEquals("Check response code after deActive user", errorInfo.getCode(),
+					getUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
+					getUserResponse.getResponse());
+
+			// clean audit before authorization test
+			DbUtils.cleanAllAudits();
+
+			// Perform login from WebSeal
+			User sealUserDetails = sdncUserDetails;
+			RestResponse authorizedUserResponse = UserRestUtils.authorizedUserTowardsCatalogBeQA(sealUserDetails);
+
+			// validate response
+
+			ErrorInfo errorInfo2 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_ACCESS.name());
+
+			AssertJUnit.assertNotNull("check response object is not null after user login", authorizedUserResponse);
+			AssertJUnit.assertNotNull("check error code exists in response after user login",
+					authorizedUserResponse.getErrorCode());
+			AssertJUnit.assertEquals("Check response code after deActive user", errorInfo2.getCode(),
+					authorizedUserResponse.getErrorCode());
+
+			List<String> variables2 = Arrays.asList();
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_ACCESS.name(), variables2,
+					authorizedUserResponse.getResponse());
+
+			// validate against ES DB
+
+			UserValidationUtils.validateDataAgainstAuditDB_access(sealUserDetails,
+					DbUtils.parseAuditRespByAction("Access"), authorizedUserResponse, errorInfo2, variables2);
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	public User getDefaultUserDetails() {
+
+		String httpCspUserId = "km2000";
+		String userFirstName = "Kot";
+		String userLastName = "May";
+		String email = "km2000@intl.sdc.com";
+		String role = UserRoleEnum.ADMIN.name();
+		User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+
+		return sdncUserDetails;
+	}
+
+	public void validateSuccessCreateUserResponse(User sdncUserDetails, RestResponse createUserResponse)
+			throws Exception {
+
+		AssertJUnit.assertNotNull("check response object is not null after create user", createUserResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create user",
+				createUserResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create user", HttpStatus.SC_CREATED,
+				createUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
+		// UserRestUtils.validateAddUserAuditMessage(sdncUserDetails,
+		// sdncAdminUser, String.valueOf(HttpStatus.SC_CREATED),
+		// UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+		// UserRestUtils.getAddUserAuditMessage("AddUser"));
+		String addUser = "AddUser";
+		ExpectedUserCRUDAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(addUser,
+				sdncAdminUser, ActionStatus.CREATED, sdncUserDetails, null);
+		AuditValidationUtils.validateAddUserAudit(constructFieldsForAuditValidation, addUser);
+
+		RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
+
+	}
+
+	public void validateSuccessDeActivateUserResponse(User sdncUserDetails, RestResponse deActivateUserResponse)
+			throws Exception {
+
+		AssertJUnit.assertNotNull("check response object is not null after deActive user", deActivateUserResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after deActive user",
+				deActivateUserResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after deActive user", 200,
+				deActivateUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, deActivateUserResponse.getResponse());
+
+		String deleteUser = "DeleteUser";
+		ExpectedUserCRUDAudit constructFieldsForAuditValidation = Convertor
+				.constructFieldsForAuditValidation(deleteUser, sdncAdminUser, ActionStatus.OK, null, sdncUserDetails);
+		AuditValidationUtils.validateAddUserAudit(constructFieldsForAuditValidation, deleteUser);
+
+	}
+
+	// US498322 - Add Status Field to USER
+
+	@Test
+	public void createNewUser() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	@Test
+	public void createDefaultUser() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+		sdncUserDetails.setFirstName(null);
+		sdncUserDetails.setLastName(null);
+		sdncUserDetails.setEmail(null);
+		sdncUserDetails.setRole(null);
+
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	@Test
+	public void createTesterUser() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+		sdncUserDetails.setLastName(null);
+		sdncUserDetails.setRole(UserRoleEnum.TESTER.name());
+
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	@Test
+	public void deActivateCreatedAdminUser() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+			// deActivate created user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
+			validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
+
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+
+			RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+
+			assertEquals("Check response code after get user", errorInfo.getCode(), getUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
+					getUserResponse.getResponse());
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	@Test
+	public void deActivateTheSameUserTwice() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+			// deActivate created user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
+			validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
+
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+
+			RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+
+			assertEquals("Check response code after deActive user", errorInfo.getCode(),
+					getUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
+					getUserResponse.getResponse());
+
+			// deActivate the same user once time more
+			RestResponse deActivateUserResponse2 = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			ErrorInfo errorInfo2 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+			assertEquals("Check response code after deActive user", errorInfo2.getCode(),
+					deActivateUserResponse2.getErrorCode());
+
+			List<String> variables2 = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables2,
+					deActivateUserResponse2.getResponse());
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	@Test
+	public void createAgainDeActivatedUser() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+
+		try {
+
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+			// deActivate created user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
+			validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
+
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+			RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+
+			assertEquals("Check response code after deActive user", errorInfo.getCode(),
+					getUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
+					getUserResponse.getResponse());
+
+			// create the user with the same UserId(details) as deActivated user
+			DbUtils.cleanAllAudits();
+
+			RestResponse createUserResponse2 = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			ErrorInfo errorInfo2 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+			assertEquals("Check response code after deActive user", errorInfo2.getCode(),
+					createUserResponse2.getErrorCode());
+
+			List<String> variables2 = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables2,
+					createUserResponse2.getResponse());
+
+		} finally {
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	// very not recommend to run this test, resources/services may be zombie
+	// @Test
+	public void deActivateLastAdminUser() throws Exception {
+
+		try {
+
+			// send get all ADMIN user request toward BE
+			RestResponse getAllAdminUsers = UserRestUtils.getAllAdminUsers(sdncAdminUser);
+
+			assertNotNull("check response object is not null after create user", getAllAdminUsers);
+			assertNotNull("check error code exists in response after create user", getAllAdminUsers.getErrorCode());
+			assertEquals("Check response code after create user", 200, getAllAdminUsers.getErrorCode().intValue());
+
+			TypeToken<List<User>> typeToken = new TypeToken<List<User>>() {
+			};
+			List<User> listOfUsersOnResponse = gson.fromJson(getAllAdminUsers.getResponse(), typeToken.getType());
+			logger.debug("listOfUsers: {}", listOfUsersOnResponse);
+
+			// build map of all Admin users from listOfUsersOnResponse from
+			// response
+			Map<String, User> mapAllUsersOnResponse = new HashMap<String, User>();
+			for (User sdncUser : listOfUsersOnResponse) {
+				mapAllUsersOnResponse.put(sdncUser.getUserId(), sdncUser);
+			}
+
+			// remove from mapAllUsersOnResponse map one of admin users
+			mapAllUsersOnResponse.remove(sdncAdminUser.getUserId());
+			logger.debug("map Of all Admin users exclude one : {}", mapAllUsersOnResponse);
+
+			// deActivate all Admin users from the userIdAllAdminList list
+			for (Entry<String, User> entry : mapAllUsersOnResponse.entrySet()) {
+				UserRestUtils.deActivateUser(entry.getValue(), sdncAdminUser);
+			}
+
+			// deActivate last Admin user user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncAdminUser, sdncAdminUser);
+
+			ErrorInfo errorInfo = ErrorValidationUtils
+					.parseErrorConfigYaml(ActionStatus.DELETE_USER_ADMIN_CONFLICT.name());
+
+			assertEquals("Check response code after deActive user", errorInfo.getCode(),
+					deActivateUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList();
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DELETE_USER_ADMIN_CONFLICT.name(), variables,
+					deActivateUserResponse.getResponse());
+
+		} finally {
+			// UserRestUtils.deleteUser(UserRestUtils.getAdminDetails2(),
+			// sdncAdminUser);
+			// UserRestUtils.deleteUser(UserRestUtils.getAdminDetails3(),
+			// sdncAdminUser);
+			// UserRestUtils.createUser(UserRestUtils.getAdminDetails2(),
+			// sdncAdminUser);
+			// UserRestUtils.createUser(UserRestUtils.getAdminDetails3(),
+			// sdncAdminUser);
+		}
+
+	}
+
+	// test check the resource accessibility via catalog view, resource was
+	// created by user which was deActivated
+
+	@Test
+	public void resourceAccessibility() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource("tosca.nodes.newresource4test4",
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
+		String resourceBaseVersion = "0.1";
+
+		try {
+			// Delete resource
+			// resourceUtils.deleteResource_allVersions(resourceDetails,
+			// sdncAdminUser);
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+
+			DbUtils.cleanAllAudits();
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+			// ------------------------Start create
+			// resource---------------------------------------------------------------------------------
+
+			// create resource
+			RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
+			assertEquals("Check response code after create", 201, createResponse.getErrorCode().intValue());
+
+			Resource createdResource = ResponseParser.convertResourceResponseToJavaObject(createResponse.getResponse());
+
+			RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncUserDetails,
+					createdResource.getUniqueId());
+			assertEquals("Check response code after get", 200, resourceGetResponse.getErrorCode().intValue());
+
+			// validate get response
+			ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
+					resourceBaseVersion);
+			resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+			resourceRespJavaObject.setAbstractt("false");
+			resourceRespJavaObject.setCreatorUserId(sdncUserDetails.getUserId());
+			resourceRespJavaObject.setLastUpdaterUserId(sdncUserDetails.getUserId());
+
+			resourceRespJavaObject
+					.setCreatorFullName(sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName());
+			resourceRespJavaObject
+					.setLastUpdaterFullName(sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName());
+
+			ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
+
+			// ------------------------End create
+			// resource---------------------------------------------------------------------------------
+
+			// clean audit before authorization test
+			DbUtils.cleanAllAudits();
+
+			// deActivate created user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
+			validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
+
+			UserValidationUtils.validateDeleteUserAuditMessage(sdncUserDetails, sdncAdminUser, "200",
+					UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+					UserValidationUtils.getAddUserAuditMessage("DeleteUser"));
+
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+			RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+
+			assertEquals("Check response code after deActive user", errorInfo.getCode(),
+					getUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
+					getUserResponse.getResponse());
+
+			// checking if created resource is accessible
+			DbUtils.cleanAllAudits();
+
+			RestResponse getCatalogDataResponse = CatalogRestUtils.getCatalog(sdncAdminUser.getUserId());
+
+			// validate response
+
+			assertNotNull("check response object is not null after user login", getCatalogDataResponse);
+			assertNotNull("check error code exists in response after user login",
+					getCatalogDataResponse.getErrorCode());
+			assertEquals("Check response code after deActive user", 200,
+					getCatalogDataResponse.getErrorCode().intValue());
+
+			// expected resource list
+			List<String> resourceExpectedUniqIdList = new ArrayList<String>();
+			resourceExpectedUniqIdList.add(resourceDetails.getUniqueId());
+			logger.debug("resourceExpectedUniqIdList: {}", resourceExpectedUniqIdList);
+
+			compareResourceUniqIdList(getCatalogDataResponse.getResponse(), resourceExpectedUniqIdList, true);
+
+		} finally {
+			// resourceUtils.deleteResource_allVersions(resourceDetails,
+			// sdncAdminUser);
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	// test check the resource accessibility via catalog view, resource was
+	// created by user which was deActivated
+
+	@Test
+	public void resourceAccessibilityOnImport() throws Exception {
+
+		User sdncUserDetails = getDefaultUserDetails();
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource("importResource4test",
+				NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, "jh0003");
+		resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(),
+				ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
+		// String resourceBaseVersion = "1.0";
+
+		try {
+			// Delete resource
+			// resourceUtils.deleteResource_allVersions(resourceDetails,
+			// sdncAdminUser);
+			RestResponse deleteUserResponse = UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+			assertTrue("delete user request failed",
+					deleteUserResponse.getErrorCode() == 200 || deleteUserResponse.getErrorCode() == 404);
+			DbUtils.cleanAllAudits();
+			RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+			validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
+
+			// ------------------------Start import
+			// resource---------------------------------------------------------------------------------
+
+			// import new resource with CERTIFIED state
+			User importer = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN4);
+			RestResponse importResponse = ImportRestUtils.importResourceByName(resourceDetails, importer);
+
+			assertNotNull("check response object is not null after create user", importResponse);
+			assertNotNull("check error code exists in response after create user", importResponse.getErrorCode());
+			assertEquals("Check response code after create user", 201, importResponse.getErrorCode().intValue());
+
+			// ------------------------End import
+			// resource---------------------------------------------------------------------------------
+
+			// clean audit before authorization test
+			DbUtils.cleanAllAudits();
+
+			// deActivate created user
+			RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
+			sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
+			validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
+
+			UserValidationUtils.validateDeleteUserAuditMessage(sdncUserDetails, sdncAdminUser, "200",
+					UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+					UserValidationUtils.getAddUserAuditMessage("DeleteUser"));
+
+			ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
+			RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+
+			assertEquals("Check response code after deActive user", errorInfo.getCode(),
+					getUserResponse.getErrorCode());
+
+			List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
+			ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
+					getUserResponse.getResponse());
+
+			// checking if created resource is accessible
+			DbUtils.cleanAllAudits();
+
+			RestResponse getCatalogDataResponse = CatalogRestUtils.getCatalog(sdncAdminUser.getUserId());
+
+			// validate response
+
+			assertNotNull("check response object is not null after user login", getCatalogDataResponse);
+			assertNotNull("check error code exists in response after user login",
+					getCatalogDataResponse.getErrorCode());
+			assertEquals("Check response code after deActive user", 200,
+					getCatalogDataResponse.getErrorCode().intValue());
+
+			// expected resource list
+			List<String> resourceExpectedUniqIdList = new ArrayList<String>();
+			resourceExpectedUniqIdList.add(resourceDetails.getUniqueId());
+			logger.debug("resourceExpectedUniqIdList: {}", resourceExpectedUniqIdList);
+
+			compareResourceUniqIdList(getCatalogDataResponse.getResponse(), resourceExpectedUniqIdList, true);
+
+		} finally {
+			// resourceUtils.deleteResource_allVersions(resourceDetails,
+			// sdncAdminUser);
+			UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		}
+
+	}
+
+	public void compareServiceUniqIdList(String response, List<String> expectedList, boolean flag) {
+
+		JsonElement jelement = new JsonParser().parse(response);
+		JsonObject jobject = jelement.getAsJsonObject();
+		JsonArray serviceArray = (JsonArray) jobject.get("services");
+		logger.debug("{}", serviceArray);
+		assertTrue("expected service count: " + expectedList.size() + " or more" + ", actual: " + serviceArray.size(),
+				serviceArray.size() >= expectedList.size());
+
+		// build service list from response
+		List<ServiceReqDetails> serviceReqDetailsListOnResponse = new ArrayList<ServiceReqDetails>();
+		for (int i = 0; i < serviceArray.size(); i++) {
+			ServiceReqDetails json = gson.fromJson(serviceArray.get(i), ServiceReqDetails.class);
+			serviceReqDetailsListOnResponse.add(json);
+		}
+	}
+
+	public void compareResourceUniqIdList(String response, List<String> expectedList, boolean flag) {
+
+		JsonElement jelement = new JsonParser().parse(response);
+		JsonObject jobject = jelement.getAsJsonObject();
+		JsonArray resourceArray = (JsonArray) jobject.get("resources");
+		logger.debug("{}", resourceArray);
+		assertTrue("expected resource count: " + expectedList.size() + " or more" + ", actual: " + resourceArray.size(),
+				resourceArray.size() >= expectedList.size());
+
+		// build resource list from response
+		List<ResourceReqDetails> resourceReqDetailsListOnResponse = new ArrayList<ResourceReqDetails>();
+		for (int i = 0; i < resourceArray.size(); i++) {
+			ResourceReqDetails json = gson.fromJson(resourceArray.get(i), ResourceReqDetails.class);
+			resourceReqDetailsListOnResponse.add(json);
+		}
+
+		logger.debug("ResourceReqDetails list on response: {}", resourceReqDetailsListOnResponse);
+
+		List<String> resourceActualUniqIdList = new ArrayList<String>();
+		for (ResourceReqDetails resource : resourceReqDetailsListOnResponse) {
+			resourceActualUniqIdList.add(resource.getUniqueId());
+		}
+		logger.debug("resourceActualUniqIdList on response: {}", resourceActualUniqIdList);
+		logger.debug("resourceExpectedUniqIdList on response: {}", expectedList);
+
+		if (flag) {
+			assertTrue("actual list does not contain expected list",
+					resourceActualUniqIdList.containsAll(expectedList));
+		} else {
+			assertFalse("actual list contains non expected list elements",
+					resourceActualUniqIdList.containsAll(expectedList));
+		}
+	}
+
+	// public User getDefaultUserDetails(){
+	//
+	// String userFirstName = "Kot";
+	// String userLastName = "May";
+	// String role = UserRoleEnum.ADMIN.name();
+	// User sdncUserDetails = new User(userFirstName, userLastName,
+	// httpCspUserId, email, role,null);
+	//
+	// return sdncUserDetails;
+	// }
+	//
+	// public void validateSuccessCreateUserResponse(User sdncUserDetails,
+	// RestResponse createUserResponse) throws Exception{
+	//
+	// assertNotNull("check response object is not null after create user",
+	// createUserResponse);
+	// assertNotNull("check error code exists in response after create user",
+	// createUserResponse.getErrorCode());
+	// assertEquals("Check response code after create user",
+	// HttpStatus.SC_CREATED, createUserResponse.getErrorCode().intValue());
+	//
+	// UserRestUtils.validateUserDetailsOnResponse(sdncUserDetails,
+	// createUserResponse.getResponse());
+	// UserRestUtils.validateAddUserAuditMessage(sdncUserDetails, sdncAdminUser,
+	// String.valueOf(HttpStatus.SC_CREATED),
+	// UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+	// UserRestUtils.getAddUserAuditMessage("AddUser"));
+	// RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails,
+	// sdncAdminUser);
+	// UserRestUtils.validateUserDetailsOnResponse(sdncUserDetails,
+	// getUserResponse.getResponse());
+	//
+	// }
+	//
+	// public void validateSuccessDeActivateUserResponse(User sdncUserDetails,
+	// RestResponse deActivateUserResponse) throws Exception{
+	//
+	// assertNotNull("check response object is not null after deActive user",
+	// deActivateUserResponse);
+	// assertNotNull("check error code exists in response after deActive user",
+	// deActivateUserResponse.getErrorCode());
+	// assertEquals("Check response code after deActive user", 200,
+	// deActivateUserResponse.getErrorCode().intValue());
+	//
+	// UserRestUtils.validateUserDetailsOnResponse(sdncUserDetails,
+	// deActivateUserResponse.getResponse());
+	// UserRestUtils.validateDeleteUserAuditMessage(sdncUserDetails,
+	// sdncAdminUser, "200", UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+	// UserRestUtils.getAddUserAuditMessage("DeleteUser"));
+	//
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/CreateUserApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/CreateUserApiTest.java
new file mode 100644
index 0000000..2f979f3
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/CreateUserApiTest.java
@@ -0,0 +1,1693 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.user;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.IOException;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedUserCRUDAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.users.UserResponseMessageEnum;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.Convertor;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.UserValidationUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class CreateUserApiTest extends ComponentBaseTest {
+
+	protected User sdncAdminUser;
+	protected User sdncDesignerUser;
+	protected User sdncGovernorUser;
+	protected User sdncTesterUser;
+
+	public static final int STATUS_CODE_SUCCESS = 200;
+	public static final int STATUS_CODE_SUCSESS_CREATED = 201;
+	public static final int STATUS_CODE_SUCCESS_DELETE_GET = 200;
+	public static final int STATUS_CODE_INVALID_CONTENT = 400;
+	public static final int STATUS_CODE_MISSING_DATA = 400;
+	public static final int STATUS_CODE_MISSING_INFORMATION = 403;
+	public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
+	public static final int STATUS_CODE_NOT_FOUND = 404;
+	public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
+	public static final int USER_ALREADY_EXIST = 409;
+	public static final int INVALID_ROLE = 400;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public CreateUserApiTest() {
+		super(name, CreateUserApiTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void init() {
+		sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		sdncDesignerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncGovernorUser = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+		sdncTesterUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+
+	}
+
+	// Story : REST API to provision new user (POST) - US429379
+	// must parameters: UserId and Email
+
+	// **********************************************************201***************************************************
+	// create user with full parameter set(UserID, First Name, Last Name, Email,
+	// Role = "DESIGNER", Creator details)
+	// expected 201 Created
+	@Test
+	public void createUser() throws Exception {
+
+		// user initialization
+		String httpCspUserId = "km2000";
+		String userFirstName = "Kot";
+		String userLastName = "Matroskin";
+		String email = "km2000@intl.sdc.com";
+		String role = "ADMIN";
+		User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		String addUser = "AddUser";
+		UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		DbUtils.cleanAllAudits();
+		RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+
+		AssertJUnit.assertNotNull("check response object is not null after create user", createUserResponse);
+		AssertJUnit.assertNotNull("check error code exists in response after create user",
+				createUserResponse.getErrorCode());
+		AssertJUnit.assertEquals("Check response code after create user", 201,
+				createUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
+
+		ExpectedUserCRUDAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(addUser,
+				sdncAdminUser, ActionStatus.CREATED, sdncUserDetails, null);
+		AuditValidationUtils.validateAddUserAudit(constructFieldsForAuditValidation, addUser);
+		RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
+	}
+
+	protected static final String ADD_USER = "AddUser";
+
+	private User mechIdUser = new User();
+	private User emptyUser = new User();
+	private static final User adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+	@AfterMethod
+	public void setup() throws IOException {
+		UserRestUtils.deactivateUser(mechIdUser, adminUser);
+	}
+
+	// create default user(UserID, Email, Creator details)
+	// expected: role = DESIGNER, first and last name = null, 201 Created
+	@Test
+	public void createDefaultUser() throws Exception {
+		// user initialization
+		String httpCspUserId = "km2000";
+		String userFirstName = null;
+		String userLastName = null;
+		String email = null;
+		String role = null;
+		User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+
+		deleteUserAndAudit(sdncUserDetails);
+		RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
+		UserValidationUtils.validateAddUserAuditMessage(sdncUserDetails, sdncAdminUser, "201",
+				UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
+
+	}
+
+	// create user with one optional parameter first name (UserID, Email, First
+	// Name, Creator details)
+	// expected: role = DESIGNER, last name = null, 201 Created
+	@Test
+	public void createUserFirstName() throws Exception {
+		// user initialization
+		String httpCspUserId = "km2000";
+		String userFirstName = "Kot";
+		String userLastName = null;
+		String email = null;
+		String role = null;
+		User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+
+		deleteUserAndAudit(sdncUserDetails);
+		RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
+		UserValidationUtils.validateAddUserAuditMessage(sdncUserDetails, sdncAdminUser, "201",
+				UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
+	}
+
+	@Test
+	public void createDeleteOpsUser() throws Exception {
+
+		String httpCspUserId = "oo2000";
+		String userFirstName = "ops";
+		String userLastName = "opsLast";
+		String email = "ops@intl.sdc.com";
+		String role = "OPS";
+		User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+
+		deleteUserAndAudit(sdncUserDetails);
+		RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
+		UserValidationUtils.validateAddUserAuditMessage(sdncUserDetails, sdncAdminUser, "201",
+				UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
+
+		UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		RestResponse getDeletedUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		assertEquals("Check response code after delete user", 404, getDeletedUserResponse.getErrorCode().intValue());
+
+	}
+
+	@Test
+	public void createDeleteGOVERNORUser() throws Exception {
+
+		String httpCspUserId = "gg2000";
+		String userFirstName = "gov";
+		String userLastName = "govLast";
+		String email = "gov@intl.sdc.com";
+		String role = "GOVERNOR";
+		User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+
+		deleteUserAndAudit(sdncUserDetails);
+		RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
+		UserValidationUtils.validateAddUserAuditMessage(sdncUserDetails, sdncAdminUser, "201",
+				UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
+
+		UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		RestResponse getDeletedUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
+		assertEquals("Check response code after delete user", 404, getDeletedUserResponse.getErrorCode().intValue());
+
+	}
+
+	// Benny
+	// Admin Create OPS user
+	@Test
+	public void createOpsUser() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "aa1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		User expectedOpsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedOpsUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedOpsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedOpsUser, createUserResponse.getResponse());
+		deleteAndCheckUserResponse(expectedOpsUser, 200);
+
+	}
+
+	// Admin Create GOVERNOR user
+	@Test
+	public void createGovernorUser() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "aa1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		User expectedUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedUser, createUserResponse.getResponse());
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedUser, getUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(expectedUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from OPS to GOVERNOR
+	@Test
+	public void updateOpsUserRole() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ab1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "GOVERNOR";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(governerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(governerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Designer Create OPS user -409 Response Restricted operation
+	@Test
+	public void createOpsUserByDesigner() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "aa1122";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		User expectedOpsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedOpsUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedOpsUser, sdncDesignerUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 409, createUserResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create user", "Conflict", createUserResponse.getResponseMessage());
+	}
+
+	// Tester Create OPS user -409 Response Restricted operation
+	@Test
+	public void createOpsUserByTester() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "aa1122";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		User expectedOpsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedOpsUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedOpsUser, sdncTesterUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 409, createUserResponse.getErrorCode().intValue());
+		assertEquals("Check response code after create user", "Conflict", createUserResponse.getResponseMessage());
+	}
+
+	// Designer Try Update OPS user role to GOVERNOR - Response 409
+	@Test
+	public void updateOpsUserRolebyDesigner() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "bt751e";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "GOVERNOR";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// Admin create user with OPS role
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// Designer user try to update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncDesignerUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 409, updateUserRoleResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating user", "Conflict",
+				updateUserRoleResponse.getResponseMessage());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting  user", deleteOpsUser);
+		assertEquals("Check response code after deleting  user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Tester Try Update OPS user role to GOVERNOR - Response 409
+	@Test
+	public void updateOpsUserRolebyTester() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "bt751w";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "GOVERNOR";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// Admin create user with OPS role
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// Designer user try to update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncTesterUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 409, updateUserRoleResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating user", "Conflict",
+				updateUserRoleResponse.getResponseMessage());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from OPS to Designer
+	@Test
+	public void updateOpsUserRoleFromOpsToDesigner() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ab1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "DESIGNER";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User designerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(designerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(designerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from OPS to TESTER
+	@Test
+	public void updateOpsUserRoleFromOpsToTester() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ac1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "TESTER";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User testerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(testerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(testerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Tester try to Update user role from OPS to GOVERNOR - Response 409
+	// Conflict
+	@Test
+	public void updateOpsUserRoleByTester() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ad1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "GOVERNOR";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		// Create user by Admin
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR by Tester
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncTesterUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 409, updateUserRoleResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating user", "Conflict",
+				updateUserRoleResponse.getResponseMessage());
+
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Designer try to Update user role from OPS to GOVERNOR - Response 409
+	// Conflict
+	@Test
+	public void updateOpsUserRoleByDesigner() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ad1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		String updatedRole = "GOVERNOR";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		// User governerUser = new User(userFirstName,
+		// userLastName,httpCspUserId, email, updatedRole);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		// Create user by Admin
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR by Tester
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncDesignerUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 409, updateUserRoleResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating user", "Conflict",
+				updateUserRoleResponse.getResponseMessage());
+
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Create OPS user - user already exist
+	@Test
+	public void createOpsUserAlreadyExist() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "af1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "OPS";
+		User expectedOpsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedOpsUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedOpsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedOpsUser, createUserResponse.getResponse());
+		// Create user that already exists
+		RestResponse createUserAgainResponse = UserRestUtils.createUser(expectedOpsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserAgainResponse);
+		assertNotNull("check error code exists in response after create user", createUserAgainResponse.getErrorCode());
+		assertEquals("Check response code after create user", 409, createUserAgainResponse.getErrorCode().intValue());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(expectedOpsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting  user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from OPS to GOVERNOR - user already has GOVERNOR
+	// role
+	@Test
+	public void updateRoleToSameRole() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ag1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "GOVERNOR";
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		RestResponse createUserResponse = UserRestUtils.createUser(opsUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, createUserResponse.getResponse());
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from GOVERNOR to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				opsUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(governerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(governerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from Tester to GOVERNOR - 200 response
+
+	// Admin Update user role from Designer to GOVERNOR - 200 response
+	@Test
+	public void updateUserRoleDesignerToGovernor() throws Exception {
+		DbUtils.cleanAllAudits();
+		String httpCspUserId = "ah1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "DESIGNER";
+		String updatedRole = "GOVERNOR";
+		User designerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(designerUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(designerUser, createUserResponse.getResponse());
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from TESTER to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				designerUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+		// Update user role
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(governerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(governerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(designerUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update deactivated user role - response 404 (user not found)
+	@Test
+	public void updateRoleToDeactivatedUser() throws Exception {
+		DbUtils.cleanAllAudits();
+		String httpCspUserId = "aj1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "DESIGNER";
+		String updatedRole = "GOVERNOR";
+		User designerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User governerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(designerUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(designerUser, createUserResponse.getResponse());
+		deleteAndCheckUserResponse(designerUser, 200);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role - user deActivted
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				designerUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after create user", 404, updateUserRoleResponse.getErrorCode().intValue());
+	}
+
+	// Admin Update user role, user does not exist in DB - response 404 (user
+	// not found)
+	@Test
+	public void updateRoleForNonExistingUser() throws Exception {
+		DbUtils.cleanAllAudits();
+		String httpCspUserId = "aj1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "DESIGNER";
+		String updatedRole = "GOVERNOR";
+		User designerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		// User governerUser = new User(userFirstName,
+		// userLastName,httpCspUserId, email, updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role - user deActivted
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				designerUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 404, updateUserRoleResponse.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from GOVERNOR to TESTER
+	@Test
+	public void updateRoleFromGovernorToTester() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ak1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "TESTER";
+		User governorUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User testerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(governorUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(governorUser, createUserResponse.getResponse());
+
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				governorUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(testerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(testerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(governorUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from GOVERNOR to DESIGNER
+	@Test
+	public void updateRoleFromGovernorToDesigner() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ak1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "DESIGNER";
+		User governorUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User designerUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(governorUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(governorUser, createUserResponse.getResponse());
+
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				governorUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(designerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(designerUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(governorUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role from GOVERNOR to OPS
+	@Test
+	public void updateRoleFromGovernorToOps() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ak1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "OPS";
+		User governorUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User opsUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(governorUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(governorUser, createUserResponse.getResponse());
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				governorUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(opsUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(opsUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		deleteAndCheckUserResponse(governorUser, 200);
+
+	}
+
+	private void deleteAndCheckUserResponse(User userDetailes, int expectedResponseCode) throws IOException {
+		RestResponse deleteUser = UserRestUtils.deleteUser(sdncGovernorUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteUser);
+		assertEquals("Check response code after deleting user", expectedResponseCode,
+				deleteUser.getErrorCode().intValue());
+	}
+
+	// Admin Update user role from GOVERNOR to ADMIN
+	@Test
+	public void updateRoleFromGovernorToAdmin() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ak1000";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "ADMIN";
+		User governorUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User adminUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(governorUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(governorUser, createUserResponse.getResponse());
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				governorUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 200, updateUserRoleResponse.getErrorCode().intValue());
+
+		RestResponse getUpdatedRoleUserResponse = UserRestUtils.getUser(adminUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(adminUser, getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(governorUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role to non existing role - Response 400 Bad Request
+	@Test
+	public void updateRoleToNonExistingRole() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "al1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "VVVVVVV";
+		User governorUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User newUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(governorUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(governorUser, createUserResponse.getResponse());
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role from OPS to GOVERNOR
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				governorUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 400, updateUserRoleResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating user", "Bad Request",
+				updateUserRoleResponse.getResponseMessage());
+
+		// RestResponse getUpdatedRoleUserResponse =
+		// UserRestUtils.getUser(adminUser,sdncAdminUser);
+		// UserValidationUtils.validateUserDetailsOnResponse(adminUser,getUpdatedRoleUserResponse.getResponse());
+		// Delete OPS user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(governorUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// Admin Update user role to null - Response 400 Bad Request
+	@Test
+	public void updateRoleToNull() throws Exception {
+		DbUtils.cleanAllAudits();
+
+		String httpCspUserId = "ax1001";
+		String userFirstName = "Benny";
+		String userLastName = "Tal";
+		String email = "optBenny@intl.sdc.com";
+		String role = "GOVERNOR";
+		String updatedRole = "";
+		User governorUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		User newUser = new User(userFirstName, userLastName, httpCspUserId, email, updatedRole, null);
+		// UserRestUtils.deleteUser(opsUser, sdncAdminUser, true);
+		// UserRestUtils.deleteUser(UserUpdateRole, sdncAdminUser);
+		RestResponse createUserResponse = UserRestUtils.createUser(governorUser, sdncAdminUser);
+		assertNotNull("check response object is not null after create user", createUserResponse);
+		assertNotNull("check error code exists in response after create user", createUserResponse.getErrorCode());
+		assertEquals("Check response code after create user", 201, createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(governorUser, createUserResponse.getResponse());
+		// opsUser.setRole(updatedRole);
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// update user role
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				governorUser.getUserId());
+		assertNotNull("check response object is not null after updating user", updateUserRoleResponse);
+		assertNotNull("check error code exists in response after updating user", updateUserRoleResponse.getErrorCode());
+		assertEquals("Check response code after updating user", 400, updateUserRoleResponse.getErrorCode().intValue());
+		assertEquals("Check response code after updating user", "Bad Request",
+				updateUserRoleResponse.getResponseMessage());
+		// Delete user
+		RestResponse deleteOpsUser = UserRestUtils.deleteUser(governorUser, sdncAdminUser, true);
+		assertNotNull("check response object is not null after deleting user", deleteOpsUser);
+		assertEquals("Check response code after deleting user", 200, deleteOpsUser.getErrorCode().intValue());
+
+	}
+
+	// create user with one optional parameter last name (UserID, Email, Last
+	// Name, Creator details)
+	// expected: role = DESIGNER, first name = null, 201 Created
+	// @Test
+	// public void createUserLastName(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create user with one optional parameter role name (UserID, Email, Role
+	// = "TESTER", Creator details)
+	// // expected: first and last name = null, 201 Created
+	// @Test
+	// public void createUserRoleName(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create user with two optional parameters first name and role (UserID,
+	// Email, First Name, Role = "ADMIN", Creator details)
+	// // expected: last name = null, 201 Created
+	// @Test
+	// public void createUserFirstNameAndRole(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create user with two optional parameters first and last name(UserID,
+	// Email, First Name, Last name, Creator details)
+	// // expected: role = DESIGNER, 201 Created
+	// @Test
+	// public void createUserFirstAndLastName(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	//
+	//
+	//
+	// //
+	// **********************************************************Create*user*failed***************************************************
+	//
+	// //
+	// **********************************************************403***************************************************
+	// // create default user without creator details (UserID, Email)
+	// // expected: 403 Forbidden, error message:"Error : Missing information"
+	// @Test
+	// public void createDefaultUserNonCreatorDetails(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// // create user with part of creator details (UserID, Email, First name,
+	// Last Name, Role, Part of creator details)
+	// // expected: 403 Forbidden, error message:"Error : Missing information"
+	// @Test
+	// public void createUserPartOfCreatorDetails(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create user with full parameter set, non admin creator(UserID, First
+	// Name, Last Name, Email, Role, Creator details)
+	// // expected: 403 Forbidden, error message:
+	// "Error : Restricted operation"
+	// @Test
+	// public void createUserNonAdminCreator(){
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// //
+	// **********************************************************405***************************************************
+	//
+	// // create user with full parameter set by sending http PUT request
+	// (UserID, First Name, Last Name, Email, Role, Creator details)
+	// // expected: 405 not Allowed, error message:
+	// "Error : Method not allowed"
+	// @Test
+	// public void createUserPutRequest(){
+	// // send PUT create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// // create default user by sending http PUT request (UserID, Email,
+	// Creator details)
+	// // expected: 405 not Allowed, error message:
+	// "Error : Method not allowed"
+	// @Test
+	// public void createDefaultUserPutRequest(){
+	// // send PUT create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// // create user with full parameter set by sending http DELETE request
+	// (UserID, First Name, Last Name, Email, Role, Creator details)
+	// // expected: 405 not Allowed, error message:
+	// "Error : Method not allowed"
+	// @Test
+	// public void createUserDeleteRequest(){
+	// // send DELETE create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// // create default user by sending http DELETE request (UserID, Email,
+	// Creator details)
+	// // expected: 405 not Allowed, error message:
+	// "Error : Method not allowed"
+	// @Test
+	// public void createDefaultUserDeleteRequest(){
+	// // send DELETE create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// // create user with full parameter set by sending http GET request
+	// (UserID, First Name, Last Name, Email, Role, Creator details)
+	// // expected: 405 not Allowed, error message:
+	// "Error : Method not allowed"
+	// @Test
+	// public void createUserGetRequest(){
+	// // send GET create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// // create default user by sending http GET request (UserID, Email,
+	// Creator details)
+	// // expected: 405 not Allowed, error message:
+	// "Error : Method not allowed"
+	// @Test
+	// public void createDefaultUserGetRequest(){
+	// // send GET create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// //
+	// **********************************************************409***************************************************
+	//
+	// // create the same user twice with full parameter set(UserID, First Name,
+	// Last Name, Email, Role, Creator details)
+	// // expected 409 Conflict, error message:
+	// "Error : User with '%s' ID already exists", where: %s - USER_ID
+	// @Test
+	// public void createSameUserTwice(){
+	// // send POST create user request
+	// // validate data on response
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create user twice, first full details (UserID, First Name, Last Name,
+	// Email, Role, Creator details), second default user (UserID, Email, Role,
+	// Creator details)
+	// // expected 409 Conflict, error message:
+	// "Error : User with '%s' ID already exists", where: %s - USER_ID
+	// @Test
+	// public void createFullThanDefaultUserTwice(){
+	// // send POST create user request
+	//
+	// // validate data on response
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create user twice, first default user (UserID, Email, Role, Creator
+	// details), second full details (UserID, First Name, Last Name, Email,
+	// Role, Creator details)
+	// // expected 409 Conflict, error message:
+	// "Error : User with '%s' ID already exists", where: %s - USER_ID
+	// @Test
+	// public void createDefaulThanFullUserTwice(){
+	// // send POST create user request
+	//
+	// // validate data on response
+	// // send POST create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	//
+	// //
+	// **********************************************************400***************************************************
+	// // create default user with invalid email address format(UserID, Email,
+	// Creator details)
+	// // expected: 400, error message:
+	// "Error : Invalid Content . Invalid e-mail address '%s'", where %s -
+	// email address
+	// @Test
+	// public void createDefaultUserInvalidEmailAddressFormat(){
+	// // send GET create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// // create an user with invalid role type (UserID, Email,Role = "TESTER-1"
+	// ,Creator details)
+	// // expected: 400, error message:
+	// "Error : Invalid Content . Invalid role '%s'", where %s - role type
+	// @Test
+	// public void createUserInvalidRoleType(){
+	// // send GET create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+	// //
+	// **********************************************************500***************************************************
+	// // create default user when BE is down (UserID, Email, Creator details)
+	// // expected: 500, error message:
+	// "Error : Internal Server Error . Try later again."
+	// @Test
+	// public void createDefaultUserBeNoAccess(){
+	// // send GET create user request
+	// // validate data on response
+	// // check the audit message
+	// }
+	//
+
+	// Benny US570551
+
+	@Test
+	public void createProductManagerUser() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Man";
+		String email = "prodMan@intl.sdc.com";
+		String role = "PRODUCT_MANAGER";
+		User expectedProductManagerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		UserRestUtils.deleteUser(expectedProductManagerUser, sdncAdminUser, true);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, createUserResponse.getResponse());
+		// Audit validation
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductManagerUser, sdncAdminUser,
+				Integer.toString(STATUS_CODE_SUCSESS_CREATED), UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductManagerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, getUserResponse.getResponse());
+		// Delete ProductManager user
+		RestResponse deleteProductManagerUser = UserRestUtils.deleteUser(expectedProductManagerUser, sdncAdminUser,
+				true);
+		assertEquals("Check response code after deleting OPS user", STATUS_CODE_SUCCESS,
+				deleteProductManagerUser.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductStrategistUser() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodStr@intl.sdc.com";
+		String role = "PRODUCT_STRATEGIST";
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		UserRestUtils.deleteUser(expectedProductStrategistUser, sdncAdminUser, true);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductStrategistUser,
+				createUserResponse.getResponse());
+		// Audit validation
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, sdncAdminUser,
+				Integer.toString(STATUS_CODE_SUCSESS_CREATED), UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductStrategistUser, getUserResponse.getResponse());
+		// Delete ProductStrategist user
+		RestResponse deleteProductStrategistUser = UserRestUtils.deleteUser(expectedProductStrategistUser,
+				sdncAdminUser, true);
+		assertNotNull("Check response object is not null after deleting OPS user", deleteProductStrategistUser);
+		assertEquals("Check response code after deleting OPS user", 200,
+				deleteProductStrategistUser.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductStrategistUserByNonAdminUser() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodStr@intl.sdc.com";
+		String role = "PRODUCT_STRATEGIST";
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		UserRestUtils.deleteUser(expectedProductStrategistUser, sdncAdminUser, true);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, sdncDesignerUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_RESTRICTED_OPERATION,
+				createUserResponse.getErrorCode().intValue());
+		// Audit validation
+		expectedProductStrategistUser.setUserId("");
+		expectedProductStrategistUser.setFirstName(null);
+		expectedProductStrategistUser.setLastName(null);
+		expectedProductStrategistUser.setEmail("");
+		expectedProductStrategistUser.setRole("");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, sdncDesignerUser,
+				Integer.toString(STATUS_CODE_RESTRICTED_OPERATION), errorInfo.getAuditDesc(""),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// Try to get user - user is not created
+		expectedProductStrategistUser.setUserId("pm1000");
+		expectedProductStrategistUser.setFirstName("Prod");
+		expectedProductStrategistUser.setLastName("Strategist");
+		expectedProductStrategistUser.setEmail("prodStr@intl.sdc.com");
+		expectedProductStrategistUser.setRole("PRODUCT_STRATEGIST");
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, getUserResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductManagerUserByNonAdminUser() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Man";
+		String email = "prodStr@intl.sdc.com";
+		String role = "PRODUCT_MANAGER";
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		UserRestUtils.deleteUser(expectedProductStrategistUser, sdncAdminUser, true);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, sdncDesignerUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_RESTRICTED_OPERATION,
+				createUserResponse.getErrorCode().intValue());
+		// Audit validation
+		expectedProductStrategistUser.setUserId("");
+		expectedProductStrategistUser.setFirstName(null);
+		expectedProductStrategistUser.setLastName(null);
+		expectedProductStrategistUser.setEmail("");
+		expectedProductStrategistUser.setRole("");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, sdncDesignerUser,
+				Integer.toString(STATUS_CODE_RESTRICTED_OPERATION), errorInfo.getAuditDesc(""),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// Try to get user - user is not created
+		expectedProductStrategistUser.setUserId("pm1000");
+		expectedProductStrategistUser.setFirstName("Prod");
+		expectedProductStrategistUser.setLastName("Strategist");
+		expectedProductStrategistUser.setEmail("prodStr@intl.sdc.com");
+		expectedProductStrategistUser.setRole("PRODUCT_MANAGER");
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, getUserResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductStrategistUserByNonExistingUser() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodStr@intl.sdc.com";
+		String role = "PRODUCT_STRATEGIST";
+		User noSdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		noSdncUserDetails.setRole("blabla");
+		noSdncUserDetails.setUserId("bt750h");
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, noSdncUserDetails);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_NOT_FOUND,
+				createUserResponse.getErrorCode().intValue());
+		// Audit validation
+		expectedProductStrategistUser.setUserId("");
+		expectedProductStrategistUser.setFirstName(null);
+		expectedProductStrategistUser.setLastName(null);
+		expectedProductStrategistUser.setEmail("");
+		expectedProductStrategistUser.setRole("");
+		noSdncUserDetails.setFirstName("");
+		noSdncUserDetails.setLastName("");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_NOT_FOUND.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, noSdncUserDetails,
+				Integer.toString(STATUS_CODE_NOT_FOUND), errorInfo.getAuditDesc(noSdncUserDetails.getUserId()),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// Try to get user - user is not created
+		expectedProductStrategistUser.setUserId("pm1000");
+		expectedProductStrategistUser.setFirstName("Prod");
+		expectedProductStrategistUser.setLastName("Strategist");
+		expectedProductStrategistUser.setEmail("prodStr@intl.sdc.com");
+		expectedProductStrategistUser.setRole("PRODUCT_STRATEGIST");
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, getUserResponse.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductManagerUserByNonExistingUser() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Man";
+		String email = "prodStr@intl.sdc.com";
+		String role = "PRODUCT_MANAGER";
+		User noSdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		noSdncUserDetails.setRole("blabla");
+		noSdncUserDetails.setUserId("bt750h");
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, noSdncUserDetails);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_NOT_FOUND,
+				createUserResponse.getErrorCode().intValue());
+		// Audit validation
+		expectedProductStrategistUser.setUserId("");
+		expectedProductStrategistUser.setFirstName(null);
+		expectedProductStrategistUser.setLastName(null);
+		expectedProductStrategistUser.setEmail("");
+		expectedProductStrategistUser.setRole("");
+		noSdncUserDetails.setFirstName("");
+		noSdncUserDetails.setLastName("");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_NOT_FOUND.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, noSdncUserDetails,
+				Integer.toString(STATUS_CODE_NOT_FOUND), errorInfo.getAuditDesc(noSdncUserDetails.getUserId()),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// Try to get user - user is not created
+		expectedProductStrategistUser.setUserId("pm1000");
+		expectedProductStrategistUser.setFirstName("Prod");
+		expectedProductStrategistUser.setLastName("Strategist");
+		expectedProductStrategistUser.setEmail("prodStr@intl.sdc.com");
+		expectedProductStrategistUser.setRole("PRODUCT_MANAGER");
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code ", STATUS_CODE_NOT_FOUND, getUserResponse.getErrorCode().intValue());
+	}
+
+	@Test(enabled = false)
+	public void updateProjectManagerRole() throws Exception {
+		// Update user role from PRODUCT_STRATEGIST to PRODUCT_MANAGER
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Man";
+		String email = "prodMan@intl.sdc.com";
+		String role = "PRODUCT_MANAGER";
+		String updatedRole = "GOVERNOR";
+		User expectedProductManagerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedProductManagerUser);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, createUserResponse.getResponse());
+		// Update user role
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// Update user role from PRODUCT_STRATEGIST to PRODUCT_MANAGER
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				expectedProductManagerUser.getUserId());
+		assertEquals("Check response code after create user", STATUS_CODE_SUCCESS,
+				updateUserRoleResponse.getErrorCode().intValue());
+		expectedProductManagerUser.setRole(updatedRole);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser,
+				updateUserRoleResponse.getResponse());
+		// Audit validation
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductManagerUser, sdncAdminUser,
+				Integer.toString(STATUS_CODE_SUCCESS), UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("UpdateUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductManagerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, getUserResponse.getResponse());
+		// Delete ProductManager user
+		RestResponse deleteProductManagerUser = UserRestUtils.deleteUser(expectedProductManagerUser, sdncAdminUser,
+				true);
+		assertEquals("Check response code after deleting OPS user", STATUS_CODE_SUCCESS,
+				deleteProductManagerUser.getErrorCode().intValue());
+	}
+
+	@Test(enabled = false)
+	public void updateProductStrategistRole() throws Exception {
+		// Update user role from PRODUCT_STRATEGIST to PRODUCT_MANAGER
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodMan@intl.sdc.com";
+		String role = "PRODUCT_STRATEGIST";
+		String updatedRole = "TESTER";
+		User expectedProductManagerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedProductManagerUser);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, createUserResponse.getResponse());
+		// Update user role
+		User newRoleUser = new User();
+		newRoleUser.setRole(updatedRole);
+		// Update user role from PRODUCT_STRATEGIST to PRODUCT_MANAGER
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				expectedProductManagerUser.getUserId());
+		assertEquals("Check response code after create user", STATUS_CODE_SUCCESS,
+				updateUserRoleResponse.getErrorCode().intValue());
+		expectedProductManagerUser.setRole(updatedRole);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser,
+				updateUserRoleResponse.getResponse());
+		// Audit validation
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductManagerUser, sdncAdminUser,
+				Integer.toString(STATUS_CODE_SUCCESS), UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
+				UserValidationUtils.getAddUserAuditMessage("UpdateUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductManagerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, getUserResponse.getResponse());
+		// Delete ProductManager user
+		RestResponse deleteProductManagerUser = UserRestUtils.deleteUser(expectedProductManagerUser, sdncAdminUser,
+				true);
+		assertEquals("Check response code after deleting OPS user", STATUS_CODE_SUCCESS,
+				deleteProductManagerUser.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductManagerUserAlreadyExit() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Man";
+		String email = "prodMan@intl.sdc.com";
+		String role = "PRODUCT_MANAGER";
+		User expectedProductManagerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedProductManagerUser);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, createUserResponse.getResponse());
+		// create same user again
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse createUserAgainResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", USER_ALREADY_EXIST,
+				createUserAgainResponse.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_ALREADY_EXIST.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductManagerUser, sdncAdminUser,
+				Integer.toString(USER_ALREADY_EXIST), errorInfo.getAuditDesc(expectedProductManagerUser.getUserId()),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductManagerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, getUserResponse.getResponse());
+		// Delete ProductManager user
+		RestResponse deleteProductManagerUser = UserRestUtils.deleteUser(expectedProductManagerUser, sdncAdminUser,
+				true);
+		assertEquals("Check response code after deleting OPS user", STATUS_CODE_SUCCESS,
+				deleteProductManagerUser.getErrorCode().intValue());
+	}
+
+	@Test
+	public void createProductStrategistUserAlreadyExit() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodMan@intl.sdc.com";
+		String role = "PRODUCT_STRATEGIST";
+		User expectedProductManagerUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedProductManagerUser);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, createUserResponse.getResponse());
+		// create same user again
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse createUserAgainResponse = UserRestUtils.createUser(expectedProductManagerUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", USER_ALREADY_EXIST,
+				createUserAgainResponse.getErrorCode().intValue());
+		// Audit validation
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_ALREADY_EXIST.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductManagerUser, sdncAdminUser,
+				Integer.toString(USER_ALREADY_EXIST), errorInfo.getAuditDesc(expectedProductManagerUser.getUserId()),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductManagerUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductManagerUser, getUserResponse.getResponse());
+		// Delete ProductManager user
+		RestResponse deleteProductManagerUser = UserRestUtils.deleteUser(expectedProductManagerUser, sdncAdminUser,
+				true);
+		assertEquals("Check response code after deleting OPS user", STATUS_CODE_SUCCESS,
+				deleteProductManagerUser.getErrorCode().intValue());
+	}
+
+	@Test(enabled = false)
+	public void UpdateProductStrategistToNonExistingRole() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodMan@intl.sdc.com";
+		String role = "PRODUCT_STRATEGIST";
+		String nonExistingRole = "BLABLA";
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedProductStrategistUser);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", STATUS_CODE_SUCSESS_CREATED,
+				createUserResponse.getErrorCode().intValue());
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductStrategistUser,
+				createUserResponse.getResponse());
+		// Update user Role to non Existing role
+		User newRoleUser = new User();
+		newRoleUser.setRole(nonExistingRole);
+		DbUtils.deleteFromEsDbByPattern("_all");
+		RestResponse updateUserRoleResponse = UserRestUtils.updateUserRole(newRoleUser, sdncAdminUser,
+				expectedProductStrategistUser.getUserId());
+		assertEquals("Check response code after updating user role", INVALID_ROLE,
+				updateUserRoleResponse.getErrorCode().intValue());
+
+		// Audit validation
+		/*
+		 * expectedProductStrategistUser.setUserId("");
+		 * expectedProductStrategistUser.setFirstName(null);
+		 * expectedProductStrategistUser.setLastName(null);
+		 * expectedProductStrategistUser.setEmail("");
+		 * expectedProductStrategistUser.setRole("");
+		 */
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_ROLE.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, sdncAdminUser,
+				Integer.toString(INVALID_ROLE), errorInfo.getAuditDesc(nonExistingRole),
+				UserValidationUtils.getAddUserAuditMessage("UpdateUser"));
+		// get user and compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		UserValidationUtils.validateUserDetailsOnResponse(expectedProductStrategistUser, getUserResponse.getResponse());
+		// Delete ProductManager user
+		RestResponse deleteProductManagerUser = UserRestUtils.deleteUser(expectedProductStrategistUser, sdncAdminUser,
+				true);
+		assertEquals("Check response code after deleting OPS user", STATUS_CODE_SUCCESS,
+				deleteProductManagerUser.getErrorCode().intValue());
+	}
+
+	@Test(enabled = false)
+	public void createUserWithNonExistingRole() throws Exception {
+		String httpCspUserId = "pm1000";
+		String userFirstName = "Prod";
+		String userLastName = "Strategist";
+		String email = "prodMan@intl.sdc.com";
+		String role = "BLABLA";
+		User expectedProductStrategistUser = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
+		deleteUserAndAudit(expectedProductStrategistUser);
+		// create user
+		RestResponse createUserResponse = UserRestUtils.createUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check response code after create Product-Manager user", INVALID_ROLE,
+				createUserResponse.getErrorCode().intValue());
+
+		// Audit validation
+		/*
+		 * expectedProductStrategistUser.setUserId("");
+		 * expectedProductStrategistUser.setFirstName(null);
+		 * expectedProductStrategistUser.setLastName(null);
+		 * expectedProductStrategistUser.setEmail("");
+		 * expectedProductStrategistUser.setRole("");
+		 */
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_ROLE.name());
+		UserValidationUtils.validateAddUserAuditMessage(expectedProductStrategistUser, sdncAdminUser,
+				Integer.toString(INVALID_ROLE), errorInfo.getAuditDesc(role),
+				UserValidationUtils.getAddUserAuditMessage("AddUser"));
+		// get user - verify user is not createdand compare with expected
+		RestResponse getUserResponse = UserRestUtils.getUser(expectedProductStrategistUser, sdncAdminUser);
+		assertEquals("Check user not created", STATUS_CODE_NOT_FOUND, getUserResponse.getErrorCode().intValue());
+
+	}
+
+	private void deleteUserAndAudit(User sdncUserDetails) throws IOException {
+		UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
+		DbUtils.cleanAllAudits();
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java
new file mode 100644
index 0000000..5dd1abc
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/GovernorWorkspaceApiTest.java
@@ -0,0 +1,319 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.execute.user;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class GovernorWorkspaceApiTest extends ComponentBaseTest {
+
+	private static Logger logger = LoggerFactory.getLogger(GovernorWorkspaceApiTest.class.getName());
+	@Rule
+	public static TestName name = new TestName();
+
+	public GovernorWorkspaceApiTest() {
+		super(name, GovernorWorkspaceApiTest.class.getName());
+
+	}
+
+	protected final User admin1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	protected final User governor = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+	protected final User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	protected ResourceReqDetails resourceDetails1;
+	protected ComponentInstanceReqDetails componentInstanceReqDetails;
+	protected ArtifactReqDetails heatArtifactDetails;
+
+	protected final String serviceVersion = "0.1";
+	protected final String servicesString = "services";
+	protected final String userRemarks = "commentTest";
+
+	protected ServiceReqDetails serviceDetails11 = null;
+	protected ServiceReqDetails serviceDetails22 = null;
+	protected ServiceReqDetails serviceDetails33 = null;
+
+	@BeforeMethod
+	public void initBeforeTest() throws Exception {
+		DbUtils.deleteFromEsDbByPattern("_all");
+		Resource resourceObj = AtomicOperationUtils
+				.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetails1 = new ResourceReqDetails(resourceObj);
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		createThreeServices(sdncDesignerDetails1);
+	}
+
+	protected void createThreeServices(User user) throws Exception {
+
+		String checkinComment = "good checkin";
+		String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
+
+		RestResponse addInformationalArtifactToResource = ArtifactRestUtils.addInformationalArtifactToResource(
+				heatArtifactDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
+		RestResponse certifyResource = LifecycleRestUtils.certifyResource(resourceDetails1);
+		componentInstanceReqDetails = ElementFactory.getDefaultComponentInstance("defaultInstance", resourceDetails1);
+
+		serviceDetails11 = ElementFactory.getDefaultService();
+		serviceDetails22 = ElementFactory.getDefaultService();
+		serviceDetails33 = ElementFactory.getDefaultService();
+
+		serviceDetails11.setName(serviceDetails11.getName() + "1");
+		List<String> tags = serviceDetails11.getTags();
+		tags.add(serviceDetails11.getName());
+		serviceDetails11.setTags(tags);
+
+		serviceDetails22.setName(serviceDetails11.getName() + "2");
+		tags = serviceDetails22.getTags();
+		tags.add(serviceDetails22.getName());
+		serviceDetails22.setTags(tags);
+
+		serviceDetails33.setName(serviceDetails11.getName() + "3");
+		tags = serviceDetails33.getTags();
+		tags.add(serviceDetails33.getName());
+		serviceDetails33.setTags(tags);
+		
+		RestResponse createServiceResponse1 = createService(user, serviceDetails11);
+		RestResponse createServiceResponse2 = createService(user, serviceDetails22);
+		RestResponse createServiceResponse3 = createService(user, serviceDetails33);
+	}
+
+	protected RestResponse createService(User user, ServiceReqDetails serviceDetails) throws Exception, IOException {
+		RestResponse createServiceResponse1 = ServiceRestUtils.createService(serviceDetails, user);
+		assertNotNull("check response object is not null after creating service", createServiceResponse1);
+		assertNotNull("check if error code exists in response after creating service",
+				createServiceResponse1.getErrorCode());
+		assertEquals("Check response code after creating service", 201,
+				createServiceResponse1.getErrorCode().intValue());
+		Service convertServiceResponseToJavaObject = ResponseParser
+				.convertServiceResponseToJavaObject(createServiceResponse1.getResponse());
+		serviceDetails.setUniqueId(convertServiceResponseToJavaObject.getUniqueId());
+		logger.debug("Created service1 ={}", serviceDetails);
+		addResourceWithHeatArt(serviceDetails);
+		return createServiceResponse1;
+	}
+
+	protected void addResourceWithHeatArt(ServiceReqDetails serviceDetails) throws Exception {
+
+		RestResponse createResourceInstance = ComponentInstanceRestUtils.createComponentInstance(
+				componentInstanceReqDetails, sdncDesignerDetails1, serviceDetails.getUniqueId(),
+				ComponentTypeEnum.SERVICE);
+		// System.out.println("serviceUID --->" + serviceDetails.getUniqueId());
+		assertEquals("Check response code ", 201, createResourceInstance.getErrorCode().intValue());
+	}
+
+	protected void certifyAllServices() throws Exception {
+		LifecycleRestUtils.certifyService(serviceDetails11);
+		LifecycleRestUtils.certifyService(serviceDetails22);
+		LifecycleRestUtils.certifyService(serviceDetails33);
+	}
+
+	protected boolean isElementInArray(String elementId, JSONArray jsonArray) throws Exception {
+		for (int i = 0; i < jsonArray.size(); i++) {
+			JSONObject jobject = (JSONObject) jsonArray.get(i);
+
+			if (jobject.get("uniqueId").toString().equals(elementId)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	protected void approveDistributionStatusOfCertifiedService(ServiceReqDetails serviceDetails, User user)
+			throws Exception {
+		approveDistributionStatusOfService(serviceDetails, user, "1.0");
+	}
+
+	protected void approveDistributionStatusOfService(ServiceReqDetails serviceDetails, User user, String version)
+			throws Exception {
+		RestResponse res = LifecycleRestUtils.sendApproveDistribution(user, serviceDetails.getUniqueId(), userRemarks);
+		assertEquals(200, res.getErrorCode().intValue());
+		ServiceValidationUtils.validateDistrubtionStatusValue(res, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+	}
+
+	protected void rejectDistributionStatusOfService(ServiceReqDetails serviceDetails, User user) throws Exception {
+		rejectDistributionStatusOfService(serviceDetails, user, "1.0");
+	}
+
+	protected void rejectDistributionStatusOfService(ServiceReqDetails serviceDetails, User user, String version)
+			throws Exception {
+		RestResponse res = LifecycleRestUtils.rejectDistribution(serviceDetails, version, user, userRemarks);
+		assertEquals(200, res.getErrorCode().intValue());
+		ServiceValidationUtils.validateDistrubtionStatusValue(res, DistributionStatusEnum.DISTRIBUTION_REJECTED);
+	}
+
+	protected JSONArray getFollowedListAsJsonArray(User user) throws Exception {
+		RestResponse getGovernorFollowed = ServiceRestUtils.getFollowed(user);
+		assertNotNull(getGovernorFollowed);
+		assertNotNull(getGovernorFollowed.getErrorCode());
+		assertEquals(200, getGovernorFollowed.getErrorCode().intValue());
+
+		JSONArray listArrayFromRestResponse = ServiceRestUtils.getListArrayFromRestResponse(getGovernorFollowed);
+
+		return listArrayFromRestResponse;
+	}
+
+	protected void changeDistributionStatusOfAllService(boolean approved, User user) throws Exception {
+		if (approved) {
+			approveDistributionStatusOfCertifiedService(serviceDetails11, user);
+			approveDistributionStatusOfCertifiedService(serviceDetails22, user);
+			approveDistributionStatusOfCertifiedService(serviceDetails33, user);
+		} else {
+			rejectDistributionStatusOfService(serviceDetails11, user);
+			rejectDistributionStatusOfService(serviceDetails22, user);
+			rejectDistributionStatusOfService(serviceDetails33, user);
+		}
+
+	}
+
+	protected JSONArray checkFollowed(User user) throws Exception {
+		JSONArray getFollowedList = getFollowedListAsJsonArray(user);
+		assertFalse(getFollowedList.isEmpty());
+		assertTrue(isElementInArray(serviceDetails11.getUniqueId(), getFollowedList));
+		assertTrue(isElementInArray(serviceDetails22.getUniqueId(), getFollowedList));
+		assertTrue(isElementInArray(serviceDetails33.getUniqueId(), getFollowedList));
+
+		return getFollowedList;
+	}
+
+	// -------------------------------------T E S T
+	// S------------------------------------------------------//
+
+	@Test
+	public void governorList_AllCertifiedVersionsOfService() throws Exception {
+		certifyAllServices();
+		String serviceUniqueIdCertified1 = serviceDetails11.getUniqueId();
+		RestResponse res = LifecycleRestUtils.changeServiceState(serviceDetails11, sdncDesignerDetails1, "1.0",
+				LifeCycleStatesEnum.CHECKOUT);
+		assertEquals(200, res.getErrorCode().intValue());
+
+		JSONArray getFollowedList = getFollowedListAsJsonArray(governor);
+		assertFalse(getFollowedList.isEmpty());
+		assertFalse(isElementInArray(serviceDetails11.getUniqueId(), getFollowedList));
+		assertTrue(isElementInArray(serviceDetails22.getUniqueId(), getFollowedList));
+		assertTrue(isElementInArray(serviceDetails33.getUniqueId(), getFollowedList));
+		assertTrue(isElementInArray(serviceUniqueIdCertified1, getFollowedList));
+		assertEquals(3, getFollowedList.size());
+
+		// certifyService(serviceDetails11, "1.1");
+		LifecycleRestUtils.certifyService(serviceDetails11);
+
+		JSONArray governorFollowedList2 = checkFollowed(governor);
+		assertEquals(4, governorFollowedList2.size());
+		assertTrue(isElementInArray(serviceDetails11.getUniqueId(), governorFollowedList2));
+		assertTrue(isElementInArray(serviceUniqueIdCertified1, governorFollowedList2));
+
+	}
+
+	// -------------------------------------T E S T
+	// S------------------------------------------------------//
+
+	@Test
+	public void governorList_distributionNotApproved() throws Exception {
+		certifyAllServices();
+
+		JSONArray checkFollowed = checkFollowed(governor);
+		assertEquals(3, checkFollowed.size());
+	}
+
+	@Test
+	public void governorGetEmptyListTest_notCertifiedServices() throws Exception {
+		JSONArray governorFollowedList = getFollowedListAsJsonArray(governor);
+
+		assertTrue(governorFollowedList.isEmpty());
+	}
+
+	@Test
+	public void governorList_distributionApproved() throws Exception {
+		certifyAllServices();
+		boolean approved = true;
+		changeDistributionStatusOfAllService(approved, governor);
+
+		JSONArray checkFollowed = checkFollowed(governor);
+		assertEquals(3, checkFollowed.size());
+	}
+
+	@Test(enabled = false)
+	public void governorList_distributed() throws Exception {
+		certifyAllServices();
+
+		LifecycleRestUtils.changeDistributionStatus(serviceDetails11, "1.0", governor, userRemarks,
+				DistributionStatusEnum.DISTRIBUTED);
+		LifecycleRestUtils.changeDistributionStatus(serviceDetails22, "1.0", governor, userRemarks,
+				DistributionStatusEnum.DISTRIBUTED);
+		LifecycleRestUtils.changeDistributionStatus(serviceDetails33, "1.0", governor, userRemarks,
+				DistributionStatusEnum.DISTRIBUTED);
+
+		JSONArray governorFollowedList = getFollowedListAsJsonArray(governor);
+		assertFalse(governorFollowedList.isEmpty());
+		assertTrue(isElementInArray(serviceDetails11.getUniqueId(), governorFollowedList));
+		assertTrue(isElementInArray(serviceDetails22.getUniqueId(), governorFollowedList));
+		assertTrue(isElementInArray(serviceDetails33.getUniqueId(), governorFollowedList));
+	}
+
+	@Test
+	public void governorList_distributionRejected() throws Exception {
+		certifyAllServices();
+		boolean distributionRejected = false;
+		changeDistributionStatusOfAllService(distributionRejected, governor);
+
+		JSONArray checkFollowed = checkFollowed(governor);
+		assertEquals(3, checkFollowed.size());
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java
new file mode 100644
index 0000000..c80f6c6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java
@@ -0,0 +1,141 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.executeOnUGN.distributionClient;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ClientConfiguration {
+
+	private String asdcAddress;
+	private String user;
+	private String password;
+	private Integer pollingInterval;
+	private Integer pollingTimeout;
+	private List<String> relevantArtifactTypes;
+	private String consumerGroup;
+	private String environmentName;
+	private String consumerID;
+
+	public ClientConfiguration() {
+
+		super();
+
+		this.asdcAddress = "localhost:8443";
+		this.consumerID = "mso-123456";
+		this.consumerGroup = "mso-group";
+		this.environmentName = "PROD";
+		this.password = "password";
+		this.pollingInterval = 20;
+		this.pollingTimeout = 20;
+		this.relevantArtifactTypes = new ArrayList<String>();
+		this.relevantArtifactTypes.add("SHELL");
+		this.user = "mso-user";
+	}
+
+	public String getAsdcAddress() {
+		return asdcAddress;
+	}
+
+	public void setAsdcAddress(String asdcAddress) {
+		this.asdcAddress = asdcAddress;
+	}
+
+	public String getUser() {
+		return user;
+	}
+
+	public void setUser(String user) {
+		this.user = user;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public int getPollingInterval() {
+		return pollingInterval;
+	}
+
+	public void setPollingInterval(Integer pollingInterval) {
+		this.pollingInterval = pollingInterval;
+	}
+
+	public int getPollingTimeout() {
+		return pollingTimeout;
+	}
+
+	public void setPollingTimeout(Integer pollingTimeout) {
+		this.pollingTimeout = pollingTimeout;
+	}
+
+	public List<String> getRelevantArtifactTypes() {
+		return relevantArtifactTypes;
+	}
+
+	public void setRelevantArtifactTypes(List<String> relevantArtifactTypes) {
+		this.relevantArtifactTypes = relevantArtifactTypes;
+	}
+
+	public String getConsumerGroup() {
+		return consumerGroup;
+	}
+
+	public void setConsumerGroup(String consumerGroup) {
+		this.consumerGroup = consumerGroup;
+	}
+
+	public String getEnvironmentName() {
+		return environmentName;
+	}
+
+	public void setEnvironmentName(String environmentName) {
+		this.environmentName = environmentName;
+	}
+
+	public String getComsumerID() {
+		return consumerID;
+	}
+
+	public void setComsumerID(String comsumerID) {
+		this.consumerID = comsumerID;
+	}
+
+	public ClientConfiguration(String asdcAddress, String user, String password, Integer pollingInterval,
+			Integer pollingTimeout, List<String> relevantArtifactTypes, String consumerGroup, String environmentName,
+			String comsumerID) {
+		super();
+		this.asdcAddress = asdcAddress;
+		this.user = user;
+		this.password = password;
+		this.pollingInterval = pollingInterval;
+		this.pollingTimeout = pollingTimeout;
+		this.relevantArtifactTypes = relevantArtifactTypes;
+		this.consumerGroup = consumerGroup;
+		this.environmentName = environmentName;
+		this.consumerID = comsumerID;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java
new file mode 100644
index 0000000..14c7a37
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java
@@ -0,0 +1,177 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.preRequisites;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.annotations.BeforeMethod;
+
+public class ComplexResourceBaseTest extends ComponentBaseTest {
+
+	protected ServiceReqDetails serviceDetails;
+	protected ResourceReqDetails resourceDetailsVFC;
+	protected ResourceReqDetails resourceDetailsVL;
+	protected ResourceReqDetails resourceDetailsVF;
+	protected ResourceReqDetails resourceDetailsCP;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetailsVF;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetailsVFC;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetailsVL;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetailsCP;
+	protected User sdncDesignerDetails1;
+	protected User sdncTesterDeatails1;
+	protected User sdncAdminDetails1;
+	protected ArtifactReqDetails heatArtifactDetails;
+
+	protected ArtifactReqDetails defaultArtifactDetails;
+	protected int maxLength = 50;
+	protected Resource resourceVF = null;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public ComplexResourceBaseTest() {
+		super(name, ComplexResourceBaseTest.class.getName());
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+
+		initializeMembers();
+
+		createComponents();
+
+	}
+
+	public void initializeMembers() throws IOException, Exception {
+
+		serviceDetails = ElementFactory.getDefaultService();
+		resourceDetailsVFC = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VFC, "resourceVFC");
+		resourceDetailsVF = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, "resourceVF3");
+		resourceDetailsVL = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VL, "resourceVL");
+		resourceDetailsCP = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CP, "resourceCP");
+		sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+
+	}
+
+	protected void createComponents() throws Exception {
+
+		RestResponse response = ServiceRestUtils.createService(serviceDetails, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
+
+		response = ResourceRestUtils.createResource(resourceDetailsVFC, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetailsVFC.getUniqueId());
+		response = LifecycleRestUtils.changeResourceState(resourceDetailsVFC, sdncDesignerDetails1,
+				resourceDetailsVFC.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LS state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		response = ResourceRestUtils.createResource(resourceDetailsVF, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetailsVF.getUniqueId());
+
+		response = ResourceRestUtils.createResource(resourceDetailsCP, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetailsCP.getUniqueId());
+		response = LifecycleRestUtils.changeResourceState(resourceDetailsCP, sdncDesignerDetails1,
+				resourceDetailsCP.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LS state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		response = ResourceRestUtils.createResource(resourceDetailsVL, sdncDesignerDetails1);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+		assertNotNull("resource uniqueId is null:", resourceDetailsVL.getUniqueId());
+		response = LifecycleRestUtils.changeResourceState(resourceDetailsVL, sdncDesignerDetails1,
+				resourceDetailsVL.getVersion(), LifeCycleStatesEnum.CHECKIN);
+		assertTrue("change LS state to CHECKIN, returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		resourceInstanceReqDetailsVFC = ElementFactory.getDefaultComponentInstance("VFC", resourceDetailsVFC);
+		resourceInstanceReqDetailsVF = ElementFactory.getDefaultComponentInstance("VF", resourceDetailsVF);
+		resourceInstanceReqDetailsVL = ElementFactory.getDefaultComponentInstance("VL", resourceDetailsVL);
+		resourceInstanceReqDetailsCP = ElementFactory.getDefaultComponentInstance("CP", resourceDetailsCP);
+
+	}
+
+	protected void createVFWithCertifiedResourceInstance(ResourceReqDetails resourceDetails,
+			ComponentInstanceReqDetails resourceInstanceReqDetails) throws Exception {
+
+		RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails1,
+				resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
+		assertEquals("Check response code after CHECKOUT", 200, response.getErrorCode().intValue());
+
+		// add heat artifact to resource and certify
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1,
+				resourceDetails.getUniqueId());
+		assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		response = LCSbaseTest.certifyResource(resourceDetails, sdncDesignerDetails1);
+		assertEquals("Check response code after CERTIFY request", 200, response.getErrorCode().intValue());
+
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+
+		resourceInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncDesignerDetails1,
+				resourceVF);
+		assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
+
+		resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
+	}
+
+	protected Resource convertResourceGetResponseToJavaObject(ResourceReqDetails resourceDetails) throws IOException {
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails1);
+		assertEquals("Check response code after get resource", 200, response.getErrorCode().intValue());
+		return ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
new file mode 100644
index 0000000..bde6852
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.preRequisites;
+
+import java.io.IOException;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
+import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+
+public class DownloadArtifactBaseTest extends ComponentBaseTest {
+
+	protected ResourceReqDetails downloadResourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails;
+	protected User sdncUserDetails;
+	protected User sdncDesignerDetails1;
+	protected ArtifactReqDetails heatArtifactDetails;
+
+	protected ArtifactReqDetails defaultArtifactDetails;
+	protected ResourceUtils resourceUtils;
+	protected ArtifactUtils artifactUtils;
+	protected Service service;
+
+	public DownloadArtifactBaseTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+
+		initializeMembers();
+		createComponents();
+
+	}
+
+	public void initializeMembers() throws IOException, Exception {
+		downloadResourceDetails = ElementFactory.getDefaultResource();
+		serviceDetails = ElementFactory.getDefaultService();
+		sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
+
+	}
+
+	protected void createComponents() throws Exception {
+
+		RestResponse response = ResourceRestUtils.createResource(downloadResourceDetails, sdncUserDetails);
+		AssertJUnit.assertTrue("create request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 201);
+		AssertJUnit.assertNotNull("resource uniqueId is null:", downloadResourceDetails.getUniqueId());
+
+		ArtifactReqDetails heatArtifactDetails = ElementFactory
+				.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncUserDetails,
+				downloadResourceDetails.getUniqueId());
+		AssertJUnit.assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		// certified resource
+		response = LCSbaseTest.certifyResource(downloadResourceDetails, sdncDesignerDetails1);
+		AssertJUnit.assertTrue("certify resource request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 200);
+
+		response = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
+		AssertJUnit.assertTrue("create request returned status:" + response.getErrorCode(),
+				response.getErrorCode() == 201);
+		AssertJUnit.assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
+
+		// add resource instance with HEAT deployment artifact to the service
+		resourceInstanceReqDetails.setComponentUid(downloadResourceDetails.getUniqueId());
+		response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncUserDetails,
+				serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		AssertJUnit.assertTrue("response code is not 201, returned: " + response.getErrorCode(),
+				response.getErrorCode() == 201);
+
+		response = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
+		AssertJUnit.assertTrue("response code is not 200, returned: " + response.getErrorCode(),
+				response.getErrorCode() == 200);
+		service = ResponseParser.convertServiceResponseToJavaObject(response.getResponse());
+
+		DbUtils.cleanAllAudits();
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
new file mode 100644
index 0000000..add06a5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
@@ -0,0 +1,96 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.preRequisites;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.log4j.lf5.util.ResourceUtils;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.annotations.BeforeMethod;
+
+public abstract class SimpleOneRsrcOneServiceTest extends ComponentBaseTest {
+
+	protected ResourceReqDetails resourceDetails;
+	protected ServiceReqDetails serviceDetails;
+	protected ComponentInstanceReqDetails resourceInstanceReqDetails;
+	protected ArtifactReqDetails heatArtifactDetails1;
+
+	private static final String heatExtension = "yaml";
+	private static final String yangXmlExtension = "xml";
+	private static final String muranoPkgExtension = "zip";
+	private static final String extension = null;
+	private final String folderName = "heatEnv";
+
+	protected User sdncDesignerDetails;
+	protected ArtifactReqDetails defaultArtifactDetails;
+	protected ResourceUtils resourceUtils;
+	protected ArtifactUtils artifactUtils;
+	protected Utils utils;
+
+	private static RestResponse createServiceResponse;
+
+	public SimpleOneRsrcOneServiceTest(TestName testName, String className) {
+		super(testName, className);
+	}
+
+	@BeforeMethod
+	public void before() throws Exception {
+
+		initializeMembers();
+		createComponents();
+
+	}
+
+	public void initializeMembers() throws IOException, Exception {
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		resourceDetails = ElementFactory.getDefaultResource();
+		serviceDetails = ElementFactory.getDefaultService();
+		heatArtifactDetails1 = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
+		resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance("resourceInstanceReqDetails");
+	}
+
+	protected void createComponents() throws Exception {
+
+		RestResponse response = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+
+		response = ServiceRestUtils.createService(serviceDetails, sdncDesignerDetails);
+		assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java
new file mode 100644
index 0000000..bb2d2d5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.rules;
+
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.openecomp.sdc.ci.tests.api.AttSdcTest;
+
+public class MyTestWatcher extends TestWatcher {
+
+	AttSdcTest odlTest;
+
+	public MyTestWatcher(AttSdcTest odlTest) {
+		this.odlTest = odlTest;
+	}
+
+	/**
+	 * Invoked when a test succeeds
+	 * 
+	 * @param description
+	 */
+	@Override
+	protected void succeeded(Description description) {
+		String testName = description.getMethodName();
+		odlTest.addTestSummary(testName, true);
+
+	}
+
+	/**
+	 * Invoked when a test fails
+	 * 
+	 * @param e
+	 * @param description
+	 */
+	@Override
+	protected void failed(Throwable e, Description description) {
+		String testName = description.getMethodName();
+		odlTest.addTestSummary(testName, false, e);
+	}
+
+	/**
+	 * Invoked when a test is about to start
+	 * 
+	 * @param description
+	 */
+	@Override
+	protected void starting(Description description) {
+		// System.out.println("protected void starting(Description description)
+		// {");
+		this.odlTest.getLogger().debug("Start running test {}", description.getMethodName());
+	}
+
+	/**
+	 * Invoked when a test method finishes (whether passing or failing)
+	 * 
+	 * @param description
+	 */
+	@Override
+	protected void finished(Description description) {
+		// System.out.println("protected void finished(Description description)
+		// {");
+		this.odlTest.getLogger().debug("Finish running test {}", description.getMethodName());
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
new file mode 100644
index 0000000..9bb14d7
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
@@ -0,0 +1,279 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.run;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+//import org.junit.runner.JUnitCore;
+//import org.junit.runner.Result;
+//import org.junit.runner.notification.Failure;
+import org.testng.TestListenerAdapter;
+import org.testng.TestNG;
+import org.testng.reporters.TestHTMLReporter;
+import org.testng.xml.XmlSuite;
+
+public class StartTest {
+
+	// private List<Class<? extends AttSdcTest>> testClasses = new
+	// ArrayList<Class<? extends AttSdcTest>>();
+	public static long timeOfTest = 0;
+
+	public static boolean debug = false;
+
+	public static AtomicBoolean loggerInitialized = new AtomicBoolean(false);
+
+	protected static Logger logger = null;
+
+	public static void main(String[] args) {
+
+		String debugEnabled = System.getProperty("debug");
+		if (debugEnabled != null && debugEnabled.equalsIgnoreCase("true")) {
+			debug = true;
+		}
+		System.out.println("Debug mode is " + (debug ? "enabled" : "disabled"));
+
+		enableLogger();
+
+		Config config = null;
+		try {
+			config = Utils.getConfig();
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		if (config == null) {
+			logger.error("Failed to configuration file of ci tests.");
+			System.exit(1);
+		}
+
+		TestNG testng = new TestNG();
+
+		List<String> suites = new ArrayList<String>();
+		suites.add("testSuites/" + args[0]);
+		testng.setTestSuites(suites);
+		testng.setUseDefaultListeners(true);
+		testng.setOutputDirectory("target/");
+
+		testng.run();
+
+	}
+
+	public StartTest() {
+		logger = Logger.getLogger(StartTest.class.getName());
+	}
+
+	public static void enableLogger() {
+
+		if (false == loggerInitialized.get()) {
+
+			loggerInitialized.set(true);
+
+			String log4jPropsFile = System.getProperty("log4j.configuration");
+			if (System.getProperty("os.name").contains("Windows")) {
+				String logProps = "src/main/resources/ci/conf/log4j.properties";
+				if (log4jPropsFile == null) {
+					System.setProperty("targetlog", "target/");
+					log4jPropsFile = logProps;
+				}
+
+			}
+			PropertyConfigurator.configureAndWatch(log4jPropsFile);
+
+		}
+	}
+
+	private List<Class> getClassesForPackage(String pkgname) {
+
+		List<Class> classes = new ArrayList<Class>();
+
+		// Get a File object for the package
+		File directory = null;
+		String fullPath;
+		String relPath = pkgname.replace('.', '/');
+
+		// System.out.println("ClassDiscovery: Package: " + pkgname +
+		// " becomes Path:" + relPath);
+
+		URL resource = ClassLoader.getSystemClassLoader().getResource(relPath);
+
+		// System.out.println("ClassDiscovery: Resource = " + resource);
+		if (resource == null) {
+			throw new RuntimeException("No resource for " + relPath);
+		}
+		fullPath = resource.getFile();
+		// System.out.println("ClassDiscovery: FullPath = " + resource);
+
+		if (debug) {
+			System.out.println("fullPath is " + fullPath);
+		}
+
+		try {
+			directory = new File(resource.toURI());
+		} catch (URISyntaxException e) {
+			throw new RuntimeException(
+					pkgname + " (" + resource
+							+ ") does not appear to be a valid URL / URI.  Strange, since we got it from the system...",
+					e);
+		} catch (IllegalArgumentException e) {
+			directory = null;
+		}
+		// System.out.println("ClassDiscovery: Directory = " + directory);
+
+		if (directory != null && directory.exists()) {
+
+			// Get the list of the files contained in the package
+			String[] files = directory.list();
+			for (int i = 0; i < files.length; i++) {
+
+				// we are only interested in .class files
+				if (files[i].endsWith(".class") && false == files[i].contains("$")) {
+
+					// removes the .class extension
+					String className = pkgname + '.' + files[i].substring(0, files[i].length() - 6);
+
+					// System.out.println("ClassDiscovery: className = " +
+					// className);
+
+					if (debug) {
+						System.out.println("ClassDiscovery: className = " + className);
+					}
+
+					try {
+						Class clas = Class.forName(className);
+						boolean isAddToRun = false;
+						Method[] methods = clas.getMethods();
+						for (Method method : methods) {
+							Annotation[] anns = method.getAnnotations();
+							for (Annotation an : anns) {
+								if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
+									isAddToRun = true;
+									break;
+								}
+							}
+						}
+						if (isAddToRun)
+							classes.add(clas);
+					} catch (ClassNotFoundException e) {
+						throw new RuntimeException("ClassNotFoundException loading " + className);
+					}
+				}
+			}
+		} else {
+			try {
+				String jarPath = fullPath.replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");
+
+				if (debug) {
+					System.out.println("jarPath is " + jarPath);
+				}
+
+				JarFile jarFile = new JarFile(jarPath);
+				Enumeration<JarEntry> entries = jarFile.entries();
+				while (entries.hasMoreElements()) {
+					JarEntry entry = entries.nextElement();
+					String entryName = entry.getName();
+					if (entryName.startsWith(relPath) && entryName.length() > (relPath.length() + "/".length())) {
+
+						// System.out.println("ClassDiscovery: JarEntry: " +
+						// entryName);
+						String className = entryName.replace('/', '.').replace('\\', '.').replace(".class", "");
+
+						// System.out.println("ClassDiscovery: className = " +
+						// className);
+
+						if (false == className.contains("$")) {
+
+							if (debug) {
+								System.out.println("ClassDiscovery: className = " + className);
+							}
+
+							try {
+								Class clas = Class.forName(className);
+								boolean isAddToRun = false;
+								Method[] methods = clas.getMethods();
+								for (Method method : methods) {
+									Annotation[] anns = method.getAnnotations();
+									for (Annotation an : anns) {
+										if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
+											isAddToRun = true;
+											break;
+										}
+									}
+								}
+								if (isAddToRun)
+									classes.add(clas);
+							} catch (ClassNotFoundException e) {
+								throw new RuntimeException("ClassNotFoundException loading " + className);
+							}
+						}
+					}
+				}
+				jarFile.close();
+
+			} catch (IOException e) {
+				throw new RuntimeException(pkgname + " (" + directory + ") does not appear to be a valid package", e);
+			}
+		}
+		return classes;
+	}
+
+	private void addTableHead(StringBuilder results) {
+		results.append("<tr>");
+		results.append("<th>").append("Unit Test").append("</th>");
+		results.append("<th>").append("Result").append("</th>");
+		results.append("</tr>");
+	}
+
+	// private void addUnitTestResult(StringBuilder results,
+	// Class<? extends AttSdcTest> testClass, Result unitTestResult) {
+	//
+	// boolean isSuccess = unitTestResult.wasSuccessful();
+	//
+	// String result = (isSuccess) ? "success" : "fail";
+	// String fileName = FileUtils.getFileName(testClass.getName());
+	// results.append("<tr>");
+	// //
+	// results.append("<td>").append(FileUtils.getFileName(testClass.getName())).append("</td>");
+	// results.append("<td class=\"name\">")
+	// .append("<a href=\"" + fileName + timeOfTest + ".html\">"
+	// + fileName + "</a>").append("</td>");
+	// results.append("<td class=\"" + result + "\">").append(result)
+	// .append("</td>");
+	// results.append("</tr>");
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
new file mode 100644
index 0000000..d5b06b3
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
@@ -0,0 +1,408 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.run;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.apache.log4j.PropertyConfigurator;
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
+import org.openecomp.sdc.ci.tests.api.AttSdcTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StartTest2backup {
+
+	private List<Class<? extends AttSdcTest>> testClasses = new ArrayList<Class<? extends AttSdcTest>>();
+	public static long timeOfTest = 0;
+
+	public static boolean debug = false;
+
+	public static AtomicBoolean loggerInitialized = new AtomicBoolean(false);
+
+	protected static Logger logger = null;
+
+	public static void main(String[] args) {
+
+		String debugEnabled = System.getProperty("debug");
+		if (debugEnabled != null && debugEnabled.equalsIgnoreCase("true")) {
+			debug = true;
+		}
+		System.out.println("Debug mode is " + (debug ? "enabled" : "disabled"));
+
+		enableLogger();
+
+		Config config = null;
+		try {
+			config = Utils.getConfig();
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		if (config == null) {
+			logger.error("Failed to configuration file of ci tests.");
+			System.exit(1);
+		}
+
+		List<String> packagesToRun = config.getPackages();
+		if (packagesToRun == null || true == packagesToRun.isEmpty()) {
+			logger.error("No package was configured to be executed.");
+			System.exit(2);
+		}
+		StartTest2backup tests = new StartTest2backup();
+
+		boolean stopOnClassFailure = false;
+		String stopOnClassFailureStr = System.getProperty("stopOnClassFailure");
+		if (stopOnClassFailureStr != null && stopOnClassFailureStr.equalsIgnoreCase("true")) {
+			stopOnClassFailure = true;
+		} else {
+			Boolean stopOnClassFailureObj = config.isStopOnClassFailure();
+			if (stopOnClassFailureObj != null) {
+				stopOnClassFailure = stopOnClassFailureObj.booleanValue();
+			}
+		}
+
+		tests.start(packagesToRun, stopOnClassFailure);
+	}
+
+	public StartTest2backup() {
+		logger = LoggerFactory.getLogger(StartTest2backup.class.getName());
+	}
+
+	public static void enableLogger() {
+
+		if (false == loggerInitialized.get()) {
+
+			loggerInitialized.set(true);
+
+			String log4jPropsFile = System.getProperty("log4j.configuration");
+			if (System.getProperty("os.name").contains("Windows")) {
+				String logProps = "src/main/resources/ci/conf/log4j.properties";
+				if (log4jPropsFile == null) {
+					System.setProperty("targetlog", "target/");
+					log4jPropsFile = logProps;
+				}
+
+			}
+			PropertyConfigurator.configureAndWatch(log4jPropsFile);
+
+		}
+	}
+
+	public void start(List<String> packages, boolean exitOnFailure) {
+
+		boolean success = true;
+		StringBuilder results = new StringBuilder();
+		Result result;
+
+		if (packages == null) {
+			return;
+		}
+
+		for (String packageName : packages) {
+			// List<Class> classesForPackage =
+			// getClassesForPackage("org.openecomp.sdc.ci.tests.execute");
+			List<Class> classesForPackage = getClassesForPackage(packageName);
+			if (classesForPackage != null && false == classesForPackage.isEmpty()) {
+				for (Class testUnit : classesForPackage) {
+					testClasses.add(testUnit);
+				}
+			}
+		}
+
+		System.out.println(testClasses);
+
+		// tsetClasses.add(LogValidatorTest.class);
+		// tsetClasses.add(AttNorthboundTest.class);
+
+		results.append(
+				"<Html><head><style>th{background-color: gray;color: white;height: 30px;}td {color: black;height: 30px;}.fail {background-color: #FF5555;width: 100px;text-align: center;}.success {background-color: #00FF00;width: 100px;text-align: center;}.name {width: 200px;background-color: #F0F0F0;}.message {width: 300px;background-color: #F0F0F0;}</style></head><body>");
+
+		Calendar calendar = Calendar.getInstance();
+		timeOfTest = calendar.getTimeInMillis();
+		SimpleDateFormat date_format = new SimpleDateFormat("MMM dd yyyy HH:mm:ss");
+		results.append("<br/><h2> This report generated on " + date_format.format(calendar.getTime()) + "</h2><br/>");
+
+		results.append("<table>");
+		addTableHead(results);
+
+		int size = testClasses.size();
+		int index = 0;
+
+		int totalRunTests = 0;
+		int totalFailureTests = 0;
+		int totalIgnoreTests = 0;
+		int numOfFailureClasses = 0;
+		for (Class<? extends AttSdcTest> testClass : testClasses) {
+
+			index++;
+
+			StringBuilder builder = new StringBuilder();
+			String str = "***************************************************************************";
+			builder.append(str + "\n");
+			String current = "class " + index + "/" + size + " failure(" + numOfFailureClasses + ") + RUNS("
+					+ totalRunTests + ")" + " FAILURES(" + totalFailureTests + ") IGNORED(" + totalIgnoreTests + ")";
+			int interval = ((str.length() - current.length() - 2) / 2);
+			String substring = str.substring(0, interval);
+			builder.append(substring + " " + current + " " + substring + "\n");
+			builder.append(str + "\n");
+
+			System.out.println(builder.toString());
+
+			logger.debug(builder.toString());
+			logger.debug("Going to run test class {}", testClass.getName());
+
+			result = JUnitCore.runClasses(testClass);
+			if (result.wasSuccessful() == false) {
+				numOfFailureClasses++;
+			}
+			logger.debug("Test class {} finished {}",testClass.getName(),(result.wasSuccessful() ? "OK." : " WITH ERROR."));
+			List<Failure> failures = result.getFailures();
+			if (failures != null) {
+				for (Failure failure : failures) {
+					logger.error("Test class {} failure test {}-{}",testClass.getName(),failure.getTestHeader(),failure.getTrace());
+				}
+			}
+			int runsPerClass = result.getRunCount();
+			int failuresPerClass = result.getFailureCount();
+			int ignoredPerClass = result.getIgnoreCount();
+
+			totalRunTests += runsPerClass;
+			totalFailureTests += failuresPerClass;
+			totalIgnoreTests += ignoredPerClass;
+
+			logger.debug("class {} Failed tests {} %",testClass.getName(),(failuresPerClass * 1.0) / runsPerClass * 100);
+			logger.debug("class {} Ignored tests {} %",testClass.getName(),(ignoredPerClass * 1.0) / runsPerClass * 100);
+
+			// List<Failure> failures = result.getFailures();
+			// if (failures != null) {
+			// for (Failure failure : failures) {
+			// System.err.println("9999999999" + failure.getTestHeader());
+			// }
+			// }
+
+			addUnitTestResult(results, testClass, result);
+			success &= result.wasSuccessful();
+
+			if (numOfFailureClasses > 0) {
+				// if (exitOnFailure) {
+				if (exitOnFailure) {
+					break;
+				}
+			}
+		}
+
+		results.append("</table>");
+		results.append("<br/><h2> Tests Summary: </h2><br/>");
+		results.append("Total Runs  : " + totalRunTests + "<br/>");
+		results.append("Total Failure  : " + totalFailureTests + "<br/>");
+		results.append("Total: " + totalFailureTests + "/" + totalRunTests + "<br/>");
+		results.append("</html>");
+
+		FileUtils.writeToFile(Config.instance().getOutputFolder() + File.separator + Config.instance().getReportName(),
+				results.toString());
+
+		if (!success) {
+			System.out.println("FAILURE");
+			logger.error("Failure tests : {} %",((totalFailureTests + totalIgnoreTests) * 1.0) / (totalRunTests + totalIgnoreTests));
+			logger.error("Ignored tests : {} %",(totalIgnoreTests * 1.0) / (totalRunTests + totalIgnoreTests));
+			System.exit(1);
+		}
+
+		System.out.println("SUCCESS");
+	}
+
+	private List<Class> getClassesForPackage(String pkgname) {
+
+		List<Class> classes = new ArrayList<Class>();
+
+		// Get a File object for the package
+		File directory = null;
+		String fullPath;
+		String relPath = pkgname.replace('.', '/');
+
+		// System.out.println("ClassDiscovery: Package: " + pkgname +
+		// " becomes Path:" + relPath);
+
+		URL resource = ClassLoader.getSystemClassLoader().getResource(relPath);
+
+		// System.out.println("ClassDiscovery: Resource = " + resource);
+		if (resource == null) {
+			throw new RuntimeException("No resource for " + relPath);
+		}
+		fullPath = resource.getFile();
+		// System.out.println("ClassDiscovery: FullPath = " + resource);
+
+		if (debug) {
+			System.out.println("fullPath is " + fullPath);
+		}
+
+		try {
+			directory = new File(resource.toURI());
+		} catch (URISyntaxException e) {
+			throw new RuntimeException(
+					pkgname + " (" + resource
+							+ ") does not appear to be a valid URL / URI.  Strange, since we got it from the system...",
+					e);
+		} catch (IllegalArgumentException e) {
+			directory = null;
+		}
+		// System.out.println("ClassDiscovery: Directory = " + directory);
+
+		if (directory != null && directory.exists()) {
+
+			// Get the list of the files contained in the package
+			String[] files = directory.list();
+			for (int i = 0; i < files.length; i++) {
+
+				// we are only interested in .class files
+				if (files[i].endsWith(".class") && false == files[i].contains("$")) {
+
+					// removes the .class extension
+					String className = pkgname + '.' + files[i].substring(0, files[i].length() - 6);
+
+					// System.out.println("ClassDiscovery: className = " +
+					// className);
+
+					if (debug) {
+						System.out.println("ClassDiscovery: className = " + className);
+					}
+
+					try {
+						Class clas = Class.forName(className);
+						boolean isAddToRun = false;
+						Method[] methods = clas.getMethods();
+						for (Method method : methods) {
+							Annotation[] anns = method.getAnnotations();
+							for (Annotation an : anns) {
+								if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
+									isAddToRun = true;
+									break;
+								}
+							}
+						}
+						if (isAddToRun)
+							classes.add(clas);
+					} catch (ClassNotFoundException e) {
+						throw new RuntimeException("ClassNotFoundException loading " + className);
+					}
+				}
+			}
+		} else {
+			try {
+				String jarPath = fullPath.replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");
+
+				if (debug) {
+					System.out.println("jarPath is " + jarPath);
+				}
+
+				JarFile jarFile = new JarFile(jarPath);
+				Enumeration<JarEntry> entries = jarFile.entries();
+				while (entries.hasMoreElements()) {
+					JarEntry entry = entries.nextElement();
+					String entryName = entry.getName();
+					if (entryName.startsWith(relPath) && entryName.length() > (relPath.length() + "/".length())) {
+
+						// System.out.println("ClassDiscovery: JarEntry: " +
+						// entryName);
+						String className = entryName.replace('/', '.').replace('\\', '.').replace(".class", "");
+
+						// System.out.println("ClassDiscovery: className = " +
+						// className);
+
+						if (false == className.contains("$")) {
+
+							if (debug) {
+								System.out.println("ClassDiscovery: className = " + className);
+							}
+
+							try {
+								Class clas = Class.forName(className);
+								boolean isAddToRun = false;
+								Method[] methods = clas.getMethods();
+								for (Method method : methods) {
+									Annotation[] anns = method.getAnnotations();
+									for (Annotation an : anns) {
+										if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
+											isAddToRun = true;
+											break;
+										}
+									}
+								}
+								if (isAddToRun)
+									classes.add(clas);
+							} catch (ClassNotFoundException e) {
+								throw new RuntimeException("ClassNotFoundException loading " + className);
+							}
+						}
+					}
+				}
+				jarFile.close();
+
+			} catch (IOException e) {
+				throw new RuntimeException(pkgname + " (" + directory + ") does not appear to be a valid package", e);
+			}
+		}
+		return classes;
+	}
+
+	private void addTableHead(StringBuilder results) {
+		results.append("<tr>");
+		results.append("<th>").append("Unit Test").append("</th>");
+		results.append("<th>").append("Result").append("</th>");
+		results.append("</tr>");
+	}
+
+	private void addUnitTestResult(StringBuilder results, Class<? extends AttSdcTest> testClass,
+			Result unitTestResult) {
+
+		boolean isSuccess = unitTestResult.wasSuccessful();
+
+		String result = (isSuccess) ? "success" : "fail";
+		String fileName = FileUtils.getFileName(testClass.getName());
+		results.append("<tr>");
+		// results.append("<td>").append(FileUtils.getFileName(testClass.getName())).append("</td>");
+		results.append("<td class=\"name\">")
+				.append("<a href=\"" + fileName + timeOfTest + ".html\">" + fileName + "</a>").append("</td>");
+		results.append("<td class=\"" + result + "\">").append(result).append("</td>");
+		results.append("</tr>");
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java
new file mode 100644
index 0000000..b676b29
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java
@@ -0,0 +1,287 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.sanity;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.AssocType;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import fj.data.Either;
+
+public class CrudE2E extends ComponentBaseTest {
+	private static Logger log = LoggerFactory.getLogger(CrudE2E.class.getName());
+
+	public Component resourceDetailsVFCcomp_01;
+	public Component resourceDetailsVFCsoft_01;
+	public Component resourceDetailsCP_01;
+	public Component resourceDetailsVL_01;
+	public Component resourceDetailsVF_01;
+	public Component resourceDetailsVF_02;
+
+	public ComponentInstance resourceDetailsVFC1compIns1;
+	public ComponentInstance resourceDetailsVFC1softIns1;
+	public ComponentInstance resourceDetailsCP1ins_01;
+	public ComponentInstance resourceDetailsVL1ins_01;
+	public ComponentInstance resourceDetailsVF1ins_01;
+	public Component defaultService1;
+	private List<String> variablesAsList = new ArrayList<String>();
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public CrudE2E() {
+		super(name, CrudE2E.class.getName());
+	}
+
+	@Test
+	public void complexScenario() throws Exception {
+
+		User designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+		//////// create defaultService1 ///////////////////////
+
+		Either<Service, RestResponse> createDefaultService1e = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		defaultService1 = createDefaultService1e.left().value();
+
+		//////// create VFC1 (resourceDetailsVFCcomp_01) DerivedFrom COMPUTE
+		//////// type add all possible informational artifacts and change state
+		//////// to CERTIFY////////
+		Either<Resource, RestResponse> resourceDetailsVFCcompE = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER,
+				true);
+		resourceDetailsVFCcomp_01 = resourceDetailsVFCcompE.left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.CHEF, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.PUPPET, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		// AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.SHELL_SCRIPT,
+		// resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		// AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT,
+		// resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.DG_XML, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MURANO_PKG, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+
+		//////// create VFC2 (resourceDetailsVFCsoft_01) DerivedFrom SOFTWARE
+		//////// type and change state to CERTIFY////////
+		Either<Resource, RestResponse> resourceDetailsVFCsoftE = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.SOFTWARE_COMPONENT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER,
+				true);
+		resourceDetailsVFCsoft_01 = resourceDetailsVFCsoftE.left().value();
+		AtomicOperationUtils.changeComponentState(resourceDetailsVFCsoft_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+
+		//////// create CP1 (resourceDetailsVFCsoft_01) DerivedFrom PORT type
+		//////// and change state to CHECKIN////////
+		Either<Resource, RestResponse> resourceDetailsCP_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.PORT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsCP_01 = resourceDetailsCP_01e.left().value();
+		AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+
+		//////// create VL1 (resourceDetailsVFCsoft_01) DerivedFrom NETWORK type
+		//////// and change state to CERTIFY////////
+		Either<Resource, RestResponse> resourceDetailsVL_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VL, NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER,
+				true);
+		resourceDetailsVL_01 = resourceDetailsVL_01e.left().value();
+		AtomicOperationUtils.changeComponentState(resourceDetailsVL_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+
+		//////// create VF1 (resourceDetailsVFCcomp_01) DerivedFrom COMPUTE type
+		//////// add all possible deployment and informational artifacts
+		//////// //////////
+		Either<Resource, RestResponse> resourceDetailsVF_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF_01 = resourceDetailsVF_01e.left().value();
+		ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_NET, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true);
+
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.CHEF, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.PUPPET, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		// AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.SHELL_SCRIPT,
+		// resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		// AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT,
+		// resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.DG_XML, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MURANO_PKG, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
+
+		//////// Add VFC1 VFC2 CP and VL to VF container /////////////
+		resourceDetailsVFC1compIns1 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetailsVFC1softIns1 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCsoft_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetailsCP1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsCP_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
+		resourceDetailsVL1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVL_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
+
+		//////// associate cp-vl vl-vfcComp and vfcComp-vfcSoft////////
+		resourceDetailsVF_01 = AtomicOperationUtils.getResourceObject(resourceDetailsVF_01, UserRoleEnum.DESIGNER);
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVL1ins_01, AssocType.LINKABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVFC1compIns1, AssocType.BINDABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsVFC1compIns1, resourceDetailsVFC1softIns1, AssocType.NODE.getAssocType(), UserRoleEnum.DESIGNER, true);
+
+		//////// download all VF1 artifacts////////
+
+		Collection<ArtifactDefinition> artifacts = resourceDetailsVF_01.getDeploymentArtifacts().values();
+		List<String> collect = artifacts.stream().filter(p -> p.checkEsIdExist() == true).map(p -> p.getUniqueId()).collect(Collectors.toList());
+		artifacts.stream().filter(p -> p.checkEsIdExist() == true).map(p -> p.getUniqueId()).forEach(item -> log.debug(item));
+
+		//////// get all VF1 artifacts////////
+
+		Collection<List<ComponentInstanceProperty>> componentInstancesProperties = resourceDetailsVF_01.getComponentInstancesProperties().values();
+		List<String> collect2 = componentInstancesProperties.stream().filter(p -> p.isEmpty() == false).flatMap(l -> l.stream()).collect(Collectors.toList()).stream().map(p -> p.getUniqueId()).collect(Collectors.toList());
+		// PropertyRestUtils.updateProperty(resourceDetailsVF_01.getUniqueId(),
+		// propertyId, "1", designer);
+		// .forEach((someOtherString) -> {
+		// System.out.println("Content With Java: " + someOtherString);
+		// });
+		// componentInstancesProperties.stream().filter(p ->
+		// p.isEmpty()==false).flatMap(l -> l.stream()).map(e ->
+		// e.getUniqueId());
+		// resourceDetailsVF_01.getComponentInstancesProperties().
+
+		// ArtifactDefinition artifactDefinition =
+		// resourceDetailsVF_01.getDeploymentArtifacts().get(ArtifactTypeEnum.HEAT.getType().toLowerCase()).getEsId();
+		// ArtifactDefinition artifactDefinition =
+		// resource.getDeploymentArtifacts().get(depResArtType);
+		// ArtifactReqDetails artifacJavaObject =
+		// ResponseParser.convertArtifactDefinitionToArtifactReqDetailsObject(artifactDefinition);
+		// ArtifactRestUtils.updateDeploymentArtifactToRI(artifactDetails,
+		// sdncModifierDetails, resourceInstanceId, serviceId)
+
+		//////// certify VF1 - failed due to uncertified CP instance ////////
+
+		RestResponse changeVfStateFailed = LifecycleRestUtils.changeComponentState(resourceDetailsVF_01, designer, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		Resource resResourceDetailsVF_01 = (Resource) resourceDetailsVF_01;
+		variablesAsList = Arrays.asList(resResourceDetailsVF_01.getResourceType().toString(), resourceDetailsCP_01.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name(), variablesAsList, changeVfStateFailed.getResponse());
+
+		//////// certify resources CP1 ////////
+		resourceDetailsCP_01 = AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		//////// replace VF1 instances with new certified instances (CP1
+		//////// replaced) ////////
+		Either<Pair<Component, ComponentInstance>, RestResponse> changeComponentInstanceVersion = AtomicOperationUtils.changeComponentInstanceVersion(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsCP_01, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF_01 = changeComponentInstanceVersion.left().value().getLeft();
+		resourceDetailsCP1ins_01 = changeComponentInstanceVersion.left().value().getRight();
+
+		//////// associate cp-vl and cp-vfc1,////////
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVL1ins_01, AssocType.LINKABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVFC1compIns1, AssocType.BINDABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
+
+		/////// change VF1 state to CHECK-IN and add it as instance to service1
+		/////// container
+		resourceDetailsVF_01 = AtomicOperationUtils.changeComponentState(resourceDetailsVF_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resourceDetailsVF1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVF_01, defaultService1, UserRoleEnum.DESIGNER, true).left().value();
+
+		//////// distribute service1 - failed due to incorrect LifeCyclestatus
+		//////// ////////
+		RestResponse distributeService = AtomicOperationUtils.distributeService(defaultService1, false);
+		Assert.assertEquals(distributeService, null, "verification failed");
+
+		//////// certify service1 - failed due to uncertified instances ////////
+		designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		RestResponse changeServicetStateFailed = LifecycleRestUtils.changeComponentState(defaultService1, designer, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		variablesAsList = Arrays.asList(defaultService1.getComponentType().toString().toLowerCase(), resourceDetailsVF_01.getName());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name(), variablesAsList, changeServicetStateFailed.getResponse());
+
+		////// change VF1 state to CERTIFIED
+		resourceDetailsVF_01 = AtomicOperationUtils.changeComponentState(resourceDetailsVF_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		//////// replace VF1 instances with new certified instances ////////
+		changeComponentInstanceVersion = AtomicOperationUtils.changeComponentInstanceVersion(defaultService1, resourceDetailsVF1ins_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF_01 = changeComponentInstanceVersion.left().value().getLeft();
+		resourceDetailsVFC1compIns1 = changeComponentInstanceVersion.left().value().getRight();
+
+		/////// certify service1 ////////
+		defaultService1 = AtomicOperationUtils.changeComponentState(defaultService1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		//////// distribute service1 - successfully ////////
+		AtomicOperationUtils.distributeService(defaultService1, true);
+
+		/////// create VF2 ////////
+
+		Either<Resource, RestResponse> resourceDetailsVF_02e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetailsVF_02 = resourceDetailsVF_02e.left().value();
+
+	}
+
+	// private void updateArtParameterInResource(Resource resource) throws
+	// IOException {
+	//
+	// ArtifactRestUtils.uploadArtifact(artifactDetails, component,
+	// sdncModifierDetails)
+	//
+	// for (String depResArtType : Utils.getListOfDepResArtLabels(true)) {
+	// ArtifactDefinition artifactDefinition =
+	// resource.getDeploymentArtifacts().get(depResArtType);
+	// ArtifactReqDetails artifacJavaObject =
+	// ResponseParser.convertArtifactDefinitionToArtifactReqDetailsObject(artifactDefinition);
+	//
+	// //update parameter
+	// List<HeatParameterDefinition> resourceHeatParameters =
+	// resource.getDeploymentArtifacts().get(depResArtType).getHeatParameters();
+	// for (HeatParameterDefinition heatParameterDefinition :
+	// resourceHeatParameters){
+	// if (heatParameterDefinition.getName().equals("address")){
+	// heatParameterDefinition.setCurrentValue("negev");
+	// break;
+	// }
+	// }
+	// artifacJavaObject.setHeatParameters(resourceHeatParameters);
+	// artifacJavaObject.setPayloadData(null);
+	// RestResponse updateInformationalArtifactToResource =
+	// ArtifactRestUtils.updateDeploymentArtifactToResource(artifacJavaObject,
+	// sdncDesignerDetails, resource.getUniqueId());
+	// assertTrue("response code is not 200, returned: " +
+	// updateInformationalArtifactToResource.getErrorCode(),updateInformationalArtifactToResource.getErrorCode()
+	// == 200);
+	// }
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java
new file mode 100644
index 0000000..0a7b4a9
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.sanity;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.AssocType;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+public class MultipleResourceUpdate extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public MultipleResourceUpdate() {
+		super(name, MultipleResourceUpdate.class.getName());
+	}
+
+	@Test
+	public void simpleScenario() throws Exception {
+
+		// Creating VF and Resource instances
+		Resource vf = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
+				.value();
+		Resource cp1 = AtomicOperationUtils
+				.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.PORT,
+						ResourceCategoryEnum.NETWORK_CONNECTIVITY_CON_POINT, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		Resource cp2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true)
+				.left().value();
+		Resource vl = AtomicOperationUtils
+				.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VL, NormativeTypesEnum.NETWORK,
+						ResourceCategoryEnum.NETWORK_CONNECTIVITY_VIRTUAL_LINK, UserRoleEnum.DESIGNER, true)
+				.left().value();
+
+		vf.getCreatorUserId();
+
+		// Check In Resources
+		AtomicOperationUtils.changeComponentState(cp1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		AtomicOperationUtils.changeComponentState(cp2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		AtomicOperationUtils.changeComponentState(vl, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+
+		// CheckIn all other except VF
+		ComponentInstance instanceCP1 = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp1, vf, UserRoleEnum.DESIGNER, true).left().value();
+		ComponentInstance instanceVL = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(vl, vf, UserRoleEnum.DESIGNER, true).left().value();
+		ComponentInstance instanceCP2 = AtomicOperationUtils
+				.addComponentInstanceToComponentContainer(cp2, vf, UserRoleEnum.DESIGNER, true).left().value();
+
+		vf = (Resource) AtomicOperationUtils.getCompoenntObject(vf, UserRoleEnum.DESIGNER);
+
+		// Create Vertex(Link/Associate 2 Resource Instances on Canvas)
+		AtomicOperationUtils.associate2ResourceInstances(vf, instanceCP1, instanceVL, AssocType.LINKABLE.getAssocType(),
+				UserRoleEnum.DESIGNER, true);
+
+		List<ComponentInstanceReqDetails> componentInstanceReqDetailsList = new ArrayList<>();
+		componentInstanceReqDetailsList.add(new ComponentInstanceReqDetails(instanceCP1));
+		componentInstanceReqDetailsList.add(new ComponentInstanceReqDetails(instanceCP2));
+		componentInstanceReqDetailsList.add(new ComponentInstanceReqDetails(instanceVL));
+
+		ComponentInstanceReqDetails compInstDet = componentInstanceReqDetailsList.get(0);
+		compInstDet.setPosX("150");
+		compInstDet.setPosY("150");
+		compInstDet = componentInstanceReqDetailsList.get(1);
+		compInstDet.setPosX("400");
+		compInstDet.setPosY("150");
+		compInstDet = componentInstanceReqDetailsList.get(2);
+		compInstDet.setPosX("150");
+		compInstDet.setPosY("300");
+
+		RestResponse response = ComponentInstanceRestUtils.updateMultipleComponentInstance(
+				componentInstanceReqDetailsList, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), vf.getUniqueId(),
+				vf.getComponentType());
+		assertTrue("response code is not 200, returned: " + response.getErrorCode(),
+				response.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
+
+		compInstDet = componentInstanceReqDetailsList.get(0);
+		compInstDet.setPosX("350");
+		compInstDet.setPosY("350");
+		compInstDet = componentInstanceReqDetailsList.get(1);
+		compInstDet.setPosX("600");
+		compInstDet.setPosY("350");
+		compInstDet = componentInstanceReqDetailsList.get(2);
+		compInstDet.setPosX("350");
+		compInstDet.setPosY("500");
+
+		response = ComponentInstanceRestUtils.updateMultipleComponentInstance(componentInstanceReqDetailsList,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), vf.getUniqueId(), vf.getComponentType());
+		assertTrue("response code is not 200, returned: " + response.getErrorCode(),
+				response.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java
new file mode 100644
index 0000000..a14dc8c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.List;
+
+public class ParametersDefinition {
+	
+	private String type;
+	private String description;
+	private Object Default;
+	private String status;
+//	private List<Constraints> constraints;
+	private String entry_schema;
+	private Object value;
+	
+	public ParametersDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ParametersDefinition(String type, String description, Object default1, String status, String entry_schema, Object value) {
+		super();
+		this.type = type;
+		this.description = description;
+		Default = default1;
+		this.status = status;
+		this.entry_schema = entry_schema;
+		this.value = value;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public Object getDefault() {
+		return Default;
+	}
+
+	public void setDefault(Object default1) {
+		Default = default1;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getEntry_schema() {
+		return entry_schema;
+	}
+
+	public void setEntry_schema(String entry_schema) {
+		this.entry_schema = entry_schema;
+	}
+
+	public Object getValue() {
+		return value;
+	}
+
+	public void setValue(Object value) {
+		this.value = value;
+	}
+
+	@Override
+	public String toString() {
+		return "ParametersDefinition [type=" + type + ", description=" + description + ", Default=" + Default + ", status=" + status + ", entry_schema=" + entry_schema + ", value=" + value + "]";
+	}
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java
new file mode 100644
index 0000000..76c0c86
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+public class ToscaCapabilitiesNodeTemplatesDefinition {
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java
new file mode 100644
index 0000000..5a89a67
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java
@@ -0,0 +1,120 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.List;
+import java.util.Map;
+
+import org.yaml.snakeyaml.TypeDescription;
+
+public class ToscaDefinition {
+
+	String tosca_definitions_version;
+	Map<String, String> metadata;
+//	Map<String, ToscaImportsDefinition> imports;
+//	TODO waiting for answer about imports representation
+	Object imports;
+	Map<String, ToscaNodeTypesDefinition> node_types;
+	ToscaTopologyTemplateDefinition topology_template;
+
+	public ToscaDefinition() {
+		super();
+	}
+
+	@Override
+	public String toString() {
+		return "ToscaDefinition [tosca_definitions_version=" + tosca_definitions_version + ", metadata=" + metadata + ", imports=" + imports + ", node_types=" + node_types + ", topology_template=" + topology_template + "]";
+	}
+
+	public String getTosca_definitions_version() {
+		return tosca_definitions_version;
+	}
+
+	public void setTosca_definitions_version(String tosca_definitions_version) {
+		this.tosca_definitions_version = tosca_definitions_version;
+	}
+
+	public Map<String, String> getMetadata() {
+		return metadata;
+	}
+
+	public void setMetadata(Map<String, String> metadata) {
+		this.metadata = metadata;
+	}
+
+	
+
+	
+//	public Map<String,ToscaImportsDefinition> getImports() {
+//		return (Map<String, ToscaImportsDefinition>) imports;
+//	}
+//
+//	public void setImports(Map<String,ToscaImportsDefinition> imports) {
+//		this.imports = imports;
+//	}
+//	
+//	public List<ToscaImportsDefinition> getImports() {
+//		return (List<ToscaImportsDefinition>) imports;
+//	}
+//
+//	public void setImports(List<ToscaImportsDefinition> imports) {
+//		this.imports = imports;
+//	}
+
+	public Object getImports() {
+		return imports;
+	}
+
+	public void setImports(Object imports) {
+		this.imports = imports;
+	}
+
+	public Map<String, ToscaNodeTypesDefinition> getNode_types() {
+		return node_types;
+	}
+
+	public void setNode_types(Map<String, ToscaNodeTypesDefinition> node_types) {
+		this.node_types = node_types;
+	}
+
+	public ToscaTopologyTemplateDefinition getTopology_template() {
+		return topology_template;
+	}
+
+	public void setTopology_template(ToscaTopologyTemplateDefinition topology_template) {
+		this.topology_template = topology_template;
+	}
+
+
+
+	//gets Type description for Yaml snake
+	public static TypeDescription getTypeDescription(){
+        TypeDescription typeDescription = new TypeDescription(ToscaDefinition.class);
+        typeDescription.putMapPropertyType("metadata", String.class, String.class);
+//        TODO Andrey imports format
+        typeDescription.putMapPropertyType("imports", String.class, ToscaImportsDefinition.class);
+        typeDescription.putListPropertyType("imports", List.class);
+        typeDescription.putMapPropertyType("node_types", String.class, ToscaNodeTypesDefinition.class);
+    	return typeDescription;
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsMetadataDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsMetadataDefinition.java
new file mode 100644
index 0000000..eec057e
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsMetadataDefinition.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+public class ToscaGroupsMetadataDefinition {
+
+	private String vfModuleModelName;
+	private String vfModuleModelInvariantUUID;
+	private String vfModuleModelCustomizationUUID;
+	private String vfModuleModelUUID;
+	private String vfModuleModelVersion;
+	
+	public ToscaGroupsMetadataDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public String getVfModuleModelName() {
+		return vfModuleModelName;
+	}
+
+	public void setVfModuleModelName(String vfModuleModelName) {
+		this.vfModuleModelName = vfModuleModelName;
+	}
+
+	public String getVfModuleModelInvariantUUID() {
+		return vfModuleModelInvariantUUID;
+	}
+
+	public void setVfModuleModelInvariantUUID(String vfModuleModelInvariantUUID) {
+		this.vfModuleModelInvariantUUID = vfModuleModelInvariantUUID;
+	}
+
+	public String getVfModuleModelCustomizationUUID() {
+		return vfModuleModelCustomizationUUID;
+	}
+
+	public void setVfModuleModelCustomizationUUID(String vfModuleModelCustomizationUUID) {
+		this.vfModuleModelCustomizationUUID = vfModuleModelCustomizationUUID;
+	}
+
+	public String getVfModuleModelUUID() {
+		return vfModuleModelUUID;
+	}
+
+	public void setVfModuleModelUUID(String vfModuleModelUUID) {
+		this.vfModuleModelUUID = vfModuleModelUUID;
+	}
+
+	public String getVfModuleModelVersion() {
+		return vfModuleModelVersion;
+	}
+
+	public void setVfModuleModelVersion(String vfModuleModelVersion) {
+		this.vfModuleModelVersion = vfModuleModelVersion;
+	}
+
+	@Override
+	public String toString() {
+		return "ToscaGroupsMetadataDefinition [vfModuleModelName=" + vfModuleModelName + ", vfModuleModelInvariantUUID=" + vfModuleModelInvariantUUID + ", vfModuleModelCustomizationUUID=" + vfModuleModelCustomizationUUID
+				+ ", vfModuleModelUUID=" + vfModuleModelUUID + ", vfModuleModelVersion=" + vfModuleModelVersion + "]";
+	}
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java
new file mode 100644
index 0000000..dc3c407
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.List;
+import java.util.Map;
+
+import org.yaml.snakeyaml.TypeDescription;
+
+//	spec page 102
+public class ToscaGroupsTopologyTemplateDefinition {
+
+	private String type; // required
+	private String description;
+	private Map<String, Object> properties;
+	private Map<String, String> targets; // required
+	private Map<String, Object> interfaces;
+	private List<String> members;
+//	private Map<String, String> metadata;
+	private ToscaGroupsMetadataDefinition metadata;
+
+	public ToscaGroupsTopologyTemplateDefinition() {
+		super();
+	}
+
+	public ToscaGroupsMetadataDefinition getMetadata() {
+		return metadata;
+	}
+
+	public void setMetadata(ToscaGroupsMetadataDefinition metadata) {
+		this.metadata = metadata;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+
+	public Map<String, String> getTargets() {
+		return targets;
+	}
+
+	public void setTargets(Map<String, String> targets) {
+		this.targets = targets;
+	}
+
+	public Map<String, Object> getInterfaces() {
+		return interfaces;
+	}
+
+	public void setInterfaces(Map<String, Object> interfaces) {
+		this.interfaces = interfaces;
+	}
+
+	public List<String> getMembers() {
+		return members;
+	}
+
+	public void setMembers(List<String> members) {
+		this.members = members;
+	}
+
+//	public Map<String, String> getMetadata() {
+//		return metadata;
+//	}
+//
+//	public void setMetadata(Map<String, String> metadata) {
+//		this.metadata = metadata;
+//	}
+
+	@Override
+	public String toString() {
+		return "ToscaGroupsTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", targets=" + targets + ", interfaces=" + interfaces + ", members=" + members + ", metadata=" + metadata
+				+ "]";
+	}
+
+	//gets Type description for Yaml snake
+	public static TypeDescription getTypeDescription(){
+        TypeDescription typeDescription = new TypeDescription(ToscaGroupsTopologyTemplateDefinition.class);
+        typeDescription.putMapPropertyType("properties", String.class, Object.class);
+        typeDescription.putMapPropertyType("interfaces", String.class, Object.class);
+        typeDescription.putMapPropertyType("targets", String.class, Object.class);
+//        typeDescription.putMapPropertyType("metadata", String.class, String.class);
+        typeDescription.putMapPropertyType("metadata", String.class, String.class);
+        typeDescription.putListPropertyType("members", String.class);
+    	return typeDescription;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java
new file mode 100644
index 0000000..d62e33e
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+public class ToscaImportsDefinition {
+
+	private String file;
+	private String repository;
+	private String namespace_uri;
+	private String namespace_prefix;
+	
+	public ToscaImportsDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public ToscaImportsDefinition(String file, String repository, String namespace_uri, String namespace_prefix) {
+		super();
+		this.file = file;
+		this.repository = repository;
+		this.namespace_uri = namespace_uri;
+		this.namespace_prefix = namespace_prefix;
+	}
+
+	@Override
+	public String toString() {
+		return "ToscaImportsDefinition [file=" + file + ", repository=" + repository + ", namespace_uri=" + namespace_uri + ", namespace_prefix=" + namespace_prefix + "]";
+	}
+
+	public String getFile() {
+		return file;
+	}
+
+	public void setFile(String file) {
+		this.file = file;
+	}
+
+	public String getRepository() {
+		return repository;
+	}
+
+	public void setRepository(String repository) {
+		this.repository = repository;
+	}
+
+	public String getNamespace_uri() {
+		return namespace_uri;
+	}
+
+	public void setNamespace_uri(String namespace_uri) {
+		this.namespace_uri = namespace_uri;
+	}
+
+	public String getNamespace_prefix() {
+		return namespace_prefix;
+	}
+
+	public void setNamespace_prefix(String namespace_prefix) {
+		this.namespace_prefix = namespace_prefix;
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java
new file mode 100644
index 0000000..6f9590f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+public class ToscaInputsTopologyTemplateDefinition {
+	
+	private Map<String,Map<String,Object>> inputs;
+
+	public ToscaInputsTopologyTemplateDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public Map<String, Map<String,Object>> getInputs() {
+		return inputs;
+	}
+
+	public void setInputs(Map<String, Map<String,Object>> inputs) {
+		this.inputs = inputs;
+	}
+	
+	
+	
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java
new file mode 100644
index 0000000..d42ca8e
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java
@@ -0,0 +1,174 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.List;
+import java.util.Map;
+
+import org.yaml.snakeyaml.TypeDescription;
+
+public class ToscaNodeTemplatesTopologyTemplateDefinition {
+
+	private String name;
+	private String type;
+	private String description;
+	private String [] directives;
+	private Map<String, Object> properties;
+	private List<Map<String, Object>> attributes;
+	private List<Map<String, Object>> requirements;
+	private List<Map<String, Object>> capabilities;
+	private List<Map<String, Object>> interfaces;
+	private List<Map<String, Object>> artifacts;
+	private List<Map<String, Object>> node_filter;
+	private String copy;
+	private Map<String, String> metadata;
+
+	
+//	private Map<String, ToscaPropertiesNodeTemplatesDefinition> properties;
+//	private Map<String, ToscaRequirementsNodeTemplatesDefinition> requirements;
+//	private Map<String, ToscaCapabilitiesNodeTemplatesDefinition> capabilities;
+
+	public ToscaNodeTemplatesTopologyTemplateDefinition() {
+		super();
+	}
+	
+	public Map<String, String> getMetadata() {
+		return metadata;
+	}
+
+	public void setMetadata(Map<String, String> metadata) {
+		this.metadata = metadata;
+	}
+
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String[] getDirectives() {
+		return directives;
+	}
+
+	public void setDirectives(String[] directives) {
+		this.directives = directives;
+	}
+
+
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+
+	public List<Map<String, Object>> getAttributes() {
+		return attributes;
+	}
+
+	public void setAttributes(List<Map<String, Object>> attributes) {
+		this.attributes = attributes;
+	}
+
+	public List<Map<String, Object>> getRequirements() {
+		return requirements;
+	}
+
+	public void setRequirements(List<Map<String, Object>> requirements) {
+		this.requirements = requirements;
+	}
+
+	public List<Map<String, Object>> getCapabilities() {
+		return capabilities;
+	}
+
+	public void setCapabilities(List<Map<String, Object>> capabilities) {
+		this.capabilities = capabilities;
+	}
+
+	public List<Map<String, Object>> getInterfaces() {
+		return interfaces;
+	}
+
+	public void setInterfaces(List<Map<String, Object>> interfaces) {
+		this.interfaces = interfaces;
+	}
+
+	public List<Map<String, Object>> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(List<Map<String, Object>> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	public List<Map<String, Object>> getNode_filter() {
+		return node_filter;
+	}
+
+	public void setNode_filter(List<Map<String, Object>> node_filter) {
+		this.node_filter = node_filter;
+	}
+
+	public String getCopy() {
+		return copy;
+	}
+
+	public void setCopy(String copy) {
+		this.copy = copy;
+	}
+	
+	//gets Type description for Yaml snake
+	public static TypeDescription getTypeDescription(){
+        TypeDescription typeDescription = new TypeDescription(ToscaNodeTemplatesTopologyTemplateDefinition.class);
+        typeDescription.putMapPropertyType("properties", String.class, Object.class);
+        typeDescription.putListPropertyType("requirements", Map.class);
+        typeDescription.putListPropertyType("capabilities", Map.class);
+    	typeDescription.putListPropertyType("attributes", Map.class);
+    	typeDescription.putListPropertyType("interfaces", Map.class);
+    	typeDescription.putListPropertyType("artifacts", Map.class);
+    	typeDescription.putListPropertyType("node_filter", Map.class);
+    	typeDescription.putMapPropertyType("metadata", String.class, String.class);
+    	return typeDescription;
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java
new file mode 100644
index 0000000..07fd223
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java
@@ -0,0 +1,141 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+// spec page 88
+public class ToscaNodeTypesDefinition {
+
+	private String name;
+	private String derived_from;
+	private String version;
+	private String description;
+	private Map<String, Object> properties;
+	private Map<String, Object> attributes;
+	private Map<String, Object> requirements;
+	private Map<String, Object> capabilities;
+	private Map<String, Object> interfaces;
+	private Map<String, Object> artifacts;
+	
+	public ToscaNodeTypesDefinition() {
+		super();
+	}
+
+	public ToscaNodeTypesDefinition(String name, String derived_from, String version, String description, Map<String, Object> properties, Map<String, Object> attributes, Map<String, Object> requirements, Map<String, Object> capabilities,
+			Map<String, Object> interfaces, Map<String, Object> artifacts) {
+		super();
+		this.name = name;
+		this.derived_from = derived_from;
+		this.version = version;
+		this.description = description;
+		this.properties = properties;
+		this.attributes = attributes;
+		this.requirements = requirements;
+		this.capabilities = capabilities;
+		this.interfaces = interfaces;
+		this.artifacts = artifacts;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getDerived_from() {
+		return derived_from;
+	}
+
+	public void setDerived_from(String derived_from) {
+		this.derived_from = derived_from;
+	}
+
+	public String getVersion() {
+		return version;
+	}
+
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+
+	public Map<String, Object> getAttributes() {
+		return attributes;
+	}
+
+	public void setAttributes(Map<String, Object> attributes) {
+		this.attributes = attributes;
+	}
+
+	public Map<String, Object> getRequirements() {
+		return requirements;
+	}
+
+	public void setRequirements(Map<String, Object> requirements) {
+		this.requirements = requirements;
+	}
+
+	public Map<String, Object> getCapabilities() {
+		return capabilities;
+	}
+
+	public void setCapabilities(Map<String, Object> capabilities) {
+		this.capabilities = capabilities;
+	}
+
+	public Map<String, Object> getInterfaces() {
+		return interfaces;
+	}
+
+	public void setInterfaces(Map<String, Object> interfaces) {
+		this.interfaces = interfaces;
+	}
+
+	public Map<String, Object> getArtifacts() {
+		return artifacts;
+	}
+
+	public void setArtifacts(Map<String, Object> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	
+	
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java
new file mode 100644
index 0000000..02ca03d
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+public class ToscaOutputsTopologyTemplateDefinition {
+
+	private Map<String, Object> outputs;
+
+	public ToscaOutputsTopologyTemplateDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public Map<String, Object> getOutputs() {
+		return outputs;
+	}
+
+	public void setOutputs(Map<String, Object> outputs) {
+		this.outputs = outputs;
+	}
+
+	@Override
+	public String toString() {
+		return "ToscaOutputsTopologyTemplateDefinition [outputs=" + outputs + "]";
+	}
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java
new file mode 100644
index 0000000..7ac3e87
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+public class ToscaPoliciesTopologyTemplateDefinition {
+
+	public ToscaPoliciesTopologyTemplateDefinition() {
+		super();
+	}
+	
+	private String type; // required
+	private String description;
+	private Map<String, Object> properties;
+	private Map<String, String> targets;
+	public String getType() {
+		return type;
+	}
+	public void setType(String type) {
+		this.type = type;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+	public Map<String, String> getTargets() {
+		return targets;
+	}
+	public void setTargets(Map<String, String> targets) {
+		this.targets = targets;
+	}
+	@Override
+	public String toString() {
+		return "ToscaPoliciesTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", targets=" + targets + "]";
+	}
+	
+	
+	
+}
+
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java
new file mode 100644
index 0000000..392ffc4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+public class ToscaRelationshipTemplatesTopologyTemplateDefinition {
+
+	public ToscaRelationshipTemplatesTopologyTemplateDefinition() {
+		// TODO Auto-generated constructor stub
+	}
+
+	private String type;
+	private String description;
+	private Map<String, Object> properties;
+	private Map<String, Object> attributes;
+	private Map<String, Object> interfaces;
+	private String copy;
+	public String getType() {
+		return type;
+	}
+	public void setType(String type) {
+		this.type = type;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+	public Map<String, Object> getAttributes() {
+		return attributes;
+	}
+	public void setAttributes(Map<String, Object> attributes) {
+		this.attributes = attributes;
+	}
+	public Map<String, Object> getInterfaces() {
+		return interfaces;
+	}
+	public void setInterfaces(Map<String, Object> interfaces) {
+		this.interfaces = interfaces;
+	}
+	public String getCopy() {
+		return copy;
+	}
+	public void setCopy(String copy) {
+		this.copy = copy;
+	}
+	@Override
+	public String toString() {
+		return "ToscaRelationshipTemplatesTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", attributes=" + attributes + ", interfaces=" + interfaces + ", copy=" + copy + "]";
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java
new file mode 100644
index 0000000..bd9f0f0
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+public class ToscaRequirementsNodeTemplatesDefinition {
+
+	String name;
+	String capability;
+	String node;
+	String relationship;
+
+	public ToscaRequirementsNodeTemplatesDefinition() {
+		super();
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getCapability() {
+		return capability;
+	}
+
+	public void setCapability(String capability) {
+		this.capability = capability;
+	}
+
+	public String getNode() {
+		return node;
+	}
+
+	public void setNode(String node) {
+		this.node = node;
+	}
+
+	public String getRelationship() {
+		return relationship;
+	}
+
+	public void setRelationship(String relationship) {
+		this.relationship = relationship;
+	}
+
+	@Override
+	public String toString() {
+		return "ToscaRequirementsDefinition [name=" + name + ", capability=" + capability + ", node=" + node
+				+ ", relationship=" + relationship + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java
new file mode 100644
index 0000000..957d988
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+import org.yaml.snakeyaml.TypeDescription;
+
+public class ToscaSubstitutionMappingsDefinition {
+
+	private String node_type;
+	private Map<String, Object> requirements;
+	private Map<String, Object> capabilities;
+
+	public ToscaSubstitutionMappingsDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+	
+	public String getNode_type() {
+		return node_type;
+	}
+
+	public void setNode_type(String node_type) {
+		this.node_type = node_type;
+	}
+
+	public Map<String, Object> getRequirements() {
+		return requirements;
+	}
+
+	public void setRequirements(Map<String, Object> requirements) {
+		this.requirements = requirements;
+	}
+
+	public Map<String, Object> getCapabilities() {
+		return capabilities;
+	}
+
+	public void setCapabilities(Map<String, Object> capabilities) {
+		this.capabilities = capabilities;
+	}
+
+//	gets Type description for Yaml snake
+	public static TypeDescription getTypeDescription(){
+        TypeDescription typeDescription = new TypeDescription(ToscaSubstitutionMappingsDefinition.class);
+        typeDescription.putMapPropertyType("requirements", String.class, Object.class);
+        typeDescription.putMapPropertyType("capabilities", String.class, Object.class);
+    	return typeDescription;
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java
new file mode 100644
index 0000000..539c9b4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.List;
+import java.util.Map;
+
+import org.yaml.snakeyaml.TypeDescription;
+
+//	spec page 104	
+public class ToscaTopologyTemplateDefinition {
+
+	String description;
+	Map<String, Object> inputs;
+	Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> node_templates;
+//	Map<String,ToscaRelationshipTemplatesTopologyTemplateDefinition> relationship_templates;
+	Map<String,ToscaGroupsTopologyTemplateDefinition> groups;
+//	Map<String,ToscaPoliciesTopologyTemplateDefinition> policies;
+//	Map<String,ToscaOutputsTopologyTemplateDefinition> outputs;
+	ToscaSubstitutionMappingsDefinition substitution_mappings;
+	
+	public ToscaTopologyTemplateDefinition() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+
+	public ToscaSubstitutionMappingsDefinition getSubstitution_mappings() {
+		return substitution_mappings;
+	}
+
+
+	public void setSubstitution_mappings(ToscaSubstitutionMappingsDefinition substitution_mappings) {
+		this.substitution_mappings = substitution_mappings;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public Map<String, Object> getInputs() {
+		return inputs;
+	}
+
+	public void setInputs(Map<String, Object> inputs) {
+		this.inputs = inputs;
+	}
+
+	public Map<String, ToscaNodeTemplatesTopologyTemplateDefinition> getNode_templates() {
+		return node_templates;
+	}
+
+	public void setNode_templates(Map<String, ToscaNodeTemplatesTopologyTemplateDefinition> node_templates) {
+		this.node_templates = node_templates;
+	}
+
+//	public Map<String, ToscaRelationshipTemplatesTopologyTemplateDefinition> getRelationship_templates() {
+//		return relationship_templates;
+//	}
+//
+//	public void setRelationship_templates(Map<String, ToscaRelationshipTemplatesTopologyTemplateDefinition> relationship_templates) {
+//		this.relationship_templates = relationship_templates;
+//	}
+
+	public Map<String, ToscaGroupsTopologyTemplateDefinition> getGroups() {
+		return groups;
+	}
+
+	public void setGroups(Map<String, ToscaGroupsTopologyTemplateDefinition> groups) {
+		this.groups = groups;
+	}
+//
+//	public Map<String, ToscaPoliciesTopologyTemplateDefinition> getPolicies() {
+//		return policies;
+//	}
+//
+//	public void setPolicies(Map<String, ToscaPoliciesTopologyTemplateDefinition> policies) {
+//		this.policies = policies;
+//	}
+//
+//	public Map<String, ToscaOutputsTopologyTemplateDefinition> getOutputs() {
+//		return outputs;
+//	}
+//
+//	public void setOutputs(Map<String, ToscaOutputsTopologyTemplateDefinition> outputs) {
+//		this.outputs = outputs;
+//	}
+//
+//	public Map<String, ToscaSubstitutionMappingsDefinition> getSubstitution_mappings() {
+//		return substitution_mappings;
+//	}
+//
+//	public void setSubstitution_mappings(Map<String, ToscaSubstitutionMappingsDefinition> substitution_mappings) {
+//		this.substitution_mappings = substitution_mappings;
+//	}
+
+//	@Override
+//	public String toString() {
+//		return "ToscaTopologyTemplateDefinition [description=" + description + ", inputs=" + inputs + ", node_templates=" + node_templates + ", relationship_templates=" + relationship_templates + ", groups=" + groups + ", policies="
+//				+ policies + ", outputs=" + outputs + ", substitution_mappings=" + substitution_mappings + "]";
+//	}
+
+	//gets Type description for Yaml snake
+	public static TypeDescription getTypeDescription(){
+        TypeDescription typeDescription = new TypeDescription(ToscaTopologyTemplateDefinition.class);
+        typeDescription.putMapPropertyType("inputs", String.class, Object.class);
+        typeDescription.putMapPropertyType("node_templates", String.class, ToscaNodeTemplatesTopologyTemplateDefinition.class);
+        typeDescription.putMapPropertyType("groups", String.class, ToscaGroupsTopologyTemplateDefinition.class);
+    	return typeDescription;
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java
new file mode 100644
index 0000000..735c8a0
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.tosca.datatypes;
+
+import java.util.Map;
+
+//	spec page 104	
+public class ToscaTopologyTemplateDefinition2 {
+
+	String description;
+	Map<String,Map<String, Object>> inputs;
+	Map<String,Object> node_templates;
+//	Map<String,ToscaRelationshipTemplatesTopologyTemplateDefinition> relationship_templates;
+	Map<String,Object> groups;
+//	Map<String,ToscaPoliciesTopologyTemplateDefinition> policies;
+//	Map<String,ToscaOutputsTopologyTemplateDefinition> outputs;
+//	Map<String,ToscaSubstitutionMappingsDefinition> substitution_mappings;
+	
+	public ToscaTopologyTemplateDefinition2() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+
+	public Map<String, Map<String, Object>> getInputs() {
+		return inputs;
+	}
+
+	public void setInputs(Map<String, Map<String, Object>> inputs) {
+		this.inputs = inputs;
+	}
+
+	public Map<String, Object> getNode_templates() {
+		return node_templates;
+	}
+
+	public void setNode_templates(Map<String, Object> node_templates) {
+		this.node_templates = node_templates;
+	}
+
+	public Map<String, Object> getGroups() {
+		return groups;
+	}
+
+	public void setGroups(Map<String, Object> groups) {
+		this.groups = groups;
+	}
+
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java
new file mode 100644
index 0000000..9ca8ade
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.users;
+
+public class AddUserAuditMessageInfo {
+
+	String TIMESTAMP;
+	String ACTION;
+	// String MODIFIER_NAME;
+	String MODIFIER;
+	// String USER_UID;
+	// String USER_NAME;
+	// String USER_EMAIL;
+	// String USER_ROLE;
+	String USER;
+	String STATUS;
+	String DESC;
+
+	public AddUserAuditMessageInfo(String timestamp, String action, String modifierName, String modifierUid,
+			String user, String status, String desc) {
+		super();
+		this.TIMESTAMP = timestamp;
+		this.ACTION = action;
+		// this.MODIFIER_NAME = modifierName;
+		this.MODIFIER = modifierUid;
+		this.USER = user;
+		this.STATUS = status;
+		this.DESC = desc;
+	}
+
+	public AddUserAuditMessageInfo() {
+		super();
+	}
+
+	public String getTIMESTAMP() {
+		return TIMESTAMP;
+	}
+
+	public void setTIMESTAMP(String tIMESTAMP) {
+		TIMESTAMP = tIMESTAMP;
+	}
+
+	public String getACTION() {
+		return ACTION;
+	}
+
+	public void setACTION(String aCTION) {
+		ACTION = aCTION;
+	}
+
+	// public String getMODIFIER_NAME() {
+	// return MODIFIER_NAME;
+	// }
+	// public void setMODIFIER_NAME(String mODIFIER_NAME) {
+	// MODIFIER_NAME = mODIFIER_NAME;
+	// }
+	public String getMODIFIER() {
+		return MODIFIER;
+	}
+
+	public void setMODIFIER(String mODIFIER_UID) {
+		MODIFIER = mODIFIER_UID;
+	}
+
+	public String getUSER() {
+		return USER;
+	}
+
+	public void setUSER(String uSER) {
+		USER = uSER;
+	}
+
+	public String getSTATUS() {
+		return STATUS;
+	}
+
+	public void setSTATUS(String sTATUS) {
+		STATUS = sTATUS;
+	}
+
+	public String getDESC() {
+		return DESC;
+	}
+
+	public void setDESC(String dESC) {
+		DESC = dESC;
+	}
+
+	@Override
+	public String toString() {
+		return "AddUserAuditMessageInfo [timestamp=" + TIMESTAMP + ", action=" + ACTION + ", modifierUid=" + MODIFIER
+				+ ", user=" + USER + ", status=" + STATUS + ", desc=" + DESC + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java
new file mode 100644
index 0000000..b34d474
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java
@@ -0,0 +1,133 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.users;
+
+public class UserAuditJavaObject {
+
+	String TIMESTAMP;
+	String ACTION;
+	// String MODIFIER_NAME;
+	String MODIFIER;
+	String USER;
+	// String USER_NAME;
+	// String USER_EMAIL;
+	// String USER_ROLE;
+	String STATUS;
+	String DESC;
+
+	public UserAuditJavaObject(String timestamp, String action, String modifier, String user, String status,
+			String desc) {
+		super();
+		this.TIMESTAMP = timestamp;
+		this.ACTION = action;
+		// this.MODIFIER_NAME = modifierName;
+		this.MODIFIER = modifier;
+		this.USER = user;
+		// this.USER_NAME = userName;
+		// this.USER_EMAIL = userEmail;
+		// this.USER_ROLE = userRole;
+		this.STATUS = status;
+		this.DESC = desc;
+	}
+
+	public UserAuditJavaObject() {
+		super();
+	}
+
+	public String getTIMESTAMP() {
+		return TIMESTAMP;
+	}
+
+	public void setTIMESTAMP(String tIMESTAMP) {
+		TIMESTAMP = tIMESTAMP;
+	}
+
+	public String getACTION() {
+		return ACTION;
+	}
+
+	public void setACTION(String aCTION) {
+		ACTION = aCTION;
+	}
+
+	// public String getMODIFIER_NAME() {
+	// return MODIFIER_NAME;
+	// }
+	// public void setMODIFIER_NAME(String mODIFIER_NAME) {
+	// MODIFIER_NAME = mODIFIER_NAME;
+	// }
+	public String getMODIFIER() {
+		return MODIFIER;
+	}
+
+	public void setMODIFIER(String mODIFIER_UID) {
+		MODIFIER = mODIFIER_UID;
+	}
+
+	public String getUSER() {
+		return USER;
+	}
+
+	public void setUSER(String uSER) {
+		USER = uSER;
+	}
+
+	// public String getUSER_NAME() {
+	// return USER_NAME;
+	// }
+	// public void setUSER_NAME(String uSER_NAME) {
+	// USER_NAME = uSER_NAME;
+	// }
+	// public String getUSER_EMAIL() {
+	// return USER_EMAIL;
+	// }
+	// public void setUSER_EMAIL(String uSER_EMAIL) {
+	// USER_EMAIL = uSER_EMAIL;
+	// }
+	// public String getUSER_ROLE() {
+	// return USER_ROLE;
+	// }
+	// public void setUSER_ROLE(String uSER_ROLE) {
+	// USER_ROLE = uSER_ROLE;
+	// }
+	public String getSTATUS() {
+		return STATUS;
+	}
+
+	public void setSTATUS(String sTATUS) {
+		STATUS = sTATUS;
+	}
+
+	public String getDESC() {
+		return DESC;
+	}
+
+	public void setDESC(String dESC) {
+		DESC = dESC;
+	}
+
+	@Override
+	public String toString() {
+		return "UserAuditJavaObject [timestamp=" + TIMESTAMP + ", action=" + ACTION + ", modifier=" + MODIFIER
+				+ ", user=" + USER + ", status=" + STATUS + ", desc=" + DESC + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java
new file mode 100644
index 0000000..06320bc
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.users;
+
+public class UserHeaderData {
+	String contentType;
+	String httpCspUserId;
+	String accept;
+
+	public UserHeaderData(String contentType, String httpCspUserId, String accept) {
+		super();
+		this.contentType = contentType;
+		this.httpCspUserId = httpCspUserId;
+		this.accept = accept;
+	}
+
+	public String getContentType() {
+		return contentType;
+	}
+
+	public void setContentType(String contentType) {
+		this.contentType = contentType;
+	}
+
+	public String getHttpCspUserId() {
+		return httpCspUserId;
+	}
+
+	public void setHttpCspUserId(String httpCspUserId) {
+		this.httpCspUserId = httpCspUserId;
+	}
+
+	public String getAccept() {
+		return accept;
+	}
+
+	public void setAccept(String accept) {
+		this.accept = accept;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java
new file mode 100644
index 0000000..97a0847
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.users;
+
+public enum UserResponseMessageEnum {
+
+	SUCCESS_MESSAGE("OK"), MISSING_INFORMATION("Error: Missing information"), METHOD_NOT_ALLOWED("Error: Method not allowed"), RESTRICTED_OPERATION("Error: Restricted operation"), USER_ALREADY_EXISTS("Error: User with %s ID already exists"), 
+	INVALID_EMAIL("Error: Invalid Content. Invalid e-mail address %s"), INVALID_ROLE("Error: Invalid Content. Invalid role %s"), INVALID_CONTENT("Error: Invalid content"), USER_NOT_FOUND("Error: User with %s ID is not found"), 
+	INTERNAL_SERVER_ERROR("Error: Internal Server Error. Try later again"), ADMINISTARTOR_CAN_BE_DELETED("Error: Administrator can be deleted by other administrator only"), RESTRICTED_ACCESS("Error: Restricted access");
+
+	String value;
+
+	private UserResponseMessageEnum(String value) {
+		this.value = value;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java
new file mode 100644
index 0000000..609ebf2
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.users;
+
+public class WebSealUserDetails {
+	String firstName;
+	String lastName;
+	String userId;
+	String email;
+
+	public WebSealUserDetails() {
+		super();
+	}
+
+	public WebSealUserDetails(String firstName, String lastName, String userId, String emailAddress) {
+		super();
+		this.firstName = firstName;
+		this.lastName = lastName;
+		this.userId = userId;
+		this.email = emailAddress;
+
+	}
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getEmailAddress() {
+		return email;
+	}
+
+	public void setEmailAddress(String emailAddress) {
+		this.email = emailAddress;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java
new file mode 100644
index 0000000..12f8ffe
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+
+public class ArtifactUtils {
+
+	public static ArtifactDefinition convertArtifactReqToDefinition(ArtifactReqDetails artifactReq) {
+		ArtifactDefinition artifact = new ArtifactDefinition();
+		artifact.setArtifactLabel(artifactReq.getArtifactLabel());
+		artifact.setArtifactDisplayName(artifactReq.getArtifactDisplayName());
+		artifact.setArtifactGroupType(ArtifactGroupTypeEnum.findType(artifactReq.getArtifactGroupType()));
+		artifact.setArtifactType(artifactReq.getArtifactType().toUpperCase());
+		artifact.setArtifactName(artifactReq.getArtifactName());
+		artifact.setDescription(artifactReq.getDescription());
+		artifact.setUniqueId(artifactReq.getUniqueId());
+		artifact.setTimeout(artifactReq.getTimeout());
+		artifact.setEsId(artifactReq.getUniqueId());
+
+		return artifact;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java
new file mode 100644
index 0000000..69c8b2f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java
@@ -0,0 +1,174 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CsarParserUtils {
+	private static Logger log = LoggerFactory.getLogger(CsarValidationUtils.class.getName());
+
+	public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(File csarUUID) throws Exception {
+
+		String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
+		JSONParser parser = new JSONParser();
+		String csarPayload = CsarValidationUtils.getCsarPayload(csarUUID, artifactHeatMetaLocation);
+		if (csarPayload != null) {
+			Object parse = parser.parse(csarPayload);
+			JSONObject jsonObject = (JSONObject) parse;
+			JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
+			List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
+			listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
+			return listHeatMetaDefenition;
+		}
+		return null;
+
+	}
+	
+	public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
+
+		String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
+		JSONParser parser = new JSONParser();
+		String csarPayload = CsarValidationUtils.getCsarPayload(csarUUID, artifactHeatMetaLocation);
+		if (csarPayload != null) {
+			Object parse = parser.parse(csarPayload);
+			JSONObject jsonObject = (JSONObject) parse;
+			JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
+			List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
+			listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
+			return listHeatMetaDefenition;
+		}
+		return null;
+
+	}
+	
+	protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure, List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
+
+		@SuppressWarnings("unchecked")
+		Set<Object> typeSet = jsonObjectImportStructure.keySet();
+		for (Object type : typeSet) {
+			TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
+			log.debug(type.toString());
+			log.debug("{}", jsonObjectImportStructure.get(type));
+			JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
+			heatMetaDefenition.setTypeName((String) type);
+			List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
+			heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroupFromJsonArray(array, groupHeatMetaDefinitions, true, false));
+			listHeatMetaDefenition.add(heatMetaDefenition);
+		}
+		return listHeatMetaDefenition;
+	}
+	
+	protected static List<GroupHeatMetaDefinition> fetchArtifactByGroupFromJsonArray(JSONArray array, List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup, Boolean isNested) {
+
+		GroupHeatMetaDefinition groupHeatMetaDefinition;
+
+		if (array != null) {
+			for (int i = 0; i < array.size(); i++) {
+				if (openNewGroup) {
+					groupHeatMetaDefinition = new GroupHeatMetaDefinition();
+					int groupNumber = listGroupHeatMetaDefinition.size() + 1;
+					log.debug("groupName={}", groupNumber);
+					groupHeatMetaDefinition.setGroup(groupNumber);
+					listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
+					PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
+					propertyHeatMetaDefinition.setName("isBase");
+					propertyHeatMetaDefinition.setValue(false);
+					groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
+				}
+				groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
+				JSONObject jsonObject = (JSONObject) array.get(i);
+				fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, jsonObject, isNested);
+			}
+		}
+		return listGroupHeatMetaDefinition;
+	}
+	
+	
+	public static void fetchArtifactByGroupFromJsonObject(List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, GroupHeatMetaDefinition groupHeatMetaDefinition, JSONObject jsonObject, Boolean isNested) {
+		@SuppressWarnings("unchecked")
+		Set<Object> groupsKey = jsonObject.keySet();
+		for (Object groupKey : groupsKey) {
+			String groupKeyStr = (String) groupKey;
+			if (groupKeyStr.equals("isBase")) {
+				PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
+				propertyHeatMetaDefinition.setName(groupKeyStr);
+				propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
+				if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition().equals(propertyHeatMetaDefinition)) {
+					groupHeatMetaDefinition.getPropertyHeatMetaDefinition().setValue((boolean) jsonObject.get(groupKeyStr));
+				}
+			}
+ 			if (groupKeyStr.equals("fileName")) {
+				String artifactName = (String) jsonObject.get(groupKeyStr);
+				String artifactType = ArtifactTypeEnum.HEAT_ARTIFACT.getType();
+				if(isNested){
+					artifactType = ArtifactTypeEnum.HEAT_NESTED.getType();
+				}
+				if(jsonObject.get("type") != null && isNested == false){
+					artifactType = (String) jsonObject.get("type");
+				}
+				HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifactName, artifactType, null);
+				List<HeatMetaFirstLevelDefinition> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
+				listArtifactNames.add(heatMetaFirstLevelDefinition);
+				groupHeatMetaDefinition.setArtifactList(listArtifactNames);
+			} else {
+				if((groupKeyStr.equals("env"))){
+					if (jsonObject.get(groupKeyStr) instanceof JSONObject){
+						fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, (JSONObject) jsonObject.get(groupKeyStr), false);
+					}else{
+						assertTrue("Expected object is JSONObject, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONObject"));
+					}
+				}
+				if((groupKeyStr.equals("nested"))){
+					if (jsonObject.get(groupKeyStr) instanceof JSONArray){
+						fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, true);
+					}else{
+						assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
+					}
+					
+				}else if (!(groupKeyStr.equals("isBase") || groupKeyStr.equals("type") || groupKeyStr.equals("env"))) {
+					if (jsonObject.get(groupKeyStr) instanceof JSONArray){
+						fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, false);
+					}else{
+						assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
+					}
+				}
+			}
+		}
+	}
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java
new file mode 100644
index 0000000..8e611a3
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java
@@ -0,0 +1,293 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.thinkaurelius.titan.core.TitanEdge;
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+import com.thinkaurelius.titan.core.TitanVertex;
+
+import fj.data.Either;
+
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.users.UserAuditJavaObject;
+import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Property;
+
+public class DbUtils {
+
+	private static String titanConfigFilePath;
+	private static TitanGraph titanGraph;
+
+	
+	public static void cleanAllAudits() throws IOException {
+		CassandraUtils.truncateAllTables("sdcaudit");
+	}
+
+	public static RestResponse deleteFromEsDbByPattern(String patternToDelete) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(),
+				patternToDelete);
+		HttpRequest httpRequest = new HttpRequest();
+		RestResponse restResponse = httpRequest.httpSendDelete(url, null);
+		restResponse.getErrorCode();
+		cleanAllAudits();
+
+		return restResponse;
+	}
+
+	public static RestResponse getFromEsByPattern(String patternToGet) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(), patternToGet);
+		HttpRequest httpRequest = new HttpRequest();
+		RestResponse restResponse = httpRequest.httpSendGet(url, null);
+		restResponse.getErrorCode();
+
+		return restResponse;
+	}
+
+	public Either<Vertex, Boolean> getVertexByUId(String uid) {
+		TitanGraph titanGraph = getTitanGraph();
+		Either<Vertex, Boolean> result = Either.right(false);
+		// Iterator<Vertex> vertexItr = titanGraph.getVertices().iterator();
+
+		Iterator<TitanVertex> vertexItr = titanGraph.query().vertices().iterator();
+		while (vertexItr.hasNext()) {
+			Vertex vertex = vertexItr.next();
+			// String uidFoundVal = vertex.getProperty("uid");
+			String uidFoundVal = vertex.value("uid");
+			if (uid.equals(uidFoundVal)) {
+				result = Either.left(vertex);
+			}
+		}
+		return result;
+	}
+
+	public static TitanState getCurrentTitanState() {
+		TitanGraph titanGraph = getTitanGraph();
+		List<Vertex> vertices = new ArrayList<>();
+		List<Edge> edges = new ArrayList<>();
+		// Iterator<Edge> edgesItr = titanGraph.getEdges().iterator();
+		Iterator<TitanEdge> edgesItr = titanGraph.query().edges().iterator();
+		// Iterator<Vertex> verticesItr = titanGraph.getVertices().iterator();
+		Iterator<TitanVertex> verticesItr = titanGraph.query().vertices().iterator();
+		while (edgesItr.hasNext()) {
+			edges.add(edgesItr.next());
+		}
+		while (verticesItr.hasNext()) {
+			vertices.add(verticesItr.next());
+		}
+
+		TitanState currState = new TitanState(edges, vertices);
+		return currState;
+
+	}
+
+	//
+	private static TitanGraph getTitanGraph() {
+		if (titanGraph == null) {
+			titanGraph = TitanFactory.open(titanConfigFilePath);
+		}
+		return titanGraph;
+	}
+
+	public void restoreToTitanState(TitanState titanStateToRestoreTo) {
+		List<Vertex> verticesToRemove = new ArrayList<>(), verticesToAdd = new ArrayList<>();
+		List<Edge> edgesToRemove = new ArrayList<>(), edgesToAdd = new ArrayList<>();
+
+		TitanState currentTitanState = getCurrentTitanState();
+
+		List<Edge> joinedEdges = new ArrayList<>();
+		joinedEdges.addAll(titanStateToRestoreTo.edges);
+		joinedEdges.retainAll(currentTitanState.edges);
+
+		List<Vertex> joinedVertices = new ArrayList<>();
+		joinedVertices.addAll(titanStateToRestoreTo.vertices);
+		joinedVertices.retainAll(currentTitanState.vertices);
+
+		edgesToRemove.addAll(currentTitanState.edges);
+		edgesToRemove.removeAll(joinedEdges);
+
+		verticesToRemove.addAll(currentTitanState.vertices);
+		verticesToRemove.removeAll(joinedVertices);
+
+		edgesToAdd.addAll(titanStateToRestoreTo.edges);
+		edgesToAdd.removeAll(joinedEdges);
+
+		verticesToAdd.addAll(titanStateToRestoreTo.vertices);
+		verticesToAdd.removeAll(joinedVertices);
+
+		modifyGraphAccordingToDelta(verticesToRemove, verticesToAdd, edgesToRemove, edgesToAdd);
+
+	}
+
+	private void modifyGraphAccordingToDelta(List<Vertex> verticesToRemove, List<Vertex> verticesToAdd,
+			List<Edge> edgesToRemove, List<Edge> edgesToAdd) {
+
+		TitanGraph titanGraph = getTitanGraph();
+
+		for (Vertex vertex : verticesToRemove) {
+			// titanGraph.removeVertex(vertex);
+			vertex.remove();
+		}
+		for (Vertex vertex : verticesToAdd) {
+			TitanVertex titanVertex = titanGraph.addVertex();
+			copyProperties(vertex, titanVertex);
+		}
+
+		for (Edge edge : edgesToRemove) {
+			// titanGraph.removeEdge(edge);
+			edge.remove();
+		}
+
+		for (Edge edge : edgesToAdd) {
+			// Element addedEdge = titanGraph.addEdge(edge.getId(),
+			// edge.getVertex(Direction.OUT), edge.getVertex(Direction.IN),
+			// edge.getLabel());
+
+			// Edge edge = tGraph.addEdge(null, fromV.left().value(),
+			// toV.left().value(), type);
+
+			Element addedEdge = edge.outVertex().addEdge(edge.label(), edge.inVertex());
+
+			copyProperties(edge, addedEdge);
+
+		}
+
+		// titanGraph.commit();
+		titanGraph.tx().commit();
+
+	}
+
+	private void copyProperties(Element copyFrom, Element copyTo) {
+		// Set<String> properties = copyFrom.getPropertyKeys();
+		Set<String> properties = copyFrom.keys();
+		for (String propertyKey : properties) {
+			// copyTo.setProperty(propertyKey,
+			// copyFrom.getProperty(propertyKey));
+			copyTo.property(propertyKey, copyFrom.value(propertyKey));
+		}
+
+	}
+
+	public static class TitanState {
+		private List<Edge> edges;
+		private List<Vertex> vertices;
+
+		private TitanState(List<Edge> edges, List<Vertex> vertices) {
+			this.edges = edges;
+			this.vertices = vertices;
+		}
+
+		@Override
+		public String toString() {
+			return "TitanState [edges=" + edges.size() + ", vertices=" + vertices.size() + "]";
+		}
+
+	}
+
+	public void shutDowntitan() {
+		if (titanGraph != null) {
+			// titanGraph.shutdown();
+			titanGraph.close();
+		}
+	}
+
+	public static void setProperties(Element element, Map<String, Object> properties) {
+
+		if (properties != null && false == properties.isEmpty()) {
+
+			Object[] propertyKeyValues = new Object[properties.size() * 2];
+			int i = 0;
+			for (Entry<String, Object> entry : properties.entrySet()) {
+				propertyKeyValues[i++] = entry.getKey();
+				propertyKeyValues[i++] = entry.getValue();
+			}
+
+			ElementHelper.attachProperties(element, propertyKeyValues);
+
+		}
+
+	}
+
+	public static UserAuditJavaObject parseAuditRespByAction(String action) throws Exception {
+
+		// String index = "auditingevents*";
+		// String type = "useradminevent";
+		// String pattern = "/_search?q=action:\""+action+"\"";
+		// String auditingMessage = retrieveAuditMessageByIndexType(index, type,
+		// pattern);
+		UserAuditJavaObject auditParsedResp = new UserAuditJavaObject();
+		Gson gson = new Gson();
+
+		String pattern = "/_search?q=ACTION:\"" + action + "\"";
+		String auditingMessage = retrieveAuditMessagesByPattern(pattern);
+		JsonElement jElement = new JsonParser().parse(auditingMessage);
+		JsonObject jObject = jElement.getAsJsonObject();
+		JsonObject hitsObject = (JsonObject) jObject.get("hits");
+		JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
+		// for (int i = 0; i < hitsArray.size();){
+		if (hitsArray.size() == 0) {
+			return auditParsedResp;
+		}
+		JsonObject jHitObject = (JsonObject) hitsArray.get(0);
+		JsonObject jSourceObject = (JsonObject) jHitObject.get("_source");
+
+		auditParsedResp = gson.fromJson(jSourceObject, UserAuditJavaObject.class);		
+
+		return auditParsedResp;
+
+	}
+
+	public static String retrieveAuditMessagesByPattern(String pattern) throws IOException {
+
+		Config config = Utils.getConfig();
+		HttpRequest getAuditingMessage = new HttpRequest();
+		String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(), pattern);
+		RestResponse restResponse = getAuditingMessage.httpSendGet(url, null);
+
+		return restResponse.getResponse();
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java
new file mode 100644
index 0000000..7d90eb0
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.apache.commons.codec.binary.Base64;
+
+public class Decoder {
+
+	public static String encode(byte[] byteArrayToEncode) {
+
+		byte[] bytesEncoded = Base64.encodeBase64(byteArrayToEncode);
+		String strEncoded = new String(bytesEncoded);
+		return strEncoded;
+	}
+
+	public static String decode(String strEncoded) throws IOException {
+
+		byte[] byteDecoded = Base64.decodeBase64(strEncoded);
+		String decoded = new String(byteDecoded);
+
+		return decoded;
+
+	}
+
+	public static String readFileToString(String file) throws IOException {
+
+		BufferedReader reader = new BufferedReader(new FileReader(file));
+		String line = null;
+		StringBuilder stringBuilder = new StringBuilder();
+		String ls = System.getProperty("line.separator");
+
+		while ((line = reader.readLine()) != null) {
+			stringBuilder.append(line);
+			stringBuilder.append(ls);
+		}
+		reader.close();
+		return stringBuilder.toString();
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java
new file mode 100644
index 0000000..4838d55
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceDistributionStatus;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+
+ public class DistributionUtils {
+	 
+	 final static String serviceDistributionSuffix = "/sdc/v1/catalog/services/";
+
+	 public static ServiceDistributionStatus getLatestServiceDistributionObject(Service service) throws IOException, ParseException {
+			ServiceDistributionStatus serviceDistributionStatus = null;
+			RestResponse distributionServiceList = ServiceRestUtils.getDistributionServiceList(service, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			Map<Long, ServiceDistributionStatus> serviveDistributionStatusMap = ResponseParser.convertServiceDistributionStatusToObject(distributionServiceList.getResponse());
+			if(serviveDistributionStatusMap.size() != 0){
+				serviceDistributionStatus = getLatestServiceDistributionObjectFromMap(serviveDistributionStatusMap);
+				return serviceDistributionStatus;
+			}
+			
+			return null;
+	}
+
+	public static ServiceDistributionStatus getLatestServiceDistributionObjectFromMap(Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap) {
+		
+		ServiceDistributionStatus serviceDistributionStatus = null;
+		if (serviceDistributionStatusMap.size() == 1 ){
+			for (Entry<Long, ServiceDistributionStatus> entry : serviceDistributionStatusMap.entrySet()) {
+				return entry.getValue();
+			}
+		}
+		else{
+			serviceDistributionStatus = getFilteredServiceDistributionObject(serviceDistributionStatusMap);
+		}
+		
+		return serviceDistributionStatus;
+	}
+
+	private static ServiceDistributionStatus getFilteredServiceDistributionObject(Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap) {
+		
+		List<Long> list = new ArrayList<Long>();
+		list.addAll(serviceDistributionStatusMap.keySet());
+		Collections.sort(list);
+		return serviceDistributionStatusMap.get(list.get(list.size() - 1));
+	}
+	
+	public static Map<String, String> getArtifactsMapOfDistributedService(Service service) throws Exception{
+		
+		Map<String, String> expectedDistributionArtifactMap = new HashMap<String, String>();
+		expectedDistributionArtifactMap = addServiceDeploymentArtifactToMap(service, expectedDistributionArtifactMap);
+		expectedDistributionArtifactMap = addComponentInstancesDeploymentArtifactToMap(service, expectedDistributionArtifactMap);
+		
+		return expectedDistributionArtifactMap;
+	}
+	
+	
+	public static Map<String, String> addServiceDeploymentArtifactToMap(Service service, Map<String, String> distributionArtifactMap){
+		
+		Map<String, ArtifactDefinition> deploymentArtifacts = service.getDeploymentArtifacts();
+		if (deploymentArtifacts != null && deploymentArtifacts.size() > 0){
+			for(Entry<String, ArtifactDefinition> artifact : deploymentArtifacts.entrySet()){
+				String url = buildServiceDeploymentUrl(service, artifact.getValue().getArtifactName(), artifact.getValue().getArtifactUUID());
+				distributionArtifactMap.put(artifact.getKey(), url);
+			}
+		}
+		
+		return distributionArtifactMap;
+	}
+	
+	private static String buildServiceDeploymentUrl(Service service, String artifactName, String artifactUUID) {
+//		format	"/sdc/v1/catalog/services/" + service.getSystemName() + "/" + service.getVersion() + "/artifacts/AAI-" + service.getName() + "-service-1.xml"
+		return serviceDistributionSuffix + service.getSystemName() + "/" + service.getVersion() + "/artifacts/" + artifactName;
+	}
+
+	public static String buildResourceInstanceDeploymentUrl(Service service, String artifactName, String artifactUUID){
+		
+//			/sdc/v1/catalog/services/Servicefordistribution/1.0  /resourceInstances/nestedfrommarina2   /artifacts/FEAdd_On_Module_vProbeLauncher.yaml
+		String resourceInstanceNormalizedName = getResourceInstanceNormalizeName(service, artifactName, artifactUUID );
+		return serviceDistributionSuffix + service.getSystemName() + "/" + service.getVersion() + "/resourceInstances/" + resourceInstanceNormalizedName  +"/artifacts/" + artifactName;
+	}
+	
+	public static String getResourceInstanceNormalizeName(Service service, String artifactName, String artifactUUID) {
+		for (ComponentInstance componentInstance : service.getComponentInstances()){
+			for(String key : componentInstance.getDeploymentArtifacts().keySet()){
+				if(componentInstance.getDeploymentArtifacts().get(key).getArtifactUUID().equals(artifactUUID)) {
+					return componentInstance.getNormalizedName();
+				}
+			}
+		}
+		return null;
+	}
+
+	public static Map<String, String> addComponentInstancesDeploymentArtifactToMap(Service service, Map<String, String> distributionArtifactMap){
+//			TODO Andrey create correct method to build RI url
+		if(service.getComponentInstances() != null && service.getComponentInstances().size() != 0){
+		for(ComponentInstance componentInstance : service.getComponentInstances()){
+			if (componentInstance.getDeploymentArtifacts() != null && componentInstance.getDeploymentArtifacts().size() != 0){
+				for(Entry<String, ArtifactDefinition> artifact : componentInstance.getDeploymentArtifacts().entrySet()){
+					String url = buildResourceInstanceDeploymentUrl(service, artifact.getValue().getArtifactName(), artifact.getValue().getArtifactUUID());;
+					distributionArtifactMap.put(artifact.getKey(), url);
+				}
+			}
+		}
+	}
+		
+		return distributionArtifactMap;
+	}
+	 
+	 
+ }
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java
new file mode 100644
index 0000000..3f000d7
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java
@@ -0,0 +1,630 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.Function;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+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.User;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.testng.Assert;
+
+public class ReqCap {
+
+	public static Map<String, List<CapabilityDefinition>> expectedContainerCapabilities;
+	public static Map<String, List<RequirementDefinition>> expectedContainerRequirements;
+	public static Map<String, RequirementDefinition> removedRequirements;
+	public static Map<String, ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>> expectedContInstReqCap;
+
+	public static void verifyVFReqCap(String componentId) throws Exception {
+		RestResponse restResponse = ResourceRestUtils.getResource(componentId);
+		Resource resource = ResponseParser.parseToObject(restResponse.getResponse(), Resource.class);
+		verifyReqCap(resource);
+	}
+
+	public static void verifyServiceReqCap(String componentId, User sdncDesignerDetails) throws Exception {
+		RestResponse restResponse = ServiceRestUtils.getService(componentId, sdncDesignerDetails);
+		Service service = ResponseParser.parseToObject(restResponse.getResponse(), Service.class);
+		verifyReqCap(service);
+	}
+
+	public static void verifyProductReqCap(String componentId, User sdncPsDetails1) throws Exception {
+		RestResponse restResponse = ProductRestUtils.getProduct(componentId, sdncPsDetails1.getUserId());
+		Product product = ResponseParser.parseToObject(restResponse.getResponse(), Product.class);
+		verifyReqCap(product);
+	}
+
+	public static void verifyReqCap(Component actualComponent) {
+		verifyContainerReqCap(actualComponent);
+		verifyCompInstReqCap(actualComponent);
+	}
+
+	public RestResponse changeServiceInstanceVersion(String componentUniqueId, String serviceInstanceToReplaceUniqueId,
+			String serviceUniqueId, User sdncModifierDetails, ComponentTypeEnum componentType, boolean isHighestLevel)
+			throws Exception {
+		RestResponse changeResourceInstanceVersion = ProductRestUtils.changeServiceInstanceVersion(componentUniqueId,
+				serviceInstanceToReplaceUniqueId, serviceUniqueId, sdncModifierDetails, componentType);
+		if (changeResourceInstanceVersion.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS) && isHighestLevel) {
+			/*
+			 * // Add RI Capabilities and Requirements to expected MAP -->
+			 * expectedVfCapabilities and expectedVfRequirements
+			 * 
+			 * ComponentInstance componentInstance =
+			 * ResponseParser.parseToObjectUsingMapper(
+			 * changeResourceInstanceVersion.getResponse(),
+			 * ComponentInstance.class);
+			 * addCompInstReqCapToExpected(componentInstance, componentType);
+			 */
+		}
+		return changeResourceInstanceVersion;
+	}
+
+	public static void updateExpectedReqCapAfterChangeLifecycleState(String oldContainerUniqueIdToReplace,
+			String newContainerUniqueId) {
+
+		// Update of container req/cap
+
+		Set<String> compInstKeysToChange = new HashSet<>();
+
+		for (String expKey : expectedContainerCapabilities.keySet()) {
+			List<CapabilityDefinition> expCapList = expectedContainerCapabilities.get(expKey);
+			for (CapabilityDefinition cap : expCapList) {
+				String ownerId = cap.getOwnerId();
+
+				if (ownerId.contains(oldContainerUniqueIdToReplace)) {
+					compInstKeysToChange.add(ownerId);
+					cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+				}
+			}
+		}
+
+		for (String expKey : expectedContainerRequirements.keySet()) {
+			List<RequirementDefinition> expCapList = expectedContainerRequirements.get(expKey);
+			for (RequirementDefinition cap : expCapList) {
+				String ownerId = cap.getOwnerId();
+				if (ownerId.contains(oldContainerUniqueIdToReplace)) {
+					compInstKeysToChange.add(ownerId);
+					cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
+				}
+			}
+		}
+
+		// Update of internal comp instances req/cap
+		for (String oldKey : compInstKeysToChange) {
+			ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> immutablePair = expectedContInstReqCap
+					.get(oldKey);
+			if (immutablePair != null) {
+				expectedContInstReqCap.remove(oldKey);
+				String newKey = oldKey.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId);
+				expectedContInstReqCap.put(newKey, immutablePair);
+			}
+		}
+	}
+
+	private static void verifyCompInstReqCap(Component actualComponent) {
+		List<ComponentInstance> componentInstances = actualComponent.getComponentInstances();
+		if (componentInstances != null) {
+			assertEquals(expectedContInstReqCap.size(), componentInstances.size());
+			for (ComponentInstance compInst : componentInstances) {
+				String uniqueId = compInst.getUniqueId();
+				// System.out.println("Verifying req/cap of component instance
+				// "+ uniqueId);
+				Map<String, List<RequirementDefinition>> actualCompInstReq = compInst.getRequirements();
+				if (actualCompInstReq == null) {
+					actualCompInstReq = new HashMap<>();
+				}
+				Map<String, List<CapabilityDefinition>> actualCompInstCap = compInst.getCapabilities();
+				if (actualCompInstCap == null) {
+					actualCompInstCap = new HashMap<>();
+				}
+				ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> expReqCap = expectedContInstReqCap
+						.get(uniqueId);
+				assertNotNull(expReqCap);
+				// System.out.println("expected instance requirements:
+				// "+expReqCap.right);
+				// System.out.println("expected instance capabilities:
+				// "+expReqCap.left);
+				// System.out.println("actual instance requirements:
+				// "+actualCompInstReq);
+				// System.out.println("actual instance capabilities:
+				// "+actualCompInstCap);
+
+				// REQ comparison
+				compareReqCapMaps(expReqCap.right, actualCompInstReq);
+
+				// CAP comparison
+				compareReqCapMaps(expReqCap.left, actualCompInstCap);
+			}
+
+		} else {
+			assertTrue(expectedContInstReqCap.isEmpty());
+		}
+	}
+
+	private static void verifyContainerReqCap(Component actualComponent) {
+		Map<String, List<RequirementDefinition>> actualContainerRequirements = actualComponent.getRequirements();
+		if (actualContainerRequirements == null) {
+			actualContainerRequirements = new HashMap<>();
+		}
+		Map<String, List<CapabilityDefinition>> actualContainerCapabilities = actualComponent.getCapabilities();
+		if (actualContainerCapabilities == null) {
+			actualContainerCapabilities = new HashMap<>();
+		}
+		// System.out.println("Verifying req/cap of container component "+
+		// actualComponent.getUniqueId());
+		// System.out.println("expected container requirements:
+		// "+expectedContainerRequirements);
+		// System.out.println("expected container capabilities:
+		// "+expectedContainerCapabilities);
+		// System.out.println("actual container requirements:
+		// "+actualContainerRequirements);
+		// System.out.println("actual container capabilities:
+		// "+actualContainerCapabilities);
+
+		// REQ comparison
+		compareReqCapMaps(expectedContainerRequirements, actualContainerRequirements);
+
+		// CAP comparison
+		compareReqCapMaps(expectedContainerCapabilities, actualContainerCapabilities);
+	}
+
+	private static <T> void compareReqCapMaps(Map<String, List<T>> expectedMap, Map<String, List<T>> actualMap) {
+		assertEquals(expectedMap.size(), actualMap.size());
+		for (String expKey : expectedMap.keySet()) {
+			List<?> expCapList = expectedMap.get(expKey);
+			List<?> actCapList = actualMap.get(expKey);
+			assertEquals(expCapList.size(), actCapList.size());
+			assertEquals(new HashSet<>(expCapList), new HashSet<>(actCapList));
+		}
+	}
+
+	public static void addCompInstReqCapToExpected(ComponentInstance componentInstance,
+			ComponentTypeEnum containerComponentType, User sdncDesignerDetails) throws Exception {
+
+		sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String uniqueId = componentInstance.getUniqueId();
+		String name = componentInstance.getName();
+		String originComponentId = componentInstance.getComponentUid();
+		RestResponse getResponse = null;
+		ComponentTypeEnum compInstType = getCompInstTypeByContainerType(containerComponentType);
+		Component component = null;
+		if (compInstType == ComponentTypeEnum.RESOURCE) {
+			getResponse = ResourceRestUtils.getResource(sdncDesignerDetails, originComponentId);
+			ResourceRestUtils.checkSuccess(getResponse);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
+		} else if (compInstType == ComponentTypeEnum.SERVICE) {
+			getResponse = ServiceRestUtils.getService(originComponentId, sdncDesignerDetails);
+			ResourceRestUtils.checkSuccess(getResponse);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
+		} else {
+			Assert.fail("Unsupported type - " + containerComponentType);
+		}
+
+		Map<String, List<RequirementDefinition>> resourceRequirements = component.getRequirements();
+		if (resourceRequirements == null) {
+			resourceRequirements = new HashMap<>();
+		}
+
+		Function<Entry<String, List<RequirementDefinition>>, List<RequirementDefinition>> requirementDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new RequirementDefinition(item)).collect(Collectors.toList()));
+		Map<String, List<RequirementDefinition>> reqCopy = resourceRequirements.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), requirementDefinitionMapper));
+		
+		Map<String, List<CapabilityDefinition>> resourceCapabilities = component.getCapabilities();
+		if (resourceCapabilities == null) {
+			resourceCapabilities = new HashMap<>();
+		}
+		
+		Function<Entry<String, List<CapabilityDefinition>>, List<CapabilityDefinition>> capabilityDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new CapabilityDefinition(item)).collect(Collectors.toList()));
+		Map<String, List<CapabilityDefinition>> capCopy = resourceCapabilities.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), capabilityDefinitionMapper));
+		
+		setupContainerExpectedReqCap(uniqueId, name, resourceRequirements, resourceCapabilities);
+		if (component.getComponentType().equals(ComponentTypeEnum.RESOURCE)
+				&& ((Resource) component).getResourceType() != ResourceTypeEnum.VF) {
+			setupConstInstExpectedReqCap(uniqueId, name, reqCopy, capCopy);
+		}
+
+		// adding entry for expected componentInstance
+		ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> compInstReqCapPair = new ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>(
+				capCopy, reqCopy);
+		expectedContInstReqCap.put(uniqueId, compInstReqCapPair);
+	}
+
+	private static void setupContainerExpectedReqCap(String uniqueId, String name,
+			Map<String, List<RequirementDefinition>> componentRequirements,
+			Map<String, List<CapabilityDefinition>> componentCapabilities) {
+		for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
+			List<RequirementDefinition> reqListToAdd = resReq.getValue();
+			for (RequirementDefinition requirementDefinition : reqListToAdd) {
+				requirementDefinition.setOwnerId(uniqueId);
+				requirementDefinition.setOwnerName(name);
+			}
+			List<RequirementDefinition> expectedReqList = expectedContainerRequirements.get(resReq.getKey());
+			if (expectedReqList == null) {
+				expectedReqList = reqListToAdd;
+			} else {
+				expectedReqList.addAll(reqListToAdd);
+			}
+			expectedContainerRequirements.put(resReq.getKey(), expectedReqList);
+		}
+
+		for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
+			List<CapabilityDefinition> capListToAdd = resCap.getValue();
+			for (CapabilityDefinition capDefinition : capListToAdd) {
+				capDefinition.setOwnerId(uniqueId);
+				capDefinition.setOwnerName(name);
+			}
+			List<CapabilityDefinition> expectedCapList = expectedContainerCapabilities.get(resCap.getKey());
+			if (expectedCapList == null) {
+				expectedCapList = capListToAdd;
+			} else {
+				expectedCapList.addAll(capListToAdd);
+			}
+			expectedContainerCapabilities.put(resCap.getKey(), expectedCapList);
+		}
+	}
+
+	private static void setupConstInstExpectedReqCap(String uniqueId, String name,
+			Map<String, List<RequirementDefinition>> componentRequirements,
+			Map<String, List<CapabilityDefinition>> componentCapabilities) {
+		for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
+			List<RequirementDefinition> reqListToAdd = resReq.getValue();
+			for (RequirementDefinition requirementDefinition : reqListToAdd) {
+				requirementDefinition.setOwnerId(uniqueId);
+				requirementDefinition.setOwnerName(name);
+			}
+		}
+
+		for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
+			List<CapabilityDefinition> capListToAdd = resCap.getValue();
+			for (CapabilityDefinition capDefinition : capListToAdd) {
+				capDefinition.setOwnerId(uniqueId);
+				capDefinition.setOwnerName(name);
+			}
+		}
+	}
+
+	private static ComponentTypeEnum getCompInstTypeByContainerType(ComponentTypeEnum componentType) {
+		switch (componentType) {
+		case RESOURCE:
+			return ComponentTypeEnum.RESOURCE;
+		case SERVICE:
+			return ComponentTypeEnum.RESOURCE;
+		case PRODUCT:
+			return ComponentTypeEnum.SERVICE;
+		default:
+			break;
+		}
+		return null;
+	}
+
+	public static void deleteCompInstReqCapFromExpected(String componentInstanceId) {
+		List<String> entriesRequirementsToRemove = new ArrayList<>();
+		List<String> entriesCapabilitiesToRemove = new ArrayList<>();
+		for (Entry<String, List<RequirementDefinition>> reqEntry : expectedContainerRequirements.entrySet()) {
+			List<RequirementDefinition> reqList = reqEntry.getValue();
+			List<RequirementDefinition> reqListToDelete = new ArrayList<>();
+			for (RequirementDefinition requirementDefinition : reqList) {
+				if (requirementDefinition.getOwnerId().equals(componentInstanceId)) {
+					reqListToDelete.add(requirementDefinition);
+				}
+			}
+			reqList.removeAll(reqListToDelete);
+			if (reqList.isEmpty()) {
+				entriesRequirementsToRemove.add(reqEntry.getKey());
+			}
+		}
+
+		for (String ekey : entriesRequirementsToRemove) {
+			expectedContainerRequirements.remove(ekey);
+		}
+
+		for (Entry<String, List<CapabilityDefinition>> capEntry : expectedContainerCapabilities.entrySet()) {
+			List<CapabilityDefinition> capList = capEntry.getValue();
+			List<CapabilityDefinition> capListToDelete = new ArrayList<>();
+			for (CapabilityDefinition capabilityDefinition : capList) {
+				if (capabilityDefinition.getOwnerId().equals(componentInstanceId)) {
+					capListToDelete.add(capabilityDefinition);
+				}
+			}
+			capList.removeAll(capListToDelete);
+			if (capList.isEmpty()) {
+				entriesCapabilitiesToRemove.add(capEntry.getKey());
+			}
+		}
+		for (String ekey : entriesCapabilitiesToRemove) {
+			expectedContainerCapabilities.remove(ekey);
+		}
+
+		expectedContInstReqCap.remove(componentInstanceId);
+
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse createAtomicInstanceForVF(Resource containerDetails, Resource compInstOriginDetails,
+			User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE,
+				true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse createAtomicInstanceForService(Service containerDetails, Resource compInstOriginDetails,
+			User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
+				true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse createVFInstance(Service containerDetails, Resource compInstOriginDetails, User modifier)
+			throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
+				true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse createServiceInstance(Product containerDetails, Service compInstOriginDetails,
+			User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT,
+				true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse deleteAtomicInstanceForVF(String compInstUniqueId, Resource containerDetails,
+			User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse deleteAtomicInstanceForService(String compInstUniqueId, Service containerDetails,
+			User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse deleteVFInstance(String compInstUniqueId, Service containerDetails, User modifier)
+			throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
+
+	}
+
+	// Automatically updates the expected req/cap of the container
+	public static RestResponse deleteServiceInstance(String compInstUniqueId, Product containerDetails, User modifier)
+			throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, true);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse createAtomicInstanceForVFDuringSetup(Resource containerDetails,
+			Resource compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE,
+				false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse createAtomicInstanceForServiceDuringSetup(Service containerDetails,
+			Resource compInstOriginDetails, User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
+				false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse createVFInstanceDuringSetup(Service containerDetails, Resource compInstOriginDetails,
+			User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
+				false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse createServiceInstanceDuringSetup(Product containerDetails, Service compInstOriginDetails,
+			User modifier) throws Exception {
+		return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT,
+				false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse deleteAtomicInstanceForVFDuringSetup(String compInstUniqueId, Resource containerDetails,
+			User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse deleteAtomicInstanceForServiceDuringSetup(String compInstUniqueId,
+			Service containerDetails, User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse deleteVFInstanceDuringSetup(String compInstUniqueId, Service containerDetails,
+			User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
+
+	}
+
+	// Setup of lower components - Doesn't affect req/cap of the container (for
+	// example, setup of VF for testing a Product)
+	public static RestResponse deleteServiceInstanceDuringSetup(String compInstUniqueId, Product containerDetails,
+			User modifier) throws IOException, Exception {
+		return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, false);
+	}
+
+	public static Component getComponentAndValidateRIs(Component componentDetails, int numberOfRIs,
+			int numberOfRelations, User sdncAdminDetails) throws IOException, Exception {
+
+		RestResponse getResponse = null;
+		Component component = null;
+		if (componentDetails instanceof Resource) {
+			getResponse = ResourceRestUtils.getResource(sdncAdminDetails, componentDetails.getUniqueId());
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
+		} else if (componentDetails instanceof Service) {
+			getResponse = ServiceRestUtils.getService((componentDetails.getUniqueId()), sdncAdminDetails);
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
+		} else if (componentDetails instanceof Product) {
+			getResponse = ProductRestUtils.getProduct(componentDetails.getUniqueId(), sdncAdminDetails.getUserId());
+			component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Product.class);
+		} else {
+			Assert.fail("Unsupported type of componentDetails - " + componentDetails.getClass().getSimpleName());
+		}
+		ResourceRestUtils.checkSuccess(getResponse);
+		int numberOfActualRIs = component.getComponentInstances() != null ? component.getComponentInstances().size()
+				: 0;
+		int numberOfActualRelations = component.getComponentInstancesRelations() != null
+				? component.getComponentInstancesRelations().size() : 0;
+		assertEquals("Check number of RIs meet the expected number", numberOfRIs, numberOfActualRIs);
+		assertEquals("Check number of RI relations meet the expected number", numberOfRelations,
+				numberOfActualRelations);
+		verifyReqCap(component);
+
+		return component;
+	}
+
+	public static void getComponentAndValidateRIsAfterChangeLifecycleState(String oldComponentUniqueIdToReplace,
+			Component componentDetails, int numOfRIs, int numOfRelations, User sdncAdminDetails)
+			throws IOException, Exception {
+		updateExpectedReqCapAfterChangeLifecycleState(oldComponentUniqueIdToReplace, componentDetails.getUniqueId());
+		getComponentAndValidateRIs(componentDetails, numOfRIs, numOfRelations, sdncAdminDetails);
+	}
+
+	private static RestResponse createComponentInstance(Component containerDetails, Component compInstOriginDetails,
+			User modifier, ComponentTypeEnum containerComponentTypeEnum, boolean isHighestLevel)
+			throws IOException, Exception {
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentInstance(compInstOriginDetails);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, modifier, containerDetails.getUniqueId(), containerComponentTypeEnum);
+		if (createResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_CREATED) && isHighestLevel) {
+			// Add RI Capabilities and Requirements to expected MAP -->
+			// expectedVfCapabilities and expectedVfRequirements
+			ComponentInstance componentInstance = ResponseParser
+					.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
+			addCompInstReqCapToExpected(componentInstance, containerComponentTypeEnum, modifier);
+		}
+		return createResourceInstanceResponse;
+	}
+
+	private static RestResponse deleteComponentInstance(String compInstUniqueId, Component containerDetails,
+			User modifier, ComponentTypeEnum componentTypeEnum, boolean isHighestLevel) throws Exception {
+		RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(modifier,
+				containerDetails.getUniqueId(), compInstUniqueId, componentTypeEnum);
+		if (deleteResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_DELETE) && isHighestLevel) {
+			deleteCompInstReqCapFromExpected(compInstUniqueId);
+		}
+		return deleteResourceInstanceResponse;
+	}
+
+	public static RestResponse associateComponentInstancesForService(RequirementCapabilityRelDef requirementDef,
+			ComponentReqDetails containerDetails, User user) throws IOException {
+
+		RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, user,
+				containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(associateInstances);
+		deleteAssociatedFromExpected(requirementDef);
+		return associateInstances;
+	}
+
+	private static void deleteAssociatedFromExpected(RequirementCapabilityRelDef requirementDef) {
+		// removing from requirements
+		RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0);
+		String type = relationship.getRelationship().getType();
+		String fromId = requirementDef.getFromNode();
+		List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
+		RequirementDefinition toDelete = null;
+		if (reqList != null) {
+			for (RequirementDefinition reqDef : reqList) {
+				if (reqDef.getOwnerId().equals(fromId)) {
+					toDelete = reqDef;
+				}
+			}
+			if (toDelete != null) {
+				reqList.remove(toDelete);
+				if (reqList.isEmpty()) {
+					expectedContainerRequirements.remove(type);
+				}
+				removedRequirements.put(toDelete.getCapability() + " " + toDelete.getOwnerId(), toDelete);
+			}
+		}
+	}
+
+	public static void dissociateComponentInstancesForService(RequirementCapabilityRelDef requirementDef,
+			ComponentReqDetails containerDetails, User user) throws IOException {
+
+		RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, user,
+				containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
+		ResourceRestUtils.checkSuccess(dissociateInstances);
+		addDissociatedToExpected(requirementDef);
+	}
+
+	private static void addDissociatedToExpected(RequirementCapabilityRelDef requirementDef) {
+		// adding to requirements
+		RequirementAndRelationshipPair relationship = requirementDef.getRelationships().get(0);
+		String type = relationship.getRelationship().getType();
+		String fromId = requirementDef.getFromNode();
+		String key = type + " " + fromId;
+		RequirementDefinition requirementDefinition = removedRequirements.get(key);
+		if (requirementDefinition != null) {
+			List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
+			if (reqList == null) {
+				reqList = new ArrayList<>();
+				expectedContainerRequirements.put(type, reqList);
+			}
+			reqList.add(requirementDefinition);
+		}
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java
new file mode 100644
index 0000000..26fac7f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java
@@ -0,0 +1,361 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Map;
+import java.util.Set;
+
+import org.openecomp.sdc.ci.tests.datatypes.enums.ToscaKeysEnum;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaNodeTemplatesTopologyTemplateDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaSubstitutionMappingsDefinition;
+import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinition;
+import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.yaml.snakeyaml.TypeDescription;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.introspector.PropertyUtils;
+
+public class ToscaParserUtils {
+
+	private static Logger log = LoggerFactory.getLogger(ToscaParserUtils.class.getName());
+
+	public static ToscaDefinition parseToscaYamlToJavaObject(String csarUUID) throws Exception {
+		
+		ToscaDefinition toscaDefinition = null;
+		String TOSCAMetaLocation = "TOSCA-Metadata/TOSCA.meta";
+		Map<?, ?> map = getToscaYamlMap(csarUUID, TOSCAMetaLocation);
+		assertNotNull("Tosca Entry-Definitions is null", map);
+		if (map != null) {
+			File definitionYamlLocation = (File) map.get("Entry-Definitions");
+			toscaDefinition = parseToscaYamlToJavaObject(definitionYamlLocation);
+		}
+		return toscaDefinition;
+
+	}
+
+	public static ToscaDefinition parseToscaYamlToJavaObject(File path) throws Exception {
+
+		ToscaDefinition toscaDefinition = null;
+		
+//        File path = new File("C:/Data/D2.0/TOSCA_Ex/Definitions/tosca_definition_version.yaml");
+        FileInputStream fis = null;
+        try {
+        	fis = new FileInputStream(path);
+			
+		} catch (Exception e) {
+			System.out.println("Exception: " + e);
+		}
+        
+        Constructor constructor = getConstructor();
+    	
+        Yaml yaml = new Yaml(constructor);
+        try {
+        	toscaDefinition = (ToscaDefinition) yaml.load(fis);
+		} catch (Exception e) {
+			log.debug("Failed to parse tosca yaml file");
+			System.out.println("Exception: " + e);
+		} finally {
+			fis.close();
+		}
+        return toscaDefinition;
+        
+	}
+
+	public static ToscaDefinition parseToscaYamlPayloadToJavaObject(String payload){
+
+		ToscaDefinition toscaDefinition = null;
+        Constructor constructor = getConstructor();
+    	
+        Yaml yaml = new Yaml(constructor);
+        try {
+        	toscaDefinition = (ToscaDefinition) yaml.load(payload);
+		} catch (Exception e) {
+			log.debug("Failed to parse tosca yaml file");
+			System.out.println("Exception: " + e);
+		}
+        return toscaDefinition;
+        
+	}
+	
+	
+	public static Constructor getConstructor() {
+		Constructor constructor = new Constructor(ToscaDefinition.class);
+        constructor.addTypeDescription(ToscaDefinition.getTypeDescription());
+        constructor.addTypeDescription(ToscaTopologyTemplateDefinition.getTypeDescription());
+    	constructor.addTypeDescription(ToscaNodeTemplatesTopologyTemplateDefinition.getTypeDescription());
+    	constructor.addTypeDescription(ToscaGroupsTopologyTemplateDefinition.getTypeDescription());
+    	constructor.addTypeDescription(ToscaSubstitutionMappingsDefinition.getTypeDescription());
+    	
+//    	Skip properties which are found in YAML, but not found in POJO
+    	PropertyUtils propertyUtils = new PropertyUtils();
+    	propertyUtils.setSkipMissingProperties(true);
+    	constructor.setPropertyUtils(propertyUtils);
+		return constructor;
+	}
+
+	public static Map<?, ?> getToscaYamlMap(String csarUUID, String fileLocation) throws Exception {
+		String csarPayload = CsarValidationUtils.getCsarPayload(csarUUID, fileLocation);
+		if (csarPayload != null) {
+			Yaml yaml = new Yaml();
+			Map<?, ?> map = (Map<?, ?>) yaml.load(csarPayload);
+			return map;
+		}
+		return null;
+	}
+	
+/*	public static Map<?, ?> getToscaYamlMap(String csarUUID, String fileLocation) throws Exception {
+		String csarPayload = CsarValidationUtils.getCsarPayload(csarUUID, fileLocation);
+		if (csarPayload != null) {
+			Yaml yaml = new Yaml();
+			Map<?, ?> map = (Map<?, ?>) yaml.load(csarPayload);
+			return map;
+		}
+		return null;
+	}
+
+	public static ToscaDefinition getToscaDefinitionObjectByCsarUuid(String csarUUID) throws Exception {
+
+		String TOSCAMetaLocation = "TOSCA-Metadata/TOSCA.meta";
+		Map<?, ?> map = getToscaYamlMap(csarUUID, TOSCAMetaLocation);
+		assertNotNull("Tosca Entry-Definitions is null", map);
+		if (map != null) {
+			String definitionYamlLocation = (String) map.get("Entry-Definitions");
+			Map<?, ?> toscaMap = getToscaYamlMap(csarUUID, definitionYamlLocation);
+			assertNotNull("Tosca definition is null", toscaMap);
+			if (toscaMap != null) {
+				ToscaDefinition toscaDefinition = new ToscaDefinition();
+				Set<?> keySet = toscaMap.keySet();
+				for (Object key : keySet) {
+					ToscaKeysEnum toscaKey = ToscaKeysEnum.findToscaKey((String) key);
+					switch (toscaKey) {
+					case TOSCA_DEFINITION_VERSION:
+						getToscaDefinitionVersion(toscaMap, toscaDefinition);
+						break;
+					case NODE_TYPES:
+						getToscaNodeTypes(toscaMap, toscaDefinition);
+						break;
+					case TOPOLOGY_TEMPLATE:
+						getToscaTopologyTemplate(toscaMap, toscaDefinition);
+						break;
+					case IMPORTS:
+						// toscaMap.get("imports");
+						break;
+					default:
+						break;
+					}
+				}
+				return toscaDefinition;
+			}
+		}
+		return null;
+
+	}
+
+	public static void getToscaDefinitionVersion(Map<?, ?> toscaMap, ToscaDefinition toscaDefinition) {
+		if (toscaMap.get("tosca_definitions_version") != null) {
+			toscaDefinition.setTosca_definitions_version((String) toscaMap.get("tosca_definitions_version"));
+		}
+	}
+
+	// spec 90 page
+	public static void getToscaNodeTypes(Map<?, ?> toscaMap, ToscaDefinition toscaDefinition) {
+		@SuppressWarnings("unchecked")
+		Map<String, Map<String, String>> nodeTypes = (Map<String, Map<String, String>>) toscaMap.get("node_types");
+		Map<String, ToscaNodeTypesDefinition> listToscaNodeTypes = new HashMap<String, ToscaNodeTypesDefinition>();
+		if (nodeTypes != null) {
+			for (Map.Entry<String, Map<String, String>> entry : nodeTypes.entrySet()) {
+				ToscaNodeTypesDefinition toscaNodeTypes = new ToscaNodeTypesDefinition();
+				String toscaNodeName = entry.getKey();
+				toscaNodeTypes.setName(toscaNodeName);
+
+				Map<String, String> toscaNodeType = entry.getValue();
+				if (toscaNodeType != null) {
+					Set<Entry<String, String>> entrySet = toscaNodeType.entrySet();
+					if (entrySet != null) {
+						// boolean found = false;
+						for (Entry<String, String> toscaNodeTypeMap : entrySet) {
+							String key = toscaNodeTypeMap.getKey();
+							if (key.equals("derived_from")) {
+								String derivedFrom = toscaNodeTypeMap.getValue();
+								toscaNodeTypes.setDerived_from(derivedFrom);
+								// found = true;
+								break;
+							} else {
+								continue;
+							}
+
+						}
+						// if (found == false) {
+						// System.out.println("Tosca file not valid,
+						// derived_from not found");
+						// }
+					}
+
+				}
+//				listToscaNodeTypes.add(toscaNodeTypes);
+				listToscaNodeTypes.put(toscaNodeName, toscaNodeTypes);
+			}
+			toscaDefinition.setNode_types(listToscaNodeTypes);
+		}
+	}
+
+	public static void getToscaTopologyTemplate(Map<?, ?> toscaMap, ToscaDefinition toscaDefinition) {
+		ToscaTopologyTemplateDefinition toscaTopologyTemplate = new ToscaTopologyTemplateDefinition();
+		@SuppressWarnings("unchecked")
+		Map<String, Map<String, Object>> topologyTemplateMap = (Map<String, Map<String, Object>>) toscaMap.get("topology_template");
+//		List<ToscaNodeTemplatesTopologyTemplateDefinition> listToscaNodeTemplates = new ArrayList<>();
+		Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> mapToscaNodeTemplates = new HashMap<String, ToscaNodeTemplatesTopologyTemplateDefinition>();
+
+		if (topologyTemplateMap != null) {
+			getToscaNodeTemplates(topologyTemplateMap, mapToscaNodeTemplates);
+		}
+//		toscaTopologyTemplate.setToscaNodeTemplatesTopologyTemplateDefinition(listToscaNodeTemplates);
+		toscaTopologyTemplate.setNode_templates(mapToscaNodeTemplates);
+		toscaDefinition.setTopology_template(toscaTopologyTemplate);
+	}
+
+	public static void getToscaNodeTemplates(Map<String, Map<String, Object>> topologyTemplateMap, Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> mapToscaNodeTemplates) {
+		Map<String, Object> nodeTemplatesMap = topologyTemplateMap.get("node_templates");
+		if (nodeTemplatesMap != null) {
+
+			for (Entry<String, Object> nodeTemplates : nodeTemplatesMap.entrySet()) {
+				ToscaNodeTemplatesTopologyTemplateDefinition toscaNodeTemplates = new ToscaNodeTemplatesTopologyTemplateDefinition();
+				getToscaNodeTemplatesName(nodeTemplates, toscaNodeTemplates);
+
+				@SuppressWarnings("unchecked")
+				Map<String, Object> node = (Map<String, Object>) nodeTemplates.getValue();
+				getNodeTemplatesType(toscaNodeTemplates, node);
+				getToscaNodeTemplateProperties(toscaNodeTemplates, node);
+				getToscaNodeTemplateRequirements(toscaNodeTemplates, node);
+				mapToscaNodeTemplates.putAll(mapToscaNodeTemplates);
+			}
+		}
+	}
+
+	public static void getToscaNodeTemplateRequirements(ToscaNodeTemplatesTopologyTemplateDefinition toscaNodeTemplates, Map<String, Object> node) {
+////		List<ToscaRequirementsNodeTemplatesDefinition> toscaRequirements = new ArrayList<>();
+//		List<Map<String, ToscaRequirementsNodeTemplatesDefinition>> toscaRequirements = new ArrayList<>();
+//		if (node.get("requirements") != null) {
+//			@SuppressWarnings("unchecked")
+//			List<Map<String, Object>> requirementList = (List<Map<String, Object>>) node.get("requirements");
+//			for (int i = 0; i < requirementList.size(); i++) {
+//				for (Map.Entry<String, Object> requirement : requirementList.get(i).entrySet()) {
+//					ToscaRequirementsNodeTemplatesDefinition toscaRequirement = new ToscaRequirementsNodeTemplatesDefinition();
+//					if (requirement.getKey() != null) {
+//						String requirementName = requirement.getKey();
+//						toscaRequirement.setName(requirementName);
+//					} else {
+//						log.debug("Tosca file not valid, requirements should contain name");
+//					}
+//
+//					@SuppressWarnings("unchecked")
+//					Map<String, String> requirementMap = (Map<String, String>) requirement.getValue();
+//					Set<Entry<String, String>> entrySet = requirementMap.entrySet();
+//					if (entrySet != null) {
+//						for (Entry<String, String> requirementField : entrySet) {
+//							String key = requirementField.getKey();
+//							switch (key) {
+//							case "capability":
+//								if (requirementMap.get(key) != null) {
+//									String capability = (String) requirementMap.get(key);
+//									toscaRequirement.setCapability(capability);
+//									break;
+//								} else {
+//									continue;
+//								}
+//							case "node":
+//								if (requirementMap.get(key) != null) {
+//									String requirementNode = (String) requirementMap.get(key);
+//									toscaRequirement.setNode(requirementNode);
+//									break;
+//								} else {
+//									continue;
+//								}
+//							case "relationship":
+//								if (requirementMap.get(key) != null) {
+//									String relationship = (String) requirementMap.get(key);
+//									toscaRequirement.setRelationship(relationship);
+//									break;
+//								} else {
+//									continue;
+//								}
+//							default:
+//								break;
+//							}
+//						}
+//					}
+////					toscaRequirements.add(toscaRequirement);
+//					toscaRequirements.add(requirementMap);
+//				}
+//			}
+//		}
+////		toscaNodeTemplates.setRequirements(toscaRequirements);
+//		toscaNodeTemplates.setRequirements(requirements);
+		
+	}
+
+	public static void getToscaNodeTemplateProperties(ToscaNodeTemplatesTopologyTemplateDefinition toscaNodeTemplates,
+			Map<String, Object> node) {
+//		List<ToscaPropertiesNodeTemplatesDefinition> listToscaProperties = new ArrayList<>();
+		Map<String, Object> mapToscaProperties = new HashMap<>();
+		if (node.get("properties") != null) {
+			@SuppressWarnings("unchecked")
+			Map<String, Object> properties = (Map<String, Object>) node.get("properties");
+			for (Map.Entry<String, Object> property : properties.entrySet()) {
+				ToscaPropertiesNodeTemplatesDefinition toscaProperty = new ToscaPropertiesNodeTemplatesDefinition();
+				String propertyName = property.getKey();
+				Object propertyValue = property.getValue();
+				toscaProperty.setName(propertyName);
+				toscaProperty.setValue(propertyValue);
+//				mapToscaProperties.add(toscaProperty);
+				mapToscaProperties.put(propertyName, propertyValue);
+			}
+		}
+		toscaNodeTemplates.setProperties(mapToscaProperties);
+	}
+
+	protected static void getNodeTemplatesType(ToscaNodeTemplatesTopologyTemplateDefinition toscaNodeTemplates,
+			Map<String, Object> node) {
+		if (node.get("type") != null) {
+			String type = (String) node.get("type");
+			toscaNodeTemplates.setType(type);
+		} else {
+			log.debug("Tosca file not valid, nodeTemplate should contain type");
+		}
+	}
+
+	protected static void getToscaNodeTemplatesName(Entry<String, Object> nodeTemplates,
+			ToscaNodeTemplatesTopologyTemplateDefinition toscaNodeTemplates) {
+		String name = nodeTemplates.getKey();
+		toscaNodeTemplates.setName(name);
+	}*/
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
new file mode 100644
index 0000000..3515191
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
@@ -0,0 +1,689 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.common.api.ToscaNodeTypeInfo;
+import org.openecomp.sdc.common.api.YamlConstants;
+import org.yaml.snakeyaml.Yaml;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public final class Utils {
+
+	Gson gson = new Gson();
+
+	static Logger logger = Logger.getLogger(Utils.class.getName());
+
+	String contentTypeHeaderData = "application/json";
+	String acceptHeaderDate = "application/json";
+
+	public Utils() {
+		/*
+		 * super();
+		 * 
+		 * StartTest.enableLogger(); logger =
+		 * Logger.getLogger(Utils.class.getName());
+		 */
+
+	}
+
+	// public String serviceTopologyPattern = "/topology/topology/%s";
+	// public String serviceTopologyTemplatePattern =
+	// "/topologytemplate/topologytemplate/%s";
+	//
+	// public String serviceTopologySearchPattern =
+	// "topology/topology/_search?q=%s";
+	// public String serviceTopologyTemplateSearchPattern =
+	// "topologytemplate/topologytemplate/_search?q=%s";
+	//
+	// public ArtifactTypeEnum getFileTypeByExtension(String fileName) {
+	//
+	// String fileExtension = null;
+	// if (fileName.matches("(.*)\\.(.*)")) {
+	// System.out.println(fileName.substring(fileName.lastIndexOf(".") + 1));
+	// fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
+	// }
+	//
+	// switch (fileExtension) {
+	// case "sh":
+	// return ArtifactTypeEnum.SHELL_SCRIPT;
+	// case "png":
+	// return ArtifactTypeEnum.ICON;
+	// case "ppp":
+	// return ArtifactTypeEnum.PUPPET;
+	// case "yang":
+	// return ArtifactTypeEnum.YANG;
+	// default:
+	// return ArtifactTypeEnum.UNKNOWN;
+	// }
+	//
+	// }
+	//
+	// public ArrayList<String> getScriptList (List<UploadArtifactInfo>
+	// artifactsList){
+	//
+	// ArrayList<String> scriptNameArray = new ArrayList<>();
+	// if (artifactsList != null){
+	// for (UploadArtifactInfo fileInArtifactsList : artifactsList){
+	// String artifactFileName = fileInArtifactsList.getArtifactName();
+	// ArtifactTypeEnum artifactFileType =
+	// fileInArtifactsList.getArtifactType();
+	// if (! artifactFileType.equals(ArtifactTypeEnum.ICON)){
+	// scriptNameArray.add(artifactFileName);
+	// }
+	// continue;
+	// }
+	// return scriptNameArray;
+	// }
+	// return null;
+	// }
+	//
+	//
+	// public String getYamlFileLocation(File testResourcesPath) {
+	// File[] files = testResourcesPath.listFiles();
+	// if (files.length == 0){
+	// return null;
+	// }else{
+	// for (int i = 0; i < files.length; i++){
+	// if (files[i].isFile()){
+	// return files[i].getAbsoluteFile().toString();
+	// }
+	// }
+	// }
+	// return null;
+	// }
+	//
+	// public String readFileContentToString (String fileName) throws
+	// IOException {
+	//
+	// Path path = Paths.get(fileName);
+	// String stringFromFile = new String(Files.readAllBytes(path));
+	// return stringFromFile;
+	//
+	//
+	// }
+	//
+	@SuppressWarnings("unchecked")
+	public ToscaNodeTypeInfo parseToscaNodeYaml(String fileContent) {
+
+		ToscaNodeTypeInfo result = new ToscaNodeTypeInfo();
+		Object templateVersion = null;
+		Object templateName = null;
+
+		if (fileContent != null) {
+			Yaml yaml = new Yaml();
+
+			Map<String, Object> yamlObject = (Map<String, Object>) yaml.load(fileContent);
+
+			templateVersion = yamlObject.get(YamlConstants.TEMPLATE_VERSION);
+			if (templateVersion != null) {
+				result.setTemplateVersion(templateVersion.toString());
+			}
+			templateName = yamlObject.get(YamlConstants.TEMPLATE_NAME);
+			if (templateName != null) {
+				result.setTemplateName(templateName.toString());
+			}
+			Object nodeTypes = yamlObject.get(YamlConstants.NODE_TYPES);
+
+			if (nodeTypes != null) {
+				Map<String, Object> nodeTypesMap = (Map<String, Object>) nodeTypes;
+				for (Entry<String, Object> entry : nodeTypesMap.entrySet()) {
+
+					String nodeName = entry.getKey();
+					if (nodeName != null) {
+						result.setNodeName(nodeName);
+					}
+
+					break;
+
+				}
+			}
+
+		}
+
+		return result;
+	}
+
+	//
+	//
+	// public ArtifactsMetadata getArtifactsMetadata(String response){
+	// ArtifactsMetadata artifactsMetadata = new ArtifactsMetadata();
+	//
+	// artifactsMetadata.setId(getJsonObjectValueByKey(response, "id"));
+	// artifactsMetadata.setName(getJsonObjectValueByKey(response, "name"));
+	// artifactsMetadata.setType(getJsonObjectValueByKey(response, "type"));
+	//
+	// artifactsMetadata.setCreator(getJsonObjectValueByKey(response,
+	// "creator"));
+	// artifactsMetadata.setCreationTime(getJsonObjectValueByKey(response,
+	// "creationTime"));
+	// artifactsMetadata.setLastUpdateTime(getJsonObjectValueByKey(response,
+	// "lastUpdateTime"));
+	// artifactsMetadata.setChecksum(getJsonObjectValueByKey(response,
+	// "checksum"));
+	// artifactsMetadata.setDescription(getJsonObjectValueByKey(response,
+	// "description"));
+	// artifactsMetadata.setLastUpdater(getJsonObjectValueByKey(response,
+	// "lastUpdater"));
+	//
+	// return artifactsMetadata;
+	// }
+	//
+	public static String getJsonObjectValueByKey(String metadata, String key) {
+		JsonElement jelement = new JsonParser().parse(metadata);
+
+		JsonObject jobject = jelement.getAsJsonObject();
+		Object obj = jobject.get(key);
+		if (obj == null) {
+			return null;
+		} else {
+			String value;
+			value = (String) jobject.get(key).getAsString();
+			return value;
+		}
+	}
+
+	public static Config getConfig() throws FileNotFoundException {
+		Config config = Config.instance();
+		return config;
+	}
+
+	// public void uploadNormativeTypes() throws IOException{
+	// Config config = getConfig();
+	// String[] normativeTypes = {"root", "compute", "blockStorage",
+	// "softwareComponent", "DBMS", "database", "network", "objectStorage",
+	// "webServer", "webApplication"};
+	// for( String normativeType : normativeTypes ){
+	// uploadComponent(config.getComponentsConfigDir()+File.separator+"normativeTypes"+File.separator+normativeType);
+	// }
+	//
+	// }
+	//
+	// public void uploadApacheComponent() throws IOException{
+	// Config config = getConfig();
+	// uploadComponent(config.getComponentsConfigDir()+File.separator+"apache");
+	// }
+	//
+	// public void uploadComponent(String componentDir) throws IOException{
+	//
+	// //*********************************************upload*************************************************************
+	// Config config = getConfig();
+	// ZipDirectory zipDirectory = new ZipDirectory();
+	// System.out.println(config.getEsHost());
+	//
+	// List<UploadArtifactInfo> artifactsList = new
+	// ArrayList<UploadArtifactInfo>();
+	//
+	//// read test resources and zip it as byte array
+	// byte[] zippedAsByteArray = zipDirectory.zip(componentDir, artifactsList);
+	//
+	//// encode zipped directory using base64
+	// String payload = Decoder.encode(zippedAsByteArray);
+	//
+	//// zip name build as testName with ".zip" extension
+	// String payloadZipName = getPayloadZipName(componentDir);
+	//
+	//// build json
+	// UploadResourceInfo resourceInfo = new UploadResourceInfo(payload,
+	// payloadZipName, "description", "category/mycategory", null,
+	// artifactsList);
+	// String json = new Gson().toJson(resourceInfo);
+	//
+	//// calculate md5 on the content of json
+	// String jsonMd5 =
+	// org.apache.commons.codec.digest.DigestUtils.md5Hex(json);
+	//
+	//// encode the md5 to base64, sent as header in post http request
+	// String encodedMd5 = Decoder.encode(jsonMd5.getBytes());
+	//
+	//// upload component to Elastic Search DB
+	// String url = null;
+	// HttpRequest http = new HttpRequest();
+	//
+	// url = String.format(Urls.UPLOAD_ZIP_URL, config.getCatalogFeHost(),
+	// config.getCatalogFePort());
+	//
+	//// Prepare headers to post upload component request
+	// HeaderData headerData = new HeaderData(encodedMd5, "application/json",
+	// "att", "test", "testIvanovich", "RoyalSeal", "Far_Far_Away",
+	// "getResourceArtifactListTest");
+	//
+	// MustHeaders headers = new MustHeaders(headerData);
+	// System.out.println("headers:"+headers.getMap());
+	//
+	// RestResponse response = http.httpSendPost(url, json, headers.getMap());
+	//
+	// assertEquals("upload component failed with code " +
+	// response.getErrorCode().intValue(),response.getErrorCode().intValue(),
+	// 204);
+	// }
+	//
+	// private String getPayloadZipName(String componentDir) {
+	// String payloadName;
+	// if( componentDir.contains( File.separator) ){
+	// String delimiter = null;
+	// if( File.separator.equals("\\")){
+	// delimiter ="\\\\";
+	// }
+	// else{
+	// delimiter = File.separator;
+	// }
+	// String[] split = componentDir.split(delimiter);
+	// payloadName = split[split.length-1];
+	// }
+	// else{
+	// payloadName = componentDir;
+	// }
+	// return payloadName+".zip";
+	// }
+	//
+	//
+	//
+	// public List<UploadArtifactInfo> createArtifactsList(String srcDir) {
+	//
+	// List<UploadArtifactInfo> artifactsList = new
+	// ArrayList<UploadArtifactInfo>();
+	// File srcFile = new File(srcDir);
+	// addFileToList(srcFile, artifactsList);
+	//
+	// return artifactsList;
+	// }
+	//
+	// public void addFileToList(File srcFile, List<UploadArtifactInfo>
+	// artifactsList) {
+	//
+	// File[] files = srcFile.listFiles();
+	//
+	// for (int i = 0; i < files.length; i++) {
+	// // if the file is directory, use recursion
+	// if (files[i].isDirectory()) {
+	// addFileToList(files[i], artifactsList);
+	// continue;
+	// }
+	//
+	// String fileName = files[i].getName();
+	// String artifactPath = fileName;
+	//
+	// if ( ! files[i].getName().matches("(.*)\\.y(?)ml($)")) {
+	// UploadArtifactInfo uploadArtifactInfo = new UploadArtifactInfo();
+	// uploadArtifactInfo.setArtifactName(files[i].getName());
+	// String parent = files[i].getParent();
+	//
+	// if (parent != null) {
+	// System.out.println(parent);
+	// int lastSepartor = parent.lastIndexOf(File.separator);
+	// if (lastSepartor > -1) {
+	// String actualParent = parent.substring(lastSepartor + 1);
+	// artifactPath = actualParent + "/" + artifactPath;
+	// }
+	// }
+	//
+	// uploadArtifactInfo.setArtifactPath(artifactPath);
+	// uploadArtifactInfo.setArtifactType(getFileTypeByExtension(fileName));
+	// uploadArtifactInfo.setArtifactDescription("description");
+	// artifactsList.add(uploadArtifactInfo);
+	//
+	// System.out.println("artifact list: " + artifactsList);
+	//
+	// }
+	//
+	// }
+	// }
+	//
+	//
+	// public String buildArtifactListUrl (String nodesType, String
+	// templateVersion, String artifactName) throws FileNotFoundException{
+	// //"http://172.20.43.132/sdc2/v1/catalog/resources/tosca.nodes.Root/1.0.0.wd03-SNAPSHOT/artifacts/wxs_baseline_compare.sh"
+	// Config config = getConfig();
+	// return "\"http://" + config.getCatalogBeHost() + ":" +
+	// config.getCatalogBePort() + "/sdc2/v1/catalog/resources/" +nodesType +
+	// "/" + templateVersion + "/artifacts/" + artifactName +"\"";
+	// }
+	//
+	//
+	// public void addTopologyToES(String testFolder, String
+	// serviceTopologyPattern) throws IOException{
+	// Config config = getConfig();
+	// String url = String.format(Urls.ES_URL, config.getEsHost(),
+	// config.getEsPort()) + serviceTopologyPattern;
+	// String sourceDir =
+	// config.getResourceConfigDir()+File.separator+testFolder;
+	// Path filePath = FileSystems.getDefault().getPath(sourceDir,
+	// "topology.txt");
+	// postFileContentsToUrl(url, filePath);
+	// }
+	//
+	// public void addTopologyTemplateToES(String testFolder, String
+	// serviceTopologyTemplatePattern) throws IOException{
+	// Config config = getConfig();
+	// String url = String.format(Urls.ES_URL, config.getEsHost(),
+	// config.getEsPort()) + serviceTopologyTemplatePattern;
+	// String sourceDir =
+	// config.getResourceConfigDir()+File.separator+testFolder;
+	// Path filePath = FileSystems.getDefault().getPath(sourceDir,
+	// "topologyTemplate.txt");
+	// postFileContentsToUrl(url, filePath);
+	// }
+	//
+	//
+	// public void postFileContentsToUrl(String url, Path filePath) throws
+	// IOException {
+	// HttpClientContext localContext = HttpClientContext.create();
+	// CloseableHttpResponse response = null;
+	//
+	// byte[] fileContent = Files.readAllBytes(filePath);
+	//
+	// try(CloseableHttpClient httpClient = HttpClients.createDefault()){
+	// HttpPost httpPost = new HttpPost(url);
+	// StringEntity entity = new StringEntity(new String(fileContent) ,
+	// ContentType.APPLICATION_JSON);
+	// httpPost.setEntity(entity);
+	// response = httpClient.execute(httpPost, localContext);
+	//
+	// }
+	// finally{
+	// response.close();
+	// }
+	//
+	//
+	// }
+	//
+	//
+	//// public boolean isPatternInEsDb(String patternToSearch)throws
+	// IOException{
+	//// Config config = getConfig();
+	//// String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES,
+	// config.getEsHost(), config.getEsPort(),patternToSearch);
+	//// HttpRequest httpRequest = new HttpRequest();
+	//// RestResponse restResponse = httpRequest.httpSendGet(url);
+	//// if (restResponse.getErrorCode() == 200){
+	//// return true;
+	//// }
+	//// if (restResponse.getErrorCode() == 404){
+	//// return false;
+	//// }
+	////
+	//// return false;
+	//// }
+	//
+	// public static RestResponse deleteAllDataFromEs() throws IOException{
+	// return deleteFromEsDbByPattern("_all");
+	// }
+	//
+
+	//
+	// public List<String> buildIdArrayListByTypesIndex (String index, String
+	// types) throws IOException{
+	//
+	// Config config = getConfig();
+	// HttpRequest http = new HttpRequest();
+	// RestResponse getResponce =
+	// http.httpSendGet(String.format(Urls.GET_ID_LIST_BY_INDEX_FROM_ES,
+	// config.getEsHost(), config.getEsPort(), index, types), null);
+	//
+	// List <String> idArray = new ArrayList<String>();
+	//
+	// JsonElement jelement = new JsonParser().parse(getResponce.getResponse());
+	// JsonObject jobject = jelement.getAsJsonObject();
+	// JsonObject hitsObject = (JsonObject) jobject.get("hits");
+	// JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
+	// for (int i = 0; i < hitsArray.size(); i ++){
+	// JsonObject idObject = (JsonObject) hitsArray.get(i);
+	// String id = idObject.get("_id").toString();
+	// id = id.replace("\"", "");
+	// idArray.add(id);
+	// }
+	//
+	// return idArray;
+	// }
+	//
+	// public List<String> buildCategoriesTagsListFromJson(String
+	// categoriesTagsJson){
+	//
+	// ArrayList<String> categoriesTagsArray = new ArrayList<>();
+	// JsonElement jelement = new JsonParser().parse(categoriesTagsJson);
+	// JsonArray jArray = jelement.getAsJsonArray();
+	// for (int i = 0; i < jArray.size(); i ++){
+	// JsonObject categoriesTagsObject = (JsonObject) jArray.get(i);
+	// String categories = categoriesTagsObject.get("name").toString();
+	// categoriesTagsArray.add(categories);
+	// }
+	//
+	// return categoriesTagsArray;
+	// }
+	//
+	// public ArrayList <String> getCategoriesFromDb() throws Exception{
+	//
+	// ArrayList<String> categoriesFromDbArrayList = new ArrayList<>();
+	// RestResponse restResponse = new RestResponse();
+	// String contentTypeHeaderData = "application/json";
+	// String acceptHeaderDate = "application/json";
+	//
+	// Map<String, String> headersMap = new HashMap<String,String>();
+	// headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(),contentTypeHeaderData);
+	// headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+	//
+	// HttpRequest httpRequest = new HttpRequest();
+	// String url = String.format(Urls.QUERY_NEO4J,
+	// Config.instance().getNeoHost(), Config.instance().getNeoPort());
+	// String body = "{\"statements\" : [ { \"statement\" : \"MATCH
+	// (category:category) return (category)\"} ]}";
+	// restResponse = httpRequest.httpSendPostWithAuth(url, body, headersMap,
+	// Config.instance().getNeoDBusername(),
+	// Config.instance().getNeoDBpassword());
+	//
+	// if (restResponse.getResponse()==null){
+	// return categoriesFromDbArrayList;
+	// }else{
+	// JsonElement jelement = new
+	// JsonParser().parse(restResponse.getResponse());
+	// JsonObject jobject = jelement.getAsJsonObject();
+	// JsonArray resultsArray = (JsonArray) jobject.get("results");
+	// JsonObject resObject = (JsonObject) resultsArray.get(0);
+	// JsonArray dataArray = (JsonArray) resObject.get("data");
+	// for (int i = 0; i < dataArray.size(); i ++){
+	// JsonObject rowObject = (JsonObject) dataArray.get(i);
+	// JsonArray rowArray = (JsonArray) rowObject.get("row");
+	// JsonObject nameObject = (JsonObject) rowArray.get(0);
+	// String name = nameObject.get("name").toString();
+	//// name = name.replace("\"", "");
+	// categoriesFromDbArrayList.add(name);
+	// }
+	//
+	//
+	// }
+	//
+	// return categoriesFromDbArrayList;
+	// }
+	//
+	public static void compareArrayLists(List<String> actualArraylList, List<String> expectedArrayList,
+			String message) {
+
+		ArrayList<String> actual = new ArrayList<String>(actualArraylList);
+		ArrayList<String> expected = new ArrayList<String>(expectedArrayList);
+		// assertEquals(message + " count got by rest API not match to " +
+		// message + " expected count", expected.size(),actual.size());
+		expected.removeAll(actual);
+		assertEquals(message + " content got by rest API not match to " + message + " actual content", 0,
+				expected.size());
+	}
+
+	public static Object parseYamlConfig(String pattern) throws FileNotFoundException {
+
+		Yaml yaml = new Yaml();
+		Config config = getConfig();
+		String configurationFile = config.getConfigurationFile();
+		File file = new File(configurationFile);
+		// File file = new
+		// File("../catalog-be/src/main/resources/config/configuration.yaml");
+		InputStream inputStream = new FileInputStream(file);
+		Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream);
+		Object patternMap = (Object) map.get(pattern);
+
+		return patternMap;
+	}
+
+	public static String getDepArtLabelFromConfig(ArtifactTypeEnum artifactTypeEnum) throws FileNotFoundException {
+
+		@SuppressWarnings("unchecked")
+		Map<String, Object> mapOfDepResArtTypesObjects = (Map<String, Object>) parseYamlConfig(
+				"deploymentResourceArtifacts");
+		for (Map.Entry<String, Object> iter : mapOfDepResArtTypesObjects.entrySet()) {
+			if (iter.getValue().toString().contains(artifactTypeEnum.getType())) {
+				return iter.getKey().toLowerCase();
+			}
+		}
+
+		return "defaultLabelName";
+	}
+
+	
+	public static String multipleChar(String ch, int repeat) {
+		return StringUtils.repeat(ch, repeat);
+	}
+	
+	public static List<String> getListOfDepResArtLabels(Boolean isLowerCase) throws FileNotFoundException {
+
+		List<String> listOfResDepArtTypesFromConfig = new ArrayList<String>();
+		@SuppressWarnings("unchecked")
+		Map<String, Object> resourceDeploymentArtifacts = (Map<String, Object>) parseYamlConfig(
+				"deploymentResourceArtifacts");
+		if (resourceDeploymentArtifacts != null) {
+
+			if (isLowerCase) {
+				for (Map.Entry<String, Object> iter : resourceDeploymentArtifacts.entrySet()) {
+					listOfResDepArtTypesFromConfig.add(iter.getKey().toLowerCase());
+				}
+			} else {
+
+				for (Map.Entry<String, Object> iter : resourceDeploymentArtifacts.entrySet()) {
+					listOfResDepArtTypesFromConfig.add(iter.getKey());
+				}
+			}
+		}
+		return listOfResDepArtTypesFromConfig;
+	}
+
+	public static List<String> getListOfToscaArtLabels(Boolean isLowerCase) throws FileNotFoundException {
+
+		List<String> listOfToscaArtTypesFromConfig = new ArrayList<String>();
+		@SuppressWarnings("unchecked")
+		Map<String, Object> toscaArtifacts = (Map<String, Object>) parseYamlConfig("toscaArtifacts");
+		if (toscaArtifacts != null) {
+
+			if (isLowerCase) {
+				for (Map.Entry<String, Object> iter : toscaArtifacts.entrySet()) {
+					listOfToscaArtTypesFromConfig.add(iter.getKey().toLowerCase());
+				}
+			} else {
+				for (Map.Entry<String, Object> iter : toscaArtifacts.entrySet()) {
+					listOfToscaArtTypesFromConfig.add(iter.getKey());
+				}
+			}
+		}
+		return listOfToscaArtTypesFromConfig;
+	}
+
+	//
+	// public static List<String> getListOfResDepArtTypes() throws
+	// FileNotFoundException {
+	//
+	// List<String> listOfResDepArtTypesFromConfig = new ArrayList<String>();
+	// @SuppressWarnings("unchecked")
+	// Map<String, Object> resourceDeploymentArtifacts = (Map<String, Object>)
+	// parseYamlConfig("resourceDeploymentArtifacts");
+	// for (Map.Entry<String, Object> iter :
+	// resourceDeploymentArtifacts.entrySet()) {
+	// listOfResDepArtTypesFromConfig.add(iter.getKey());
+	// }
+	//
+	// return listOfResDepArtTypesFromConfig;
+	// }
+	//
+	// public static List<String> getListOfDepResInstArtTypes() throws
+	// FileNotFoundException {
+	//
+	// List<String> listOfResInstDepArtTypesFromConfig = new
+	// ArrayList<String>();
+	// @SuppressWarnings("unchecked")
+	// Map<String, Object> resourceDeploymentArtifacts = (Map<String, Object>)
+	// parseYamlConfig("deploymentResourceInstanceArtifacts");
+	// for (Map.Entry<String, Object> iter :
+	// resourceDeploymentArtifacts.entrySet()) {
+	// listOfResInstDepArtTypesFromConfig.add(iter.getKey().toLowerCase());
+	// }
+	//
+	// return listOfResInstDepArtTypesFromConfig;
+	// }
+	//
+	public static List<String> getListOfResPlaceHoldersDepArtTypes() throws FileNotFoundException {
+		List<String> listResDepArtTypesFromConfig = new ArrayList<String>();
+		List<String> listOfResDepArtLabelsFromConfig = getListOfDepResArtLabels(false);
+		assertNotNull("deployment artifact types list is null", listOfResDepArtLabelsFromConfig);
+		Object parseYamlConfig = Utils.parseYamlConfig("deploymentResourceArtifacts");
+		Map<String, Object> mapOfDepResArtTypesObjects = (Map<String, Object>) Utils
+				.parseYamlConfig("deploymentResourceArtifacts");
+
+		// assertNotNull("deployment artifact types list is null",
+		// mapOfDepResArtTypesObjects);
+		if (listOfResDepArtLabelsFromConfig != null) {
+			for (String resDepArtType : listOfResDepArtLabelsFromConfig) {
+				Object object = mapOfDepResArtTypesObjects.get(resDepArtType);
+				if (object instanceof Map<?, ?>) {
+					Map<String, Object> map = (Map<String, Object>) object;
+					listResDepArtTypesFromConfig.add((String) map.get("type"));
+				} else {
+					assertTrue("return object does not instance of map", false);
+				}
+			}
+		}
+		return listResDepArtTypesFromConfig;
+	}
+
+	public static Long getEpochTimeFromUTC(String time) throws ParseException {
+	    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS zzz");
+	    java.util.Date date = df.parse(time);
+	    long epoch = date.getTime();
+	    return epoch;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java
new file mode 100644
index 0000000..e89c6be
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java
@@ -0,0 +1,220 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.cassandra;
+
+import com.datastax.driver.core.*;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.datastax.driver.core.querybuilder.Select;
+import com.datastax.driver.core.querybuilder.Select.Where;
+
+import org.javatuples.Pair;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public final class CassandraUtils {
+	private static Logger logger = LoggerFactory.getLogger(CassandraUtils.class.getName());
+
+	protected static Cluster cluster = null;
+	protected static Session session;
+
+	protected static void initConnection(String keyspace) throws FileNotFoundException {
+
+		String cassandraHost = Utils.getConfig().getCassandraHost();
+		Boolean cassandraAuthenticate = Utils.getConfig().getCassandraAuthenticate();
+		String cassandraUsername = Utils.getConfig().getCassandraUsername();
+		String cassandraPassword = Utils.getConfig().getCassandraPassword();
+		Boolean cassandraSsl = Utils.getConfig().getCassandraSsl();
+		String cassandraTruststorePath = Utils.getConfig().getCassandraTruststorePath();
+		String cassandraTruststorePassword = Utils.getConfig().getCassandraTruststorePassword();
+		/*
+		 * String cassandraAuditKeySpace=
+		 * Utils.getConfig().getCassandraAuditKeySpace(); String
+		 * cassandraArtifactKeySpace=
+		 * Utils.getConfig().getCassandraArtifactKeySpace();
+		 */
+
+		Cluster.Builder clusterBuilder = Cluster.builder().addContactPoint(cassandraHost);
+		if (cassandraAuthenticate) {
+			// authantication
+			clusterBuilder.withCredentials(cassandraUsername, cassandraPassword);
+		}
+
+		if (cassandraSsl) {
+			// ssl
+			System.setProperty("javax.net.ssl.trustStore", cassandraTruststorePath);
+			System.setProperty("javax.net.ssl.trustStorePassword", cassandraTruststorePassword);
+			clusterBuilder.withSSL();
+		}
+
+		cluster = clusterBuilder.build();
+		session = cluster.connect(keyspace);
+
+	}
+
+	public static void truncateTable(String keyspace, String tableName) throws FileNotFoundException {
+
+		if (session == null || session.isClosed()) {
+			initConnection(keyspace);
+		}
+
+		try {
+
+			if (session != null) {
+				session.execute(QueryBuilder.truncate(keyspace, tableName));
+				logger.debug("The table {}.{} was cleaned",keyspace,tableName);
+			} else {
+				throw new RuntimeException("Keyspace " + keyspace + " not connected");
+			}
+		} finally {
+			// if (cluster != null) {
+			// cluster.close();
+			// }
+		}
+	}
+
+	public static void close() {
+		if (cluster != null) {
+			cluster.close();
+		}
+	}
+
+	public static void truncateAllKeyspaces() throws FileNotFoundException {
+		// truncateAllTables(AuditingTypesConstants.ARTIFACT_KEYSPACE);
+		truncateAllTables(AuditingTypesConstants.AUDIT_KEYSPACE);
+	}
+
+	public static void truncateAllTables(String keyspace) throws FileNotFoundException {
+
+		if (session == null || session.isClosed()) {
+			initConnection(keyspace);
+		}
+		try {
+
+			if (session != null) {
+				Metadata metadata = cluster.getMetadata();
+				KeyspaceMetadata keyspaceMetadata = metadata.getKeyspace(keyspace);
+				if (keyspaceMetadata != null) {
+					Collection<TableMetadata> tables = keyspaceMetadata.getTables();
+					tables.forEach(table -> {
+						session.execute(QueryBuilder.truncate(table));
+						logger.debug("Table trunceted - {}", table.getName());
+					});
+				}
+			} else {
+				throw new RuntimeException("Keyspace " + keyspace + " not connected");
+			}
+
+		} finally {
+			// if (cluster != null) {
+			// cluster.close();
+			// }
+		}
+	}
+
+	public static List<Row> fetchFromTable(String keyspace, String tableName,
+			List<Pair<AuditingFieldsKeysEnum, String>> fields) throws FileNotFoundException {
+
+		List<Pair<String, String>> fieldsConverted = new ArrayList<>();
+
+//		fields.forEach(pair -> {
+//			Pair<String, String> newPair = new Pair(pair.getValue0().getDisplayName(), pair.getValue1());
+//			fieldsConverted.add(newPair);
+//		});
+		
+		fields.forEach(pair ->{
+			Pair<String, String> newPair;
+			if(pair.getValue0() == AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL ){
+			newPair = new Pair<String, String>("RESOURE_URL", pair.getValue1());
+			
+		}else{
+			newPair = new Pair<String, String>(pair.getValue0().getDisplayName(), pair.getValue1());
+		}
+		fieldsConverted.add(newPair);
+			
+		});
+
+		return fetchFromTableQuery(keyspace, tableName, fieldsConverted);
+	}
+
+	public static List<Row> fetchFromTableQuery(String keyspace, String tableName, List<Pair<String, String>> fields)
+			throws FileNotFoundException {
+
+		if (session == null || session.isClosed()) {
+			initConnection(keyspace);
+		}
+		try {
+
+			if (session != null) {
+				Select select = QueryBuilder.select().all().from(keyspace, tableName);
+				if (fields != null) {
+					// Set<Entry<AuditingFieldsKeysEnum, String>> entrySet =
+					// fields.entrySet();
+					// fields.
+					boolean multiple = (fields.size() > 1) ? true : false;
+					Where where = null;
+					int size = 0;
+
+					for (Pair<String, String> pair : fields) {
+						++size;
+						if (size == 1) {
+							where = select.where(QueryBuilder.eq(pair.getValue0(), pair.getValue1()));
+						} else {
+							where.and(QueryBuilder.eq(pair.getValue0(), pair.getValue1()));
+						}
+					}
+					if (multiple) {
+						select.allowFiltering();
+					}
+
+				}
+
+				List<Row> rows = session.execute(select).all();
+				for (Row row : rows) {
+					logger.debug("{}", row);
+				}
+				return rows;
+			}
+		} finally {
+			// if (cluster != null) {
+			// cluster.close();
+			// }
+		}
+		return null;
+	}
+	//
+	// public static void main(String[] args) throws FileNotFoundException {
+	// Map<AuditingFieldsKeysEnum, String> map = new HashMap<>();
+	// map.put(AuditingFieldsKeysEnum.AUDIT_ACTION, "Access");
+	// map.put(AuditingFieldsKeysEnum.AUDIT_STATUS, "200");
+	// // CassandraUtils.truncateTable("sdcartifact", "resources");
+	//// CassandraUtils.truncateAllTables("sdcaudit");
+	// CassandraUtils.fetchFromTable("sdcaudit", "useraccessevent", map );
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java
new file mode 100644
index 0000000..0243896
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java
@@ -0,0 +1,166 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.cassandra;
+
+import com.datastax.driver.core.*;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.datastax.driver.core.querybuilder.Select;
+import com.datastax.driver.core.querybuilder.Select.Where;
+import org.javatuples.Pair;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.FileNotFoundException;
+import java.util.Collection;
+import java.util.List;
+
+public final class CassandraUtils2 {
+	private static Logger logger = LoggerFactory.getLogger(CassandraUtils2.class.getName());
+
+	public static void truncateTable(String keyspace, String tableName) throws FileNotFoundException {
+
+		String cassandraHost = Utils.getConfig().getCassandraHost();
+
+		Cluster cluster = null;
+		Session session;
+
+		try {
+			Cluster.Builder clusterBuilder = Cluster.builder().addContactPoint(cassandraHost);
+			// authantication
+			// clusterBuilder.withCredentials(username,password);
+			// ssl
+			// System.setProperty("javax.net.ssl.trustStore",truststorePath);
+			// System.setProperty("javax.net.ssl.trustStorePassword",truststorePassword);
+			// clusterBuilder.withSSL();
+			cluster = clusterBuilder.build();
+			session = cluster.connect(keyspace);
+			if (session != null) {
+				session.execute(QueryBuilder.truncate(keyspace, tableName));
+				logger.debug("The table {}.{} was cleaned",keyspace,tableName);
+			} else {
+				throw new RuntimeException("Keyspace " + keyspace + " not connected");
+			}
+		} finally {
+			if (cluster != null) {
+				cluster.close();
+			}
+		}
+	}
+
+	public static void truncateAllKeyspaces() throws FileNotFoundException {
+		truncateAllTables(AuditingTypesConstants.ARTIFACT_KEYSPACE);
+		truncateAllTables(AuditingTypesConstants.AUDIT_KEYSPACE);
+	}
+
+	public static void truncateAllTables(String keyspace) throws FileNotFoundException {
+		String cassandraHost = Utils.getConfig().getCassandraHost();
+
+		Cluster cluster = null;
+		Session session;
+
+		try {
+			cluster = Cluster.builder().addContactPoint(cassandraHost).build();
+			session = cluster.connect(keyspace);
+			if (session != null) {
+				Metadata metadata = cluster.getMetadata();
+				KeyspaceMetadata keyspaceMetadata = metadata.getKeyspace(keyspace);
+				if (keyspaceMetadata != null) {
+					Collection<TableMetadata> tables = keyspaceMetadata.getTables();
+					tables.forEach(table -> {
+						session.execute(QueryBuilder.truncate(table));
+						logger.debug("Table trunceted - {}", table.getName());
+					});
+				}
+			} else {
+				throw new RuntimeException("Keyspace " + keyspace + " not connected");
+			}
+
+		} finally {
+			if (cluster != null) {
+				cluster.close();
+			}
+		}
+	}
+
+	public static List<Row> fetchFromTable(String keyspace, String tableName,
+			List<Pair<AuditingFieldsKeysEnum, String>> fields) throws FileNotFoundException {
+
+		// List<Pair<AuditingFieldsKeysEnum, String>>
+		// Map<AuditingFieldsKeysEnum, String>
+
+		Cluster cluster = null;
+		Session session;
+		String cassandraHost = Utils.getConfig().getCassandraHost();
+
+		try {
+			cluster = Cluster.builder().addContactPoint(cassandraHost).build();
+			session = cluster.connect(keyspace);
+			if (session != null) {
+				Select select = QueryBuilder.select().all().from(keyspace, tableName);
+				if (fields != null) {
+					// Set<Entry<AuditingFieldsKeysEnum, String>> entrySet =
+					// fields.entrySet();
+					// fields.
+					boolean multiple = (fields.size() > 1) ? true : false;
+					Where where = null;
+					int size = 0;
+
+					for (Pair<AuditingFieldsKeysEnum, String> pair : fields) {
+						++size;
+						if (size == 1) {
+							where = select.where(QueryBuilder.eq(pair.getValue0().getDisplayName(), pair.getValue1()));
+						} else {
+							where.and(QueryBuilder.eq(pair.getValue0().getDisplayName(), pair.getValue1()));
+						}
+					}
+					if (multiple) {
+						select.allowFiltering();
+					}
+
+				}
+
+				List<Row> rows = session.execute(select).all();
+				for (Row row : rows) {
+					logger.debug("{}", row);
+				}
+				return rows;
+			}
+		} finally {
+			if (cluster != null) {
+				cluster.close();
+			}
+		}
+		return null;
+	}
+	//
+	// public static void main(String[] args) throws FileNotFoundException {
+	// Map<AuditingFieldsKeysEnum, String> map = new HashMap<>();
+	// map.put(AuditingFieldsKeysEnum.AUDIT_ACTION, "Access");
+	// map.put(AuditingFieldsKeysEnum.AUDIT_STATUS, "200");
+	// // CassandraUtils.truncateTable("sdcartifact", "resources");
+	//// CassandraUtils.truncateAllTables("sdcaudit");
+	// CassandraUtils.fetchFromTable("sdcaudit", "useraccessevent", map );
+	// }
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java
new file mode 100644
index 0000000..207c4bb
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java
@@ -0,0 +1,732 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.general;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.helpers.AbstractUnmarshallerImpl;
+import javax.xml.ws.Response;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.tuple.Pair;
+import org.aspectj.apache.bcel.classfile.Code;
+import org.json.JSONException;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.testng.SkipException;
+
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
+public final class AtomicOperationUtils {
+
+	static final String basicAuthentication = "Basic Y2k6MTIzNDU2";
+	
+	private AtomicOperationUtils() {
+		throw new UnsupportedOperationException();
+	}
+
+	// *********** RESOURCE ****************
+	/**
+	 * Import a vfc From tosca file
+	 * 
+	 * @param filePath
+	 * @param fileName
+	 * @return
+	 * @throws IOException
+	 * @throws JSONException
+	 */
+	public static Either<Resource, RestResponse> importResource(String filePath, String fileName) {
+		try {
+			User designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+			ImportReqDetails importReqDetails = ElementFactory.getDefaultImportResource("ciTmpVFC");
+			importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, filePath, fileName);
+			RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, designer, null);
+			return buildResourceFromResponse(importResourceResponse);
+		} catch (Exception e) {
+			throw new AtomicOperationException(e);
+		}
+	}
+
+	public static Either<Resource, RestResponse> createResourceByType(ResourceTypeEnum resourceType, UserRoleEnum userRole, Boolean validateState) {
+		try {
+			User defaultUser = ElementFactory.getDefaultUser(userRole);
+			ResourceReqDetails defaultResource = ElementFactory.getDefaultResourceByType(resourceType, defaultUser);
+			RestResponse resourceResp = ResourceRestUtils.createResource(defaultResource, defaultUser);
+
+			if (validateState) {
+				assertTrue(resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
+			}
+
+			if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+				Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
+				return Either.left(resourceResponseObject);
+			}
+			return Either.right(resourceResp);
+		} catch (Exception e) {
+			throw new AtomicOperationException(e);
+		}
+	}
+
+	public static Either<Resource, RestResponse> createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, NormativeTypesEnum normativeTypes, ResourceCategoryEnum resourceCategory, UserRoleEnum userRole, Boolean validateState)
+			throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		ResourceReqDetails defaultResource = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(resourceType, normativeTypes, resourceCategory, defaultUser);
+		RestResponse resourceResp = ResourceRestUtils.createResource(defaultResource, defaultUser);
+
+		if (validateState) {
+			assertTrue("Actual Response Code is: " + resourceResp.getErrorCode(), resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+			// Resource resourceResponseObject = ResponseParser
+			// .convertResourceResponseToJavaObject(resourceResp.getResponse());
+			Resource resourceResponseObject = ResponseParser.parseToObjectUsingMapper(resourceResp.getResponse(), Resource.class);
+			return Either.left(resourceResponseObject);
+		}
+		return Either.right(resourceResp);
+	}
+
+	public static Either<Resource, RestResponse> createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum resourceType, Resource resourceNormativeType, ResourceCategoryEnum resourceCategory, UserRoleEnum userRole, Boolean validateState)
+			throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		ResourceReqDetails defaultResource = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(resourceType, resourceNormativeType, resourceCategory, defaultUser);
+		RestResponse resourceResp = ResourceRestUtils.createResource(defaultResource, defaultUser);
+
+		if (validateState) {
+			assertTrue("actual result: " + resourceResp.getResponseMessage(), resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+			// Resource resourceResponseObject = ResponseParser
+			// .convertResourceResponseToJavaObject(resourceResp.getResponse());
+			Resource resourceResponseObject = ResponseParser.parseToObjectUsingMapper(resourceResp.getResponse(), Resource.class);
+			return Either.left(resourceResponseObject);
+		}
+		return Either.right(resourceResp);
+	}
+
+	// *********** SERVICE ****************
+
+	public static Either<Service, RestResponse> createDefaultService(UserRoleEnum userRole, Boolean validateState) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(defaultUser);
+		RestResponse createServiceResp = ServiceRestUtils.createService(serviceDetails, defaultUser);
+
+		if (validateState) {
+			assertTrue(createServiceResp.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (createServiceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+			Service serviceResponseObject = ResponseParser.convertServiceResponseToJavaObject(createServiceResp.getResponse());
+			return Either.left(serviceResponseObject);
+		}
+		return Either.right(createServiceResp);
+	}
+
+	public static Either<Service, RestResponse> createServiceByCategory(ServiceCategoriesEnum category, UserRoleEnum userRole, Boolean validateState) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(category, defaultUser);
+		RestResponse createServiceResp = ServiceRestUtils.createService(serviceDetails, defaultUser);
+
+		if (validateState) {
+			assertTrue(createServiceResp.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (createServiceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+			Service serviceResponseObject = ResponseParser.convertServiceResponseToJavaObject(createServiceResp.getResponse());
+			return Either.left(serviceResponseObject);
+		}
+		return Either.right(createServiceResp);
+	}
+
+	// *********** PRODUCT ****************
+
+	public static Either<Product, RestResponse> createDefaultProduct(UserRoleEnum userRole, Boolean validateState) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		ProductReqDetails defaultProduct = ElementFactory.getDefaultProduct();
+		RestResponse createProductResp = ProductRestUtils.createProduct(defaultProduct, defaultUser);
+
+		if (validateState) {
+			assertTrue(createProductResp.getErrorCode() == ProductRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (createProductResp.getErrorCode() == ProductRestUtils.STATUS_CODE_CREATED) {
+			Product productResponseJavaObject = ResponseParser.convertProductResponseToJavaObject(createProductResp.getResponse());
+			return Either.left(productResponseJavaObject);
+		}
+		return Either.right(createProductResp);
+	}
+
+	// public static ComponentReqDetails
+	// convertCompoentToComponentReqDetails(Component component){
+	//
+	// ComponentReqDetails componentReqDetails =
+	// ElementFactory.getDefaultService();
+	// componentReqDetails.setName(component.getName());
+	// componentReqDetails.setDescription(component.getDescription());
+	// componentReqDetails.setTags(component.getTags());
+	// componentReqDetails.setContactId(component.getContactId());
+	// componentReqDetails.setIcon(component.getIcon());
+	// componentReqDetails.setUniqueId(component.getUniqueId());
+	// componentReqDetails.setCreatorUserId(component.getCreatorUserId());
+	// componentReqDetails.setCreatorFullName(component.getCreatorFullName());
+	// componentReqDetails.setLastUpdaterUserId(component.getLastUpdaterUserId());
+	// componentReqDetails.setLastUpdaterFullName(component.getLastUpdaterFullName());
+	// componentReqDetails.setCreationDate(component.getCreationDate());
+	// componentReqDetails.setLastUpdateDate(component.getLastUpdateDate());
+	// componentReqDetails.setLifecycleState(component.getLifecycleState());
+	// componentReqDetails.setVersion(component.getVersion());
+	// componentReqDetails.setUuid(component.getUUID());
+	// componentReqDetails.setCategories(component.getCategories());
+	// componentReqDetails.setProjectCode(component.getProjectCode());
+	//
+	// return componentReqDetails;
+	// }
+
+	// *********** LIFECYCLE ***************
+
+	public static Pair<Component, RestResponse> changeComponentState(Component component, UserRoleEnum userRole, LifeCycleStatesEnum targetState, Boolean validateState) throws Exception {
+
+		Boolean isValidationFailed = false;
+		RestResponse lifeCycleStatesResponse = null;
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+
+		LifeCycleStatesEnum curentCompState = LifeCycleStatesEnum.findByCompState(component.getLifecycleState().toString());
+
+		if (curentCompState == targetState) {
+			component = getCompoenntObject(component, userRole);
+			return Pair.of(component, null);
+		}
+		// List<LifeCycleStatesEnum> lifeCycleStatesEnumOrigList = new
+		// ArrayList<LifeCycleStatesEnum>(EnumSet.allOf(LifeCycleStatesEnum.class));
+
+		ArrayList<String> lifeCycleStatesEnumList = new ArrayList<String>();
+		if (curentCompState.equals(LifeCycleStatesEnum.CHECKIN) && targetState.equals(LifeCycleStatesEnum.CHECKOUT)) {
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKIN.toString());
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKOUT.toString());
+		} else {
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKOUT.toString());
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKIN.toString());
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CERTIFICATIONREQUEST.toString());
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.STARTCERTIFICATION.toString());
+			lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CERTIFY.toString());
+		}
+		for (int i = 0; i < lifeCycleStatesEnumList.size(); i++) {
+			if (lifeCycleStatesEnumList.get(i).equals(curentCompState.name())) {
+				int a;
+				a = (i == lifeCycleStatesEnumList.size() - 1) ? 0 : i + 1;
+
+				for (int n = a; n < lifeCycleStatesEnumList.size(); n++) {
+					if (lifeCycleStatesEnumList.get(n).equals(LifeCycleStatesEnum.STARTCERTIFICATION.name()) || lifeCycleStatesEnumList.get(n).equals(LifeCycleStatesEnum.CERTIFY.name())) {
+						defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+					} else
+						defaultUser = ElementFactory.getDefaultUser(userRole);
+
+					lifeCycleStatesResponse = LifecycleRestUtils.changeComponentState(component, defaultUser, LifeCycleStatesEnum.findByState(lifeCycleStatesEnumList.get(n)));
+					if (lifeCycleStatesResponse.getErrorCode() != LifecycleRestUtils.STATUS_CODE_SUCCESS)
+						isValidationFailed = true;
+					if (lifeCycleStatesEnumList.get(n).equals(targetState.toString()) || isValidationFailed == true) {
+						break;
+					}
+				}
+			}
+
+		}
+		Component componentJavaObject = getCompoenntObject(component, userRole);
+
+		if (validateState == true && isValidationFailed == true) {
+			assertTrue("change state failed" + lifeCycleStatesResponse.getResponse(), false);
+
+			return Pair.of(componentJavaObject, lifeCycleStatesResponse);
+		}
+
+		if (isValidationFailed == true) {
+			return Pair.of(componentJavaObject, lifeCycleStatesResponse);
+		}
+
+		return Pair.of(componentJavaObject, lifeCycleStatesResponse);
+	}
+
+	public static RestResponse distributeService(Component component, Boolean validateState) throws Exception {
+
+		Service service = (Service) component;
+
+		User opsUser = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
+		User governotUser = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
+
+		ServiceReqDetails serviceDetails = new ServiceReqDetails(service);
+		RestResponse distributionService = null;
+
+		RestResponse approveDistribution = LifecycleRestUtils.changeDistributionStatus(serviceDetails, null, governotUser, "approveService", DistributionStatusEnum.DISTRIBUTION_APPROVED);
+		if (approveDistribution.getErrorCode() == 200) {
+			distributionService = LifecycleRestUtils.changeDistributionStatus(serviceDetails, null, opsUser, "approveService", DistributionStatusEnum.DISTRIBUTED);
+		}
+
+		if (validateState) {
+			assertTrue(approveDistribution.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
+			assertTrue(distributionService.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
+			return distributionService;
+		}
+
+		return distributionService;
+
+	}
+
+	// *********** ARTIFACTS *****************
+
+	public static Either<ArtifactDefinition, RestResponse> uploadArtifactByType(ArtifactTypeEnum artifactType, Component component, UserRoleEnum userRole, Boolean deploymentTrue, Boolean validateState) throws Exception {
+
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(null, artifactType, deploymentTrue);
+		if (deploymentTrue == false)
+			artifactDetails.setArtifactGroupType(ArtifactGroupTypeEnum.INFORMATIONAL.getType());
+		RestResponse uploadArtifactResp = ArtifactRestUtils.uploadArtifact(artifactDetails, component, defaultUser);
+
+		if (validateState) {
+			assertTrue("artifact upload failed: " + artifactDetails.getArtifactName(), uploadArtifactResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		}
+
+		if (uploadArtifactResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
+			ArtifactDefinition artifactJavaObject = ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactResp.getResponse());
+			return Either.left(artifactJavaObject);
+		}
+		return Either.right(uploadArtifactResp);
+	}
+
+	// *********** CONTAINERS *****************
+	/**
+	 * Adds Component instance to Component
+	 * 
+	 * @param compInstParent
+	 * @param compContainer
+	 * @return
+	 */
+	public static Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer(Component compInstParent, Component compContainer) {
+		return addComponentInstanceToComponentContainer(compInstParent, compContainer, UserRoleEnum.DESIGNER, false);
+	}
+
+	public static Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer(Component compInstParent, Component compContainer, UserRoleEnum userRole, Boolean validateState) {
+		try {
+			User defaultUser = ElementFactory.getDefaultUser(userRole);
+			ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(compInstParent);
+			RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, defaultUser, compContainer);
+
+			if (validateState) {
+				if (createComponentInstance.getErrorCode() == ServiceRestUtils.STATUS_CODE_NOT_FOUND)
+				{
+					throw new SkipException("Open bug DE262001");
+				}
+				else{
+				assertTrue("error - " + createComponentInstance.getErrorCode() + "instead - " + ServiceRestUtils.STATUS_CODE_CREATED, createComponentInstance.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
+				}
+			}
+
+			if (createComponentInstance.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+				ComponentInstance componentInstance = ResponseParser.convertComponentInstanceResponseToJavaObject(createComponentInstance.getResponse());
+				return Either.left(componentInstance);
+			}
+			return Either.right(createComponentInstance);
+		} catch (Exception e) {
+			throw new AtomicOperationException(e);
+		}
+	}
+
+	public static Resource getResourceObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
+		// User defaultUser = ElementFactory.getDefaultUser(userRole);
+		RestResponse restResponse = ResourceRestUtils.getResource(containerDetails.getUniqueId());
+		Resource container = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		return container;
+	}
+	
+	public static Resource getResourceObject(String uniqueId) throws Exception {
+		RestResponse restResponse = ResourceRestUtils.getResource(uniqueId);
+		Resource resource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+		return resource;
+	}
+	
+	public static Resource getResourceObjectByNameAndVersion(UserRoleEnum sdncModifierDetails, String resourceName, String resourceVersion) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(sdncModifierDetails);
+		RestResponse resourceResponse = ResourceRestUtils.getResourceByNameAndVersion(defaultUser.getUserId(), resourceName, resourceVersion);
+		Resource container = ResponseParser.convertResourceResponseToJavaObject(resourceResponse.getResponse());
+		return container;
+	}
+
+	public static Service getServiceObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		RestResponse serviceResponse = ServiceRestUtils.getService(containerDetails.getUniqueId(), defaultUser);
+		Service container = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
+		return container;
+	}
+	
+	public static Service getServiceObjectByNameAndVersion(UserRoleEnum sdncModifierDetails, String serviceName, String serviceVersion) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(sdncModifierDetails);
+		RestResponse serviceResponse = ServiceRestUtils.getServiceByNameAndVersion(defaultUser, serviceName, serviceVersion);
+		Service container = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
+		return container;
+	}
+
+	public static Product getProductObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		RestResponse productRest = ProductRestUtils.getProduct(containerDetails.getUniqueId(), defaultUser.getUserId());
+		Product container = ResponseParser.convertProductResponseToJavaObject(productRest.getResponse());
+		return container;
+	}
+
+	public static Component getCompoenntObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+
+		switch (containerDetails.getComponentType()) {
+		case RESOURCE:
+			RestResponse restResponse = ResourceRestUtils.getResource(containerDetails.getUniqueId());
+			containerDetails = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
+			break;
+		case SERVICE:
+			RestResponse serviceResponse = ServiceRestUtils.getService(containerDetails.getUniqueId(), defaultUser);
+			containerDetails = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
+			break;
+		case PRODUCT:
+			RestResponse productRest = ProductRestUtils.getProduct(containerDetails.getUniqueId(), defaultUser.getUserId());
+			containerDetails = ResponseParser.convertProductResponseToJavaObject(productRest.getResponse());
+			break;
+		default:
+			break;
+		}
+		return containerDetails;
+	}
+
+	public static Component convertReposnseToComponentObject(Component containerDetails, RestResponse restresponse) throws Exception {
+
+		switch (containerDetails.getComponentType()) {
+		case RESOURCE:
+			containerDetails = ResponseParser.convertResourceResponseToJavaObject(restresponse.getResponse());
+			break;
+		case SERVICE:
+			containerDetails = ResponseParser.convertServiceResponseToJavaObject(restresponse.getResponse());
+			break;
+		case PRODUCT:
+			containerDetails = ResponseParser.convertProductResponseToJavaObject(restresponse.getResponse());
+			break;
+		default:
+			break;
+		}
+		return containerDetails;
+	}
+
+	public static Either<Component, RestResponse> associate2ResourceInstances(Component containerDetails, ComponentInstance fromNode, ComponentInstance toNode, String assocType, UserRoleEnum userRole, Boolean validateState) throws Exception {
+
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		RestResponse associate2ResourceInstancesResponse = ResourceRestUtils.associate2ResourceInstances(containerDetails, fromNode, toNode, assocType, defaultUser);
+
+		if (validateState) {
+			assertTrue(associate2ResourceInstancesResponse.getErrorCode() == ServiceRestUtils.STATUS_CODE_SUCCESS);
+		}
+
+		if (associate2ResourceInstancesResponse.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS) {
+
+			switch (containerDetails.getComponentType()) {
+			case RESOURCE:
+				containerDetails = ResponseParser.convertResourceResponseToJavaObject(associate2ResourceInstancesResponse.getResponse());
+				break;
+			case SERVICE:
+				containerDetails = ResponseParser.convertServiceResponseToJavaObject(associate2ResourceInstancesResponse.getResponse());
+				break;
+			case PRODUCT:
+				containerDetails = ResponseParser.convertProductResponseToJavaObject(associate2ResourceInstancesResponse.getResponse());
+				break;
+			default:
+				break;
+			}
+
+			return Either.left(containerDetails);
+		}
+		return Either.right(associate2ResourceInstancesResponse);
+
+	}
+
+	public static Either<Pair<Component, ComponentInstance>, RestResponse> changeComponentInstanceVersion(Component containerDetails, ComponentInstance componentInstanceToReplace, Component newInstance, UserRoleEnum userRole, Boolean validateState)
+			throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+
+		RestResponse changeComponentInstanceVersionResp = ComponentInstanceRestUtils.changeComponentInstanceVersion(containerDetails, componentInstanceToReplace, newInstance, defaultUser);
+		if (validateState) {
+			assertTrue("change ComponentInstance version failed: " + changeComponentInstanceVersionResp.getResponseMessage(), changeComponentInstanceVersionResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		}
+
+		if (changeComponentInstanceVersionResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
+
+			Component compoenntObject = AtomicOperationUtils.getCompoenntObject(containerDetails, userRole);
+			ComponentInstance componentInstanceJavaObject = ResponseParser.convertComponentInstanceResponseToJavaObject(changeComponentInstanceVersionResp.getResponse());
+
+			return Either.left(Pair.of(compoenntObject, componentInstanceJavaObject));
+		}
+
+		return Either.right(changeComponentInstanceVersionResp);
+	}
+
+	// *********** PROPERTIES *****************
+
+	public static Either<ComponentInstanceProperty, RestResponse> addCustomPropertyToResource(PropertyReqDetails propDetails, Resource resourceDetails, UserRoleEnum userRole, Boolean validateState) throws Exception {
+
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		Map<String, PropertyReqDetails> propertyToSend = new HashMap<String, PropertyReqDetails>();
+		propertyToSend.put(propDetails.getName(), propDetails);
+		Gson gson = new Gson();
+		RestResponse addPropertyResponse = PropertyRestUtils.createProperty(resourceDetails.getUniqueId(), gson.toJson(propertyToSend), defaultUser);
+
+		if (validateState) {
+			assertTrue("add property to resource failed: " + addPropertyResponse.getErrorCode(), addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED) {
+			ComponentInstanceProperty compInstProp = null;
+			String property = ResponseParser.getJsonObjectValueByKey(addPropertyResponse.getResponse(), propDetails.getName());
+			compInstProp = (ResponseParser.convertPropertyResponseToJavaObject(property));
+			return Either.left(compInstProp);
+		}
+		return Either.right(addPropertyResponse);
+	}
+
+	// Benny
+	public static Either<ComponentInstanceProperty, RestResponse> updatePropertyOfResource(PropertyReqDetails propDetails, Resource resourceDetails, String propertyUniqueId, UserRoleEnum userRole, Boolean validateState) throws Exception {
+
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		Map<String, PropertyReqDetails> propertyToSend = new HashMap<String, PropertyReqDetails>();
+		propertyToSend.put(propDetails.getName(), propDetails);
+		Gson gson = new Gson();
+		RestResponse addPropertyResponse = PropertyRestUtils.updateProperty(resourceDetails.getUniqueId(), propertyUniqueId, gson.toJson(propertyToSend), defaultUser);
+
+		if (validateState) {
+			assertTrue("add property to resource failed: " + addPropertyResponse.getResponseMessage(), addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		}
+
+		if (addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
+			ComponentInstanceProperty compInstProp = null;
+			String property = ResponseParser.getJsonObjectValueByKey(addPropertyResponse.getResponse(), propDetails.getName());
+			compInstProp = (ResponseParser.convertPropertyResponseToJavaObject(property));
+			return Either.left(compInstProp);
+		}
+		return Either.right(addPropertyResponse);
+	}
+
+	public static RestResponse deletePropertyOfResource(String resourceId, String propertyId, UserRoleEnum userRole) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		return PropertyRestUtils.deleteProperty(resourceId, propertyId, defaultUser);
+	}
+
+	public static Either<ComponentInstanceProperty, RestResponse> addDefaultPropertyToResource(PropertyTypeEnum propertyType, Resource resourceDetails, UserRoleEnum userRole, Boolean validateState) throws Exception {
+
+		User defaultUser = ElementFactory.getDefaultUser(userRole);
+		PropertyReqDetails propDetails = ElementFactory.getPropertyDetails(propertyType);
+		Map<String, PropertyReqDetails> propertyToSend = new HashMap<String, PropertyReqDetails>();
+		propertyToSend.put(propDetails.getName(), propDetails);
+		Gson gson = new Gson();
+		RestResponse addPropertyResponse = PropertyRestUtils.createProperty(resourceDetails.getUniqueId(), gson.toJson(propertyToSend), defaultUser);
+
+		if (validateState) {
+			assertTrue("add property to resource failed: " + addPropertyResponse.getResponseMessage(), addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED);
+		}
+
+		if (addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED) {
+			ComponentInstanceProperty compInstProp = null;
+			String property = ResponseParser.getJsonObjectValueByKey(addPropertyResponse.getResponse(), propDetails.getName());
+			compInstProp = (ResponseParser.convertPropertyResponseToJavaObject(property));
+
+			return Either.left(compInstProp);
+		}
+		return Either.right(addPropertyResponse);
+	}
+
+	public static RestResponse createDefaultConsumer(Boolean validateState) {
+		try {
+			ConsumerDataDefinition defaultConsumerDefinition = ElementFactory.getDefaultConsumerDetails();
+			RestResponse createResponse = ConsumerRestUtils.createConsumer(defaultConsumerDefinition, ElementFactory.getDefaultUser(UserRoleEnum.ADMIN));
+			BaseRestUtils.checkCreateResponse(createResponse);
+
+			if (validateState) {
+				assertTrue(createResponse.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
+			}
+			return createResponse;
+		} catch (Exception e) {
+			throw new AtomicOperationException(e);
+		}
+	}
+
+	/**
+	 * Builds Resource From rest response
+	 * 
+	 * @param resourceResp
+	 * @return
+	 */
+	public static Either<Resource, RestResponse> buildResourceFromResponse(RestResponse resourceResp) {
+		Either<Resource, RestResponse> result;
+		if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+			Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
+			result = Either.left(resourceResponseObject);
+		} else {
+			result = Either.right(resourceResp);
+		}
+		return result;
+	}
+
+	private static class AtomicOperationException extends RuntimeException {
+		private AtomicOperationException(Exception e) {
+			super(e);
+		}
+
+		private static final long serialVersionUID = 1L;
+	};
+	
+	/**
+	 * Import resource from CSAR
+	 * 
+	 * @param resourceType
+	 * @param userRole
+	 * @param fileName
+	 * @param filePath
+	 * @return Resource
+	 * @throws Exception
+	 */
+	public static Resource importResourceFromCSAR(ResourceTypeEnum resourceType, UserRoleEnum userRole, String fileName, String... filePath) throws Exception {
+		// Get the CSARs path
+		String realFilePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "CI" + File.separator + "csars" ;
+		if (filePath != null && filePath.length > 0) {
+			realFilePath = filePath.toString();
+		}
+		
+		// Create default import resource & user
+		ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
+		User sdncModifierDetails = ElementFactory.getDefaultUser(userRole);
+		
+		byte[] data = null;
+		Path path = Paths.get(realFilePath + File.separator + fileName);
+		data = Files.readAllBytes(path);
+		String payloadName = fileName;
+		String payloadData = Base64.encodeBase64String(data);
+		resourceDetails.setPayloadData(payloadData);
+		resourceDetails.setCsarUUID(payloadName);
+		resourceDetails.setPayloadName(payloadName);
+		resourceDetails.setResourceType(resourceType.name());
+		
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		return ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);		
+	};
+	
+	public static Either<Resource, RestResponse> importResourceByFileName(ResourceTypeEnum resourceType, UserRoleEnum userRole, String fileName, Boolean validateState, String... filePath) throws IOException {
+
+		String realFilePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "CI" + File.separator + "csars" ;
+		if (filePath != null && filePath.length > 0) {
+			realFilePath = filePath.toString();
+		}
+
+		try {
+			User defaultUser = ElementFactory.getDefaultUser(userRole);
+			ResourceReqDetails defaultResource = ElementFactory.getDefaultResource(defaultUser);			
+			ImportReqDetails defaultImportResource = ElementFactory.getDefaultImportResource(defaultResource);
+			ImportUtils.getImportResourceDetailsByPathAndName(defaultImportResource, realFilePath, fileName);
+			RestResponse resourceResp = ResourceRestUtils.createResource(defaultImportResource, defaultUser);
+
+			if (validateState) {
+				assertTrue(resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
+			}
+
+			if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
+				Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
+				return Either.left(resourceResponseObject);
+			}
+			return Either.right(resourceResp);
+		} catch (Exception e) {
+			throw new AtomicOperationException(e);
+		}
+	}
+	
+	public static Either<String, RestResponse> getServiceToscaArtifactPayload(Service service, String artifactType) throws Exception {
+
+		String url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, "localhost", "8080", service.getUniqueId(), service.getToscaArtifacts().get(artifactType).getUniqueId());
+		String userId = service.getLastUpdaterUserId();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+//		headersMap.put("X-ECOMP-InstanceID", "test");
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+		HttpRequest http = new HttpRequest();
+		RestResponse response = http.httpSendGet(url, headersMap);
+		if (response.getErrorCode() != 200 && response.getResponse().getBytes() == null && response.getResponse().getBytes().length == 0) {
+			return Either.right(response);
+		}
+		return Either.left(response.getResponse());
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java
new file mode 100644
index 0000000..619d279
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java
@@ -0,0 +1,344 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.general;
+
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_CREATED;
+import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
+
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedUserCRUDAudit;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+
+public class Convertor {
+	// ***** resource *****
+	public static ResourceRespJavaObject constructFieldsForRespValidation(ResourceReqDetails resourceDetails,
+			String resourceVersion) {
+		return convertToRespObject(resourceDetails, resourceVersion, UserRoleEnum.ADMIN.getUserId(),
+				UserRoleEnum.ADMIN.getUserName());
+
+	}
+
+	public static ResourceRespJavaObject constructFieldsForRespValidation(ResourceReqDetails resourceDetails) {
+		return convertToRespObject(resourceDetails, resourceDetails.getVersion(), UserRoleEnum.ADMIN.getUserId(),
+				UserRoleEnum.ADMIN.getUserName());
+
+	}
+
+	public static ResourceRespJavaObject constructFieldsForRespValidation(ResourceReqDetails resourceDetails,
+			String resourceVersion, User user) {
+		return convertToRespObject(resourceDetails, resourceVersion, user.getUserId(), user.getFullName());
+
+	}
+
+	private static ResourceRespJavaObject convertToRespObject(ResourceReqDetails resourceDetails,
+			String resourceVersion, String userId, String userName) {
+		ResourceRespJavaObject resourceRespJavaObject = new ResourceRespJavaObject();
+
+		resourceRespJavaObject.setUniqueId(resourceDetails.getUniqueId());
+		resourceRespJavaObject.setName(resourceDetails.getName());
+		resourceRespJavaObject.setCreatorUserId(resourceDetails.getCreatorUserId());
+		resourceRespJavaObject.setCreatorFullName(resourceDetails.getCreatorFullName());
+		resourceRespJavaObject.setLastUpdaterUserId(userId);
+		resourceRespJavaObject.setLastUpdaterFullName(userName);
+		resourceRespJavaObject.setDescription(resourceDetails.getDescription());
+		resourceRespJavaObject.setIcon(resourceDetails.getIcon());
+		resourceRespJavaObject.setTags(resourceDetails.getTags());
+		resourceRespJavaObject.setIsHighestVersion("true");
+		resourceRespJavaObject.setCategories(resourceDetails.getCategories());
+		resourceRespJavaObject.setLifecycleState(
+				resourceDetails.getLifecycleState() != null ? resourceDetails.getLifecycleState().toString()
+						: LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		// resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		resourceRespJavaObject.setDerivedFrom(resourceDetails.getDerivedFrom());
+		resourceRespJavaObject.setVendorName(resourceDetails.getVendorName());
+		resourceRespJavaObject.setVendorRelease(resourceDetails.getVendorRelease());
+		resourceRespJavaObject.setContactId(resourceDetails.getContactId());
+		resourceRespJavaObject.setAbstractt("false");
+		resourceRespJavaObject.setVersion(resourceVersion);
+		resourceRespJavaObject.setCost(resourceDetails.getCost());
+		resourceRespJavaObject.setLicenseType(resourceDetails.getLicenseType());
+		resourceRespJavaObject.setResourceType(resourceDetails.getResourceType());
+
+		return resourceRespJavaObject;
+
+	}
+
+	// ********** service **************
+
+	// public static ServiceRespJavaObject
+	// constructFieldsForRespValidation(ServiceReqDetails serviceDetails, String
+	// serviceVersion, User user) {
+	// return convertToRespObject(serviceDetails, serviceVersion,
+	// user.getUserId(), user.getFullName());
+	//
+	// }
+	//
+	// private static ServiceRespJavaObject
+	// convertToRespObject(ServiceReqDetails serviceDetails, String
+	// serviceVersion, String userId, String userName) {
+	// ServiceRespJavaObject serviceRespJavaObject = new
+	// ServiceRespJavaObject();
+	//
+	// serviceRespJavaObject.setUniqueId(serviceDetails.getUniqueId());
+	// serviceRespJavaObject.setName(serviceDetails.getName());
+	// serviceRespJavaObject.setCreatorUserId(userId);
+	// serviceRespJavaObject.setCreatorFullName(userName);
+	// serviceRespJavaObject.setLastUpdaterUserId(userId);
+	// serviceRespJavaObject.setLastUpdaterFullName(userName);
+	// serviceRespJavaObject.setDescription(serviceDetails.getDescription());
+	// serviceRespJavaObject.setIcon(serviceDetails.getIcon());
+	// serviceRespJavaObject.setCategory(serviceDetails.getCategory());
+	// serviceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+	// serviceRespJavaObject.setContactId(serviceDetails.getContactId());
+	// serviceRespJavaObject.setVersion(serviceVersion);
+	//
+	// return serviceRespJavaObject;
+	// }
+
+	// ********** product **************
+
+	public static Product constructFieldsForRespValidation(ProductReqDetails productDetails, String productVersion,
+			User user) {
+		return convertToRespObject(productDetails, productVersion, user.getUserId(), user.getFullName());
+	}
+
+	private static Product convertToRespObject(ProductReqDetails productDetails, String productVersion, String userId,
+			String userName) {
+		Product expectedProduct = new Product();
+
+		expectedProduct.setUniqueId(productDetails.getUniqueId());
+		expectedProduct.setName(productDetails.getName());
+		expectedProduct.setFullName(productDetails.getFullName());
+		expectedProduct.setCreatorUserId(productDetails.getCreatorUserId());
+		expectedProduct.setCreatorFullName(productDetails.getCreatorFullName());
+		expectedProduct.setLastUpdaterUserId(userId);
+		expectedProduct.setLastUpdaterFullName(userName);
+		expectedProduct.setDescription(productDetails.getDescription());
+		// expectedProduct.setIcon(resourceDetails.getIcon());
+		expectedProduct.setTags(productDetails.getTags());
+		expectedProduct.setHighestVersion(true);
+		List<CategoryDefinition> categories = productDetails.getCategories();
+		if (categories == null) {
+			categories = new ArrayList<>();
+		}
+		expectedProduct.setCategories(categories);
+		expectedProduct.setState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+		expectedProduct.setVersion(productVersion);
+		expectedProduct.setContacts(productDetails.getContacts());
+		return expectedProduct;
+	}
+
+	// ***** audit *****
+
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ResourceReqDetails resourceDetails,
+			String resourceVersion) {
+		return convertToAuditObject(resourceDetails, resourceVersion, UserRoleEnum.ADMIN.getUserId(),
+				UserRoleEnum.ADMIN.getUserName());
+	}
+
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(
+			ResourceReqDetails resourceDetails) {
+		return convertToAuditObject(resourceDetails, resourceDetails.getVersion(), UserRoleEnum.ADMIN.getUserId(),
+				UserRoleEnum.ADMIN.getUserName());
+	}
+
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ResourceReqDetails resourceDetails,
+			String resourceVersion, User user) {
+		return convertToAuditObject(resourceDetails, resourceVersion, user.getUserId(), user.getFullName());
+	}
+
+	private static ExpectedResourceAuditJavaObject convertToAuditObject(ResourceReqDetails resourceDetails,
+			String resourceVersion, String userId, String userName) {
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+
+		expectedResourceAuditJavaObject.setAction("Checkout");
+		expectedResourceAuditJavaObject.setModifierName(userName);
+		expectedResourceAuditJavaObject.setModifierUid(userId);
+		expectedResourceAuditJavaObject.setStatus("200.0");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName());
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(resourceVersion) - 0.1f));
+		expectedResourceAuditJavaObject.setCurrVersion(resourceVersion);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setComment(null);
+
+		return expectedResourceAuditJavaObject;
+	}
+
+	public static ExpectedProductAudit constructFieldsForAuditValidation(Product productDetails, String action,
+			User user, ActionStatus actionStatus, String prevVersion, String currVersion, LifecycleStateEnum prevState,
+			LifecycleStateEnum currState, String uuid, String... errorMessageParams) throws FileNotFoundException {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		return convertToAuditObject(productDetails, action, user, errorInfo, prevVersion, currVersion, prevState,
+				currState, uuid, errorMessageParams);
+	}
+
+	private static ExpectedProductAudit convertToAuditObject(Product productDetails, String action, User user,
+			ErrorInfo errorInfo, String prevVersion, String currVersion, LifecycleStateEnum prevState,
+			LifecycleStateEnum currState, String uuid, String... errorMessageParams) {
+		ExpectedProductAudit expectedProductAudit = new ExpectedProductAudit();
+
+		expectedProductAudit.setACTION(action);
+		String userUserId = user.getUserId();
+		String userFullName;
+		if (StringUtils.isEmpty(user.getFirstName()) && StringUtils.isEmpty(user.getLastName())) {
+			userFullName = "";
+		} else {
+			userFullName = user.getFullName();
+		}
+		if (StringUtils.isEmpty(userUserId)) {
+			userUserId = "UNKNOWN";
+		}
+		expectedProductAudit.setMODIFIER(
+				!StringUtils.isEmpty(userFullName) ? userFullName + "(" + userUserId + ")" : "(" + userUserId + ")");
+		expectedProductAudit.setSTATUS(Integer.toString(errorInfo.getCode()));
+		expectedProductAudit.setDESC(errorInfo.getAuditDesc((Object[]) (errorMessageParams)));
+		expectedProductAudit
+				.setRESOURCE_NAME(productDetails != null ? productDetails.getName() : Constants.EMPTY_STRING);
+		expectedProductAudit.setRESOURCE_TYPE("Product");
+		expectedProductAudit.setPREV_VERSION(prevVersion);
+		expectedProductAudit.setCURR_VERSION(currVersion);
+		expectedProductAudit.setPREV_STATE(prevState != null ? prevState.name() : Constants.EMPTY_STRING);
+		expectedProductAudit.setCURR_STATE(currState != null ? currState.name() : Constants.EMPTY_STRING);
+		expectedProductAudit.setSERVICE_INSTANCE_ID(uuid);
+		return expectedProductAudit;
+	}
+
+	////////////////
+	// Convertor.constructFieldsForAuditValidationSuccess(addUser,
+	//////////////// sdncAdminUser, mechIdUser, null, STATUS_CODE_CREATED);
+	public static ExpectedUserCRUDAudit constructFieldsForAuditValidation(String action, User userModifier,
+			ActionStatus actionStatus, User userAfter, User userBefore, Object... variables) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		ExpectedUserCRUDAudit expectedAddUserAuditJavaObject = new ExpectedUserCRUDAudit();
+		expectedAddUserAuditJavaObject.setAction(action);
+		expectedAddUserAuditJavaObject.setModifier(
+				userModifier.getFirstName() != null ? userModifier.getFullName() + "(" + userModifier.getUserId() + ")"
+						: "(" + userModifier.getUserId() + ")");
+		String status = Integer.toString(errorInfo.getCode());
+		expectedAddUserAuditJavaObject.setStatus(status);
+		if (errorInfo.getCode() == STATUS_CODE_SUCCESS || errorInfo.getCode() == STATUS_CODE_CREATED) {
+			expectedAddUserAuditJavaObject.setDesc("OK");
+		} else {
+			expectedAddUserAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		}
+		expectedAddUserAuditJavaObject.setUserBefore(userBefore != null
+				? userBefore.getUserId() + ", " + userBefore.getFirstName() + " " + userBefore.getLastName() + ", "
+						+ userBefore.getEmail() + ", " + userBefore.getRole()
+				: Constants.EMPTY_STRING);
+		expectedAddUserAuditJavaObject.setUserAfter(userAfter != null
+				? userAfter.getUserId() + ", " + userAfter.getFirstName() + " " + userAfter.getLastName() + ", "
+						+ userAfter.getEmail() + ", " + userAfter.getRole()
+				: Constants.EMPTY_STRING);
+		return expectedAddUserAuditJavaObject;
+	}
+
+	// For RESOURCE and SERVICE same Audit
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(
+			ComponentReqDetails componentDetails, String action, User userModifier, ActionStatus actionStatus,
+			String currVersion, String prevVersion, String curState, String prevState, String uuid, String comment,
+			Object... variables) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(action);
+		expectedResourceAuditJavaObject.setMODIFIER(
+				userModifier.getFirstName() != null ? userModifier.getFullName() + "(" + userModifier.getUserId() + ")"
+						: "(" + userModifier.getUserId() + ")");
+		String status = Integer.toString(errorInfo.getCode());
+		expectedResourceAuditJavaObject.setStatus(status);
+		if (errorInfo.getCode() == STATUS_CODE_SUCCESS || errorInfo.getCode() == STATUS_CODE_CREATED) {
+			expectedResourceAuditJavaObject.setDesc("OK");
+		} else {
+			expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		}
+		expectedResourceAuditJavaObject.setCurrState(curState);
+		expectedResourceAuditJavaObject.setPrevState(prevState);
+		expectedResourceAuditJavaObject.setCurrVersion(currVersion);
+		expectedResourceAuditJavaObject.setPrevVersion(prevVersion);
+		expectedResourceAuditJavaObject.setComment(comment);
+		expectedResourceAuditJavaObject.setSERVICE_INSTANCE_ID(uuid);
+		if (componentDetails instanceof ServiceReqDetails) {
+			expectedResourceAuditJavaObject.setResourceName(((ServiceReqDetails) componentDetails).getName());
+			expectedResourceAuditJavaObject.setResourceType("Service");
+		}
+		if (componentDetails instanceof ResourceReqDetails) {
+			expectedResourceAuditJavaObject.setResourceName(((ResourceReqDetails) componentDetails).getName());
+			expectedResourceAuditJavaObject.setResourceType("Resource");
+		}
+		return expectedResourceAuditJavaObject;
+	}
+
+	// Distribution Service Audit
+	public static ExpectedResourceAuditJavaObject constructFieldsForDistributionAuditValidation(
+			ComponentReqDetails componentDetails, String action, User userModifier, ActionStatus actionStatus,
+			String currVersion, String distCurrStatus, String distProvStatus, String curState, String uuid,
+			String comment, Object... variables) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(action);
+		expectedResourceAuditJavaObject.setMODIFIER(
+				userModifier.getFirstName() != null ? userModifier.getFullName() + "(" + userModifier.getUserId() + ")"
+						: "(" + userModifier.getUserId() + ")");
+		String status = Integer.toString(errorInfo.getCode());
+		expectedResourceAuditJavaObject.setStatus(status);
+		if (errorInfo.getCode() == STATUS_CODE_SUCCESS || errorInfo.getCode() == STATUS_CODE_CREATED) {
+			expectedResourceAuditJavaObject.setDesc("OK");
+		} else {
+			expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		}
+		expectedResourceAuditJavaObject.setCurrState(curState);
+		expectedResourceAuditJavaObject.setCurrVersion(currVersion);
+		expectedResourceAuditJavaObject.setDcurrStatus(distCurrStatus);
+		expectedResourceAuditJavaObject.setDprevStatus(distProvStatus);
+		expectedResourceAuditJavaObject.setComment(comment);
+		expectedResourceAuditJavaObject.setSERVICE_INSTANCE_ID(uuid);
+		if (componentDetails instanceof ServiceReqDetails) {
+			expectedResourceAuditJavaObject.setResourceName(((ServiceReqDetails) componentDetails).getName());
+			expectedResourceAuditJavaObject.setResourceType("Service");
+		}
+		return expectedResourceAuditJavaObject;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java
new file mode 100644
index 0000000..5c23b5f
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java
@@ -0,0 +1,997 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.general;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.RelationshipImpl;
+import org.openecomp.sdc.be.model.RequirementAndRelationshipPair;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.util.ValidationUtils;
+
+public class ElementFactory {
+
+	private static final String CI_SERVICE = "ciService";
+	private static final String CI_RES = "ciRes";
+	private static final String CI_PRODUCT = "CiProduct";
+	private static String DEFAULT_ARTIFACT_LABEL = "artifact1";
+	private static final String RESOURCE_INSTANCE_POS_X = "20";
+	private static final String RESOURCE_INSTANCE_POS_Y = "20";
+	private static final String RESOURCE_INSTANCE_DESCRIPTION = "description";
+
+	// *** RESOURCE ***
+
+	public static ResourceReqDetails getDefaultResource() {
+		return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
+	}
+
+	public static ResourceReqDetails getDefaultResource(ResourceCategoryEnum category) {
+		return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, category, "jh0003");
+	}
+
+	public static ResourceReqDetails getDefaultResource(String contactId) {
+		return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, contactId);
+	}
+
+	public static ResourceReqDetails getDefaultResource(User modifier) {
+		return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, modifier.getUserId());
+	}
+
+	public static ResourceReqDetails getDefaultResource(NormativeTypesEnum derivedFrom, ResourceCategoryEnum category) {
+		return getDefaultResource(CI_RES, derivedFrom, category, "jh0003");
+	}
+
+	public static ResourceReqDetails getDefaultResource(NormativeTypesEnum derivedFrom) {
+		return getDefaultResource(CI_RES, derivedFrom, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
+	}
+
+	public static ResourceReqDetails getDefaultResource(String resourceName, NormativeTypesEnum derivedFrom) {
+		return getDefaultResource(resourceName, derivedFrom, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
+	}
+
+	public static ResourceReqDetails getDefaultResource(NormativeTypesEnum derivedFrom, String contactId) {
+		return getDefaultResource(CI_RES, derivedFrom, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, contactId);
+	}
+
+	// New
+	public static ResourceReqDetails getDefaultResourceByType(ResourceTypeEnum ResourceType, String resourceName) {
+		return getDefaultResourceByType(resourceName, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003", ResourceType.toString());
+	}
+
+	public static ResourceReqDetails getDefaultResourceByType(ResourceTypeEnum ResourceType, User user) {
+		return getDefaultResourceByType(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_LOAD_BALANCER, user.getUserId(), ResourceType.toString());
+	}
+
+	public static ResourceReqDetails getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, NormativeTypesEnum normativeTypes, ResourceCategoryEnum resourceCategory, User user) {
+		return getDefaultResourceByType(CI_RES, normativeTypes, resourceCategory, user.getUserId(), resourceType.toString());
+	}
+
+	public static PropertyReqDetails getDefaultMapProperty(PropertyTypeEnum innerType) {
+		return getPropertyDetails(innerType);
+	}
+
+	public static PropertyReqDetails getDefaultMapProperty() {
+		return getPropertyDetails(PropertyTypeEnum.STRING_MAP);
+	}
+
+	public static ResourceReqDetails getDefaultResource(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId) {
+		resourceName = (resourceName + generateUUIDforSufix());
+		String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(derived.normativeName);
+		String vendorName = "ATT Tosca";
+		String vendorRelease = "1.0.0.wd03";
+		String icon = "defaulticon";
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
+
+		return resourceDetails;
+
+	}
+
+	public static ResourceReqDetails getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, Resource normativeTypes, ResourceCategoryEnum resourceCategory, User user) {
+		return getDefaultResource(CI_RES + resourceType, normativeTypes, resourceCategory, user.getUserId());
+	}
+
+	public static ResourceReqDetails getDefaultResource(String resourceName, Resource derived, ResourceCategoryEnum category, String contactId) {
+		resourceName = (resourceName + generateUUIDforSufix());
+		String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+
+		ArrayList<String> derivedFrom = new ArrayList<String>();
+		derivedFrom.add(derived.getToscaResourceName());
+		String vendorName = "ATT Tosca";
+		String vendorRelease = "1.0.0.wd03";
+		String icon = "defaulticon";
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
+
+		return resourceDetails;
+
+	}
+
+	public static ResourceReqDetails getDefaultResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, ResourceTypeEnum resourceType) {
+		return getDefaultResourceByType(resourceName, derived, category, contactId, resourceType.toString());
+	}
+
+	// New
+	public static ResourceReqDetails getDefaultResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, String resourceType) {
+		resourceName = (resourceName + resourceType + generateUUIDforSufix());
+		String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		ArrayList<String> derivedFrom = null;
+		if (derived != null) {
+			derivedFrom = new ArrayList<String>();
+			derivedFrom.add(derived.normativeName);
+		}
+		String vendorName = "ATT Tosca";
+		String vendorRelease = "1.0.0.wd03";
+		String icon = "defaulticon";
+		ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon, resourceType.toString());
+		resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
+		return resourceDetails;
+	}
+	
+	public static ResourceExternalReqDetails getDefaultResourceByType(String resourceName, ResourceCategoryEnum category, String contactId, String resourceType) {
+		resourceName = (resourceName + resourceType + generateUUIDforSufix());
+		String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		String vendorName = "ATT Tosca";
+		String vendorRelease = "1.0.0.wd03";
+		String icon = "defaulticon";
+		ResourceExternalReqDetails resourceDetails = new ResourceExternalReqDetails(resourceName, description, resourceTags, 
+				vendorName, vendorRelease, contactId, icon,
+				resourceType.toString(), category.getCategory(), category.getSubCategory());
+		return resourceDetails;
+	}
+
+	// New
+	public static ImportReqDetails getDefaultImportResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, String resourceType) {
+		resourceName = (resourceName + resourceType + generateUUIDforSufix());
+		String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
+		ArrayList<String> resourceTags = new ArrayList<String>();
+		resourceTags.add(resourceName);
+		ArrayList<String> derivedFrom = null;
+		if (derived != null) {
+			derivedFrom = new ArrayList<String>();
+			derivedFrom.add(derived.normativeName);
+		}
+		String vendorName = "ATT Tosca";
+		String vendorRelease = "1.0.0.wd03";
+		String icon = "defaulticon";
+		ImportReqDetails resourceDetails = new ImportReqDetails(resourceName, description, resourceTags, derivedFrom, vendorName, vendorRelease, contactId, icon);
+		resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
+		return resourceDetails;
+	}
+	////
+
+	public static ImportReqDetails getDefaultImportResource(ResourceReqDetails resourceReqDetails) {
+		ImportReqDetails importReqDetails = new ImportReqDetails(resourceReqDetails.getName(), resourceReqDetails.getDescription(), resourceReqDetails.getTags(), resourceReqDetails.getDerivedFrom(), resourceReqDetails.getVendorName(),
+				resourceReqDetails.getVendorRelease(), resourceReqDetails.getContactId(), resourceReqDetails.getIcon());
+		importReqDetails.setPayloadName("myCompute.yaml");
+		importReqDetails.setCategories(resourceReqDetails.getCategories());
+		importReqDetails.setPayloadData(
+				"dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCm5vZGVfdHlwZXM6IA0KICBjb20uYXR0LmQyLnJlc291cmNlLk15Q29tcHV0ZToNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLlJvb3QNCiAgICBhdHRyaWJ1dGVzOg0KICAgICAgcHJpdmF0ZV9hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIHB1YmxpY19hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICB0eXBlOiBtYXANCiAgICAgICAgZW50cnlfc2NoZW1hOg0KICAgICAgICAgIHR5cGU6IHRvc2NhLmRhdGF0eXBlcy5uZXR3b3JrLk5ldHdvcmtJbmZvDQogICAgICBwb3J0czoNCiAgICAgICAgdHlwZTogbWFwDQogICAgICAgIGVudHJ5X3NjaGVtYToNCiAgICAgICAgICB0eXBlOiB0b3NjYS5kYXRhdHlwZXMubmV0d29yay5Qb3J0SW5mbw0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gbG9jYWxfc3RvcmFnZTogDQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLkF0dGFjaG1lbnQNCiAgICAgICAgICBub2RlOiB0b3NjYS5ub2Rlcy5CbG9ja1N0b3JhZ2UNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMuQXR0YWNoZXNUbw0KICAgICAgICAgIG9jY3VycmVuY2VzOiBbMCwgVU5CT1VOREVEXSAgDQogICAgY2FwYWJpbGl0aWVzOg0KICAgICAgaG9zdDogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5Db250YWluZXINCiAgICAgICAgdmFsaWRfc291cmNlX3R5cGVzOiBbdG9zY2Eubm9kZXMuU29mdHdhcmVDb21wb25lbnRdIA0KICAgICAgZW5kcG9pbnQgOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuRW5kcG9pbnQuQWRtaW4gDQogICAgICBvczogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5PcGVyYXRpbmdTeXN0ZW0NCiAgICAgIHNjYWxhYmxlOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuU2NhbGFibGUNCiAgICAgIGJpbmRpbmc6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQo=");
+		return importReqDetails;
+	}
+
+	public static ImportReqDetails getDefaultImportResource() {
+		ResourceReqDetails resourceReqDetails = getDefaultResource();
+		ImportReqDetails importReqDetails = new ImportReqDetails(resourceReqDetails.getName(), resourceReqDetails.getDescription(), resourceReqDetails.getTags(), resourceReqDetails.getDerivedFrom(), resourceReqDetails.getVendorName(),
+				resourceReqDetails.getVendorRelease(), resourceReqDetails.getContactId(), resourceReqDetails.getIcon());
+		importReqDetails.setPayloadName("myCompute.yaml");
+		importReqDetails.setCategories(resourceReqDetails.getCategories());
+		importReqDetails.setPayloadData(
+				"dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCm5vZGVfdHlwZXM6IA0KICBjb20uYXR0LmQyLnJlc291cmNlLk15Q29tcHV0ZToNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLlJvb3QNCiAgICBhdHRyaWJ1dGVzOg0KICAgICAgcHJpdmF0ZV9hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIHB1YmxpY19hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICB0eXBlOiBtYXANCiAgICAgICAgZW50cnlfc2NoZW1hOg0KICAgICAgICAgIHR5cGU6IHRvc2NhLmRhdGF0eXBlcy5uZXR3b3JrLk5ldHdvcmtJbmZvDQogICAgICBwb3J0czoNCiAgICAgICAgdHlwZTogbWFwDQogICAgICAgIGVudHJ5X3NjaGVtYToNCiAgICAgICAgICB0eXBlOiB0b3NjYS5kYXRhdHlwZXMubmV0d29yay5Qb3J0SW5mbw0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gbG9jYWxfc3RvcmFnZTogDQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLkF0dGFjaG1lbnQNCiAgICAgICAgICBub2RlOiB0b3NjYS5ub2Rlcy5CbG9ja1N0b3JhZ2UNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMuQXR0YWNoZXNUbw0KICAgICAgICAgIG9jY3VycmVuY2VzOiBbMCwgVU5CT1VOREVEXSAgDQogICAgY2FwYWJpbGl0aWVzOg0KICAgICAgaG9zdDogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5Db250YWluZXINCiAgICAgICAgdmFsaWRfc291cmNlX3R5cGVzOiBbdG9zY2Eubm9kZXMuU29mdHdhcmVDb21wb25lbnRdIA0KICAgICAgZW5kcG9pbnQgOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuRW5kcG9pbnQuQWRtaW4gDQogICAgICBvczogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5PcGVyYXRpbmdTeXN0ZW0NCiAgICAgIHNjYWxhYmxlOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuU2NhbGFibGUNCiAgICAgIGJpbmRpbmc6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQo=");
+		return importReqDetails;
+	}
+
+	public static ImportReqDetails getDefaultImportResource(String name) {
+		ResourceReqDetails resourceReqDetails = getDefaultResourceByType(ResourceTypeEnum.VFC, name);
+		ImportReqDetails importReqDetails = new ImportReqDetails(resourceReqDetails.getName(), resourceReqDetails.getDescription(), resourceReqDetails.getTags(), resourceReqDetails.getDerivedFrom(), resourceReqDetails.getVendorName(),
+				resourceReqDetails.getVendorRelease(), resourceReqDetails.getContactId(), resourceReqDetails.getIcon());
+		importReqDetails.setPayloadName("myCompute.yaml");
+		importReqDetails.setCategories(resourceReqDetails.getCategories());
+		importReqDetails.setPayloadData(
+				"dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCm5vZGVfdHlwZXM6IA0KICBjb20uYXR0LmQyLnJlc291cmNlLk15Q29tcHV0ZToNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLlJvb3QNCiAgICBhdHRyaWJ1dGVzOg0KICAgICAgcHJpdmF0ZV9hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIHB1YmxpY19hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICB0eXBlOiBtYXANCiAgICAgICAgZW50cnlfc2NoZW1hOg0KICAgICAgICAgIHR5cGU6IHRvc2NhLmRhdGF0eXBlcy5uZXR3b3JrLk5ldHdvcmtJbmZvDQogICAgICBwb3J0czoNCiAgICAgICAgdHlwZTogbWFwDQogICAgICAgIGVudHJ5X3NjaGVtYToNCiAgICAgICAgICB0eXBlOiB0b3NjYS5kYXRhdHlwZXMubmV0d29yay5Qb3J0SW5mbw0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gbG9jYWxfc3RvcmFnZTogDQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLkF0dGFjaG1lbnQNCiAgICAgICAgICBub2RlOiB0b3NjYS5ub2Rlcy5CbG9ja1N0b3JhZ2UNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMuQXR0YWNoZXNUbw0KICAgICAgICAgIG9jY3VycmVuY2VzOiBbMCwgVU5CT1VOREVEXSAgDQogICAgY2FwYWJpbGl0aWVzOg0KICAgICAgaG9zdDogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5Db250YWluZXINCiAgICAgICAgdmFsaWRfc291cmNlX3R5cGVzOiBbdG9zY2Eubm9kZXMuU29mdHdhcmVDb21wb25lbnRdIA0KICAgICAgZW5kcG9pbnQgOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuRW5kcG9pbnQuQWRtaW4gDQogICAgICBvczogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5PcGVyYXRpbmdTeXN0ZW0NCiAgICAgIHNjYWxhYmxlOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuU2NhbGFibGUNCiAgICAgIGJpbmRpbmc6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQo=");
+		return importReqDetails;
+	}
+
+	// *** SERVICE ***
+	public static ServiceReqDetails getDefaultService() {
+		return getDefaultService(CI_SERVICE, ServiceCategoriesEnum.MOBILITY, "al1976");
+	}
+
+	public static ServiceReqDetails getDefaultService(String contactId) {
+		return getDefaultService(CI_SERVICE, ServiceCategoriesEnum.MOBILITY, contactId);
+	}
+
+	public static ServiceReqDetails getDefaultService(User user) {
+		return getDefaultService(CI_SERVICE, ServiceCategoriesEnum.MOBILITY, user.getUserId());
+	}
+
+	public static ServiceReqDetails getService(ServiceCategoriesEnum category) {
+		return getDefaultService(CI_SERVICE, category, "al1976");
+	}
+
+	public static ServiceReqDetails getDefaultService(ServiceCategoriesEnum category, User user) {
+		return getDefaultService(CI_SERVICE, category, user.getUserId());
+	}
+
+	public static ServiceReqDetails getDefaultService(String serviceName, ServiceCategoriesEnum category, String contactId) {
+		serviceName = (serviceName + generateUUIDforSufix());
+		ArrayList<String> tags = new ArrayList<String>();
+		tags.add("serviceTag");
+		tags.add("serviceTag1");
+		tags.add(serviceName);
+		String description = "service Description";
+		String icon = "myIcon";
+
+		ServiceReqDetails serviceDetails = new ServiceReqDetails(serviceName, category.getValue(), tags, description, contactId, icon);
+
+		return serviceDetails;
+	}
+
+	// ***** PROPERTY ***
+
+	public static PropertyReqDetails getDefaultProperty() {
+		return getDefaultProperty("disk_size");
+	}
+
+	public static PropertyReqDetails getDefaultProperty(String propertyName) {
+		PropertyReqDetails property = new PropertyReqDetails();
+		property.setName(propertyName);
+		property.setPropertyType("integer");
+		property.setPropertyRequired(false);
+		property.setPropertyDefaultValue("12345");
+		property.setPropertyDescription("test property");
+		property.setPropertyRangeMax("500");
+		property.setPropertyRangeMin("100");
+		property.setPropertyPassword(false);
+		return property;
+	}
+
+	public static PropertyReqDetails getDefaultIntegerProperty() {
+		return getPropertyDetails(PropertyTypeEnum.INTEGER);
+	}
+
+	public static PropertyReqDetails getDefaultStringProperty() {
+		return getPropertyDetails(PropertyTypeEnum.STRING);
+	}
+
+	public static PropertyReqDetails getDefaultBooleanProperty() {
+		return getPropertyDetails(PropertyTypeEnum.BOOLEAN);
+	}
+
+	public static PropertyReqDetails getDefaultListProperty() {
+		return getPropertyDetails(PropertyTypeEnum.STRING_LIST);
+	}
+
+	public static PropertyReqDetails getDefaultListProperty(PropertyTypeEnum innerType) {
+		return getPropertyDetails(innerType);
+	}
+
+	public static PropertyReqDetails getPropertyDetails(PropertyTypeEnum propType) {
+		return new PropertyReqDetails(propType.getName(), propType.getType(), propType.getValue(), propType.getDescription(), propType.getSchemaDefinition());
+	}
+
+	// ***** RESOURCE INSTANCE ***
+	public static ComponentInstanceReqDetails getDefaultComponentInstance() {
+		return getDefaultComponentInstance("resourceInstanceName");
+	}
+
+	public static ComponentInstanceReqDetails getDefaultComponentInstance(String name) {
+		String resourceUid = "resourceId";
+		ComponentInstanceReqDetails resourceInstanceDetails = new ComponentInstanceReqDetails(resourceUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, name);
+
+		return resourceInstanceDetails;
+
+	}
+
+	public static ComponentInstanceReqDetails getDefaultComponentInstance(String name, ComponentReqDetails componentReqDetails) {
+		String resourceUid = componentReqDetails.getUniqueId();
+		ComponentInstanceReqDetails resourceInstanceDetails = new ComponentInstanceReqDetails(resourceUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, name);
+
+		return resourceInstanceDetails;
+
+	}
+
+	public static ComponentInstanceReqDetails getComponentResourceInstance(ComponentReqDetails compInstOriginDetails) {
+		String compInstName = (compInstOriginDetails.getName() != null ? compInstOriginDetails.getName() : "resourceInstanceName");
+		String resourceUid = compInstOriginDetails.getUniqueId();
+		ComponentInstanceReqDetails resourceInstanceDetails = new ComponentInstanceReqDetails(resourceUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, compInstName);
+		return resourceInstanceDetails;
+
+	}
+
+	public static ComponentInstanceReqDetails getComponentInstance(Component compInstOriginDetails) {
+		String compInstName = (compInstOriginDetails.getName() != null ? compInstOriginDetails.getName() : "componentInstanceName");
+		String compInsUid = compInstOriginDetails.getUniqueId();
+		ComponentInstanceReqDetails componentInstanceDetails = new ComponentInstanceReqDetails(compInsUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, compInstName);
+		return componentInstanceDetails;
+
+	}
+
+	// ******* USER **********************
+	public static User getDefaultUser(UserRoleEnum userRole) {
+		User sdncModifierDetails = new User();
+		sdncModifierDetails.setUserId(userRole.getUserId());
+		sdncModifierDetails.setFirstName(userRole.getFirstName());
+		sdncModifierDetails.setLastName(userRole.getLastName());
+		return sdncModifierDetails;
+	}
+
+	public static User getDefaultMechUser() {
+		User sdncMechUserDetails = new User();
+		sdncMechUserDetails.setUserId("m12345");
+		sdncMechUserDetails.setFirstName("Fishi");
+		sdncMechUserDetails.setLastName("Shifi");
+		sdncMechUserDetails.setEmail("mechId@intl.sdc.com");
+		sdncMechUserDetails.setRole("DESIGNER");
+		return sdncMechUserDetails;
+	}
+
+	// ******* CONSUMER **********************
+
+	public static ConsumerDataDefinition getDefaultConsumerDetails() {
+		ConsumerDataDefinition consumer = new ConsumerDataDefinition();
+		consumer.setConsumerName("ci");
+		consumer.setConsumerSalt("2a1f887d607d4515d4066fe0f5452a50");
+		consumer.setConsumerPassword("0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b");
+		return consumer;
+	}
+
+	// *** ARTIFACT ***
+	public static ArtifactReqDetails getDefaultArtifact() throws IOException, Exception {
+		return getDefaultArtifact(DEFAULT_ARTIFACT_LABEL);
+	}
+
+	public static ArtifactReqDetails getDefaultArtifact(String artifactLabel) throws IOException, Exception {
+		List<String> artifactTypes = ResponseParser.getValuesFromJsonArray(ArtifactRestUtils.getArtifactTypesList());
+		String artifactType = artifactTypes.get(0);
+
+		return getDefaultArtifact(artifactLabel, artifactType);
+	}
+
+	public static ArtifactReqDetails getDefaultArtifact(String artifactLabel, String artifactType) throws IOException, Exception {
+
+		String artifactName = "testArtifact.sh";
+		String artifactDescription = "descriptionTest";
+		String payloadData = "dGVzdA=="; // content of file
+
+		ArtifactReqDetails artifactDetails = new ArtifactReqDetails(artifactName, artifactType, artifactDescription, payloadData, artifactLabel);
+		artifactDetails.setUrl("");
+		artifactDetails.setArtifactDisplayName(artifactLabel);
+		return artifactDetails;
+	}
+
+	public static ArtifactReqDetails getServiceApiArtifactDetails(String artifactLabel) throws IOException, Exception {
+		ArtifactReqDetails defaultArtifact = getDefaultArtifact(artifactLabel, "OTHER");
+		defaultArtifact.setUrl("http://www.apple.com");
+		defaultArtifact.setServiceApi(true);
+		defaultArtifact.setArtifactDisplayName(StringUtils.capitalize(defaultArtifact.getArtifactLabel()));
+		return defaultArtifact;
+	}
+
+	public static ArtifactReqDetails getDefaultDeploymentArtifactForType(String artifactType) throws IOException, Exception {
+		return getArtifactByType(DEFAULT_ARTIFACT_LABEL, artifactType, true, false);
+	}
+
+	public static ArtifactReqDetails getArtifactByType(ArtifactTypeEnum artifactLabel, ArtifactTypeEnum artifactType, Boolean deploymentTrue) throws IOException, Exception {
+		return getArtifactByType(DEFAULT_ARTIFACT_LABEL, artifactType.toString(), deploymentTrue, false);
+
+	}
+
+	public static ArtifactReqDetails getArtifactByType(String artifactLabel, String artifactType, Boolean deploymentTrue, Boolean updatedPayload) throws IOException, Exception {
+		String artifactName;
+		String updatedPayloadData =null;
+		String payloadData = null;
+		Integer timeout = null;
+		String url = "";
+		String artifactDescription = "descriptionTest";
+
+		// PLEASE NOTE!!!
+		// The non-default payloads here are real ones according to various
+		// types validations,
+		// Please don't change them unless you know what you are doing!
+
+		ArtifactTypeEnum artifactTypeEnum = ArtifactTypeEnum.findType(artifactType);
+
+		/*
+		 * Missing file type: DCAE_JSON
+		 */
+		switch (artifactTypeEnum) {
+		case DCAE_INVENTORY_TOSCA:
+		case DCAE_EVENT:
+		case APPC_CONFIG:
+		case DCAE_DOC:
+		case DCAE_TOSCA:
+		case HEAT:
+		case HEAT_NET:
+		case HEAT_VOL: {
+			artifactName = generateUUIDforSufix() + artifactType + "_install_apache2.yaml";
+			payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
+			updatedPayloadData = "dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCg0Kbm9kZV90eXBlczoNCiAgY29tLmF0dC5kMi5yZXNvdXJjZS5jcC5DUDoNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLm5ldHdvcmsuUG9ydA0KICAgIHByb3BlcnRpZXM6DQogICAgICBpc190YWdnZWQ6DQogICAgICAgIHR5cGU6IGJvb2xlYW4NCiAgICAgICAgcmVxdWlyZWQ6IGZhbHNlDQogICAgICAgIGRlZmF1bHQ6IGZhbHNlDQogICAgICAgIGRlc2NyaXB0aW9uOiANCg0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gdmlydHVhbExpbms6DQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLm5ldHdvcmsuTGlua2FibGUNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMubmV0d29yay5MaW5rc1RvDQogICAgICAtIHZpcnR1YWxCaW5kaW5nOg0KICAgICAgICAgIGNhcGFiaWxpdHk6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQogICAgICAgICAgcmVsYXRpb25zaGlwOiB0b3NjYS5yZWxhdGlvbnNoaXBzLm5ldHdvcmsuQmluZHNUbw0KICAgIGNhcGFiaWxpdGllczoNCiAgICAgIGF0dGFjaG1lbnQ6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5BdHRhY2htZW50DQogICAgICAgIG9jY3VycmVuY2VzOg0KICAgICAgICAtIDENCiAgICAgICAgLSBVTkJPVU5ERUQNCiAgICAgICAgdHlwZTogdG9zY2EuY2FwYWJpbGl0aWVzLm5ldHdvcmsuQmluZGFibGUNCiAgICAgICAgb2NjdXJyZW5jZXM6DQogICAgICAgIC0gMQ0KICAgICAgICAtIFVOQk9VTkRFRA0KICAgICAgdmlydHVhbF9saW5rYWJsZToNCiAgICAgICAgdHlwZTogY29tLmF0dC5kMi5jYXBhYmlsaXRpZXMuTWV0cmljDQogICAgICBlbmRfcG9pbnQ6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5FbmRwb2ludCAgICAgICA=";
+			timeout = 60;
+			artifactLabel = normalizeArtifactLabel(artifactName);
+			break;
+		}
+		case DCAE_INVENTORY_POLICY:
+		case DCAE_INVENTORY_BLUEPRINT:
+		case DCAE_INVENTORY_EVENT: {
+			artifactName = getDcaeArtifactName(artifactTypeEnum, artifactType);
+			payloadData = "will be override later";
+			updatedPayloadData = "override";
+			timeout = 60;
+			artifactLabel = normalizeArtifactLabel(artifactName);
+			break;
+		}
+		case MURANO_PKG: {
+			artifactName = artifactType + "org.openstack.Rally.zip";
+			payloadData = "ODM4MTRjNzkxZjcwYTlkMjk4ZGQ2ODE4MThmNjg0N2Y=";
+			updatedPayloadData = "ODM4MTRjNzkxZjcwYTlkMjk4ZGQ2ODE4MThmMTAwN2Y=";
+			break;
+		}
+		case DCAE_POLICY: {
+			artifactName = artifactType + "dcae_policy.emf";
+			payloadData = "will be override later";
+			updatedPayloadData = "override";
+			break;
+		}
+		case DCAE_INVENTORY_JSON:
+		case DCAE_JSON: {
+			artifactName = artifactType + "dcae_policy.json";
+			payloadData = "ew0KICAiYXJ0aWZhY3RzIjogImRmc2FmIiwNCiAgIm5vcm1hbGl6ZWROYW1lIjogImNpc2VydmljZTBiYzY5ODk2OTQ4ZiIsDQogICJzeXN0ZW1OYW1lIjogIkNpc2VydmljZTBiYzY5ODk2OTQ4ZiIsDQogICJpbnZhcmlhbnRVVUlEIjogIjEzZmJkNzI3LWRjNzUtNDU1OS1iNzEyLWUwMjc5YmY4YTg2MSIsDQogICJhdHRDb250YWN0IjogImNzMDAwOCIsDQogICJuYW1lIjogImNpU2VydmljZTBiYzY5ODk2OTQ4ZiINCn0=";
+			updatedPayloadData = "ew0KICAiYXJ0aWZhY3RzIjogIjEyMzQzIiwNCiAgIm5vcm1hbGl6ZWROYW1lIjogIjU0MzUzNCIsDQogICJzeXN0ZW1OYW1lIjogIkNpc2VydmljZTBiYzY5ODk2OTQ4ZiIsDQogICJpbnZhcmlhbnRVVUlEIjogIjEzZmJkNzI3LWRjNzUtNDU1OS1iNzEyLWUwMjc5YmY4YTg2MSIsDQogICJhdHRDb250YWN0IjogImNzMDAwOCIsDQogICJuYW1lIjogImNpU2VydmljZTBiYzY5ODk2OTQ4ZiINCn0=";
+			break;
+		}
+		case PUPPET:
+		case CHEF:
+		case DG_XML:
+		case YANG: {
+			artifactName = generateUUIDforSufix() + artifactType + "yangXml.xml";
+			payloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTg3LTA2LTI0VDAwOjAwOjAwLTAwOjAwPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
+			updatedPayloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTkwLTA2LTI0VDAwOjAwOjAwLTAwOjExPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
+			timeout = 15;
+			artifactLabel = normalizeArtifactLabel(artifactName);
+			break;
+		}
+		case VF_LICENSE:
+		case VENDOR_LICENSE:
+		case MODEL_INVENTORY_PROFILE:
+		case MODEL_QUERY_SPEC:
+		case VNF_CATALOG:
+		case YANG_XML: {
+			artifactName = generateUUIDforSufix() + artifactType + "yangXml.xml";
+			payloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTg3LTA2LTI0VDAwOjAwOjAwLTAwOjAwPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
+			updatedPayloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTkwLTA2LTI0VDAwOjAwOjAwLTAwOjExPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
+			timeout = 0;
+			artifactLabel = normalizeArtifactLabel(artifactName);
+			break;
+		}
+		case SNMP_POLL:
+		case SNMP_TRAP:
+		case DCAE_INVENTORY_DOC:
+		case GUIDE:
+		case OTHER: {
+			artifactName = generateUUIDforSufix() + artifactType + "other.pdf";
+			payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
+			updatedPayloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDE2LTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGRzYWRzYWRzYWUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFkc2FkYXN3Z2UgbmFtZSBmb3IgaW5zdGFuY2UxDQogICAgZGVmYXVsdDogY2lycm9zLTAuMy4xLXg4Nl82NA0KICBpbWFnZV9uYW1lXzI6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTINCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIG5ldHdvcmtfaWQ6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IE5ldHdvcmsgSUQNCiAgICBkZXNjcmlwdGlvbjogU0NPTkVUV09SSyBOZXR3b3JrIHRvIGJlIHVzZWQgZm9yIHRoZSBjb21wdXRlIGluc3RhbmNlDQogICAgaGlkZGVuOiB0cnVlDQogICAgY29uc3RyYWludHM6DQogICAgICAtIGxlbmd0aDogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBsZW5ndGggbXVzdCBiZSBiZXR3ZWVuIDYgYW5kIDggY2hhcmFjdGVycy4NCiAgICAgIC0gcmFuZ2U6IHsgbWluOiA2LCBtYXg6IDggfQ0KICAgICAgICBkZXNjcmlwdGlvbjogUmFuZ2UgZGVzY3JpcHRpb24NCiAgICAgIC0gYWxsb3dlZF92YWx1ZXM6DQogICAgICAgIC0gbTEuc21hbGwNCiAgICAgICAgLSBtMS5tZWRpdW0NCiAgICAgICAgLSBtMS5sYXJnZQ0KICAgICAgICBkZXNjcmlwdGlvbjogQWxsb3dlZCB2YWx1ZXMgZGVzY3JpcHRpb24NCiAgICAgIC0gYWxsb3dlZF9wYXR0ZXJuOiAiW2EtekEtWjAtOV0rIg0KICAgICAgICBkZXNjcmlwdGlvbjogUGFzc3dvcmQgbXVzdCBjb25zaXN0IG9mIGNoYXJhY3RlcnMgYW5kIG51bWJlcnMgb25seS4NCiAgICAgIC0gYWxsb3dlZF9wYXR0ZXJuOiAiW0EtWl0rW2EtekEtWjAtOV0qIg0KICAgICAgICBkZXNjcmlwdGlvbjogUGFzc3dvcmQgbXVzdCBzdGFydCB3aXRoIGFuIHVwcGVyY2FzZSBjaGFyYWN0ZXIuDQogICAgICAtIGN1c3RvbV9jb25zdHJhaW50OiBub3ZhLmtleXBhaXINCiAgICAgICAgZGVzY3JpcHRpb246IEN1c3RvbSBkZXNjcmlwdGlvbg0KDQpyZXNvdXJjZXM6DQogIG15X2luc3RhbmNlMToNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8xIH0NCiAgICAgIGZsYXZvcjogbTEuc21hbGwNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICAtIG5ldHdvcmsgOiB7IGdldF9wYXJhbSA6IG5ldHdvcmtfaWQgfQ0KICBteV9pbnN0YW5jZTI6DQogICAgdHlwZTogT1M6Ok5vdmE6OlNlcnZlcg0KICAgIHByb3BlcnRpZXM6DQogICAgICBpbWFnZTogeyBnZXRfcGFyYW06IGltYWdlX25hbWVfMiB9DQogICAgICBmbGF2b3I6IG0xLnRpbnkNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICAtIG5ldHdvcmsgOiB7IGdldF9wYXJhbSA6IG5ldHdvcmtfaWQgfQ";
+			timeout = 0;
+			artifactLabel = normalizeArtifactLabel(artifactName);
+			break;
+		}
+		case SHELL_SCRIPT:
+		default: {// dummy
+			artifactName = generateUUIDforSufix() + "testArtifact.sh";
+			payloadData = "dGVzdA==";
+			updatedPayloadData = "YmVzYg==";
+			artifactLabel = normalizeArtifactLabel(artifactName);
+			break;
+		}
+		}
+		artifactLabel = normalizeArtifactLabel("ci" + artifactName);
+		
+		ArtifactReqDetails artifactDetails = null;
+		
+		if (!updatedPayload){
+		artifactDetails = new ArtifactReqDetails(artifactName, artifactType, artifactDescription, payloadData, artifactLabel);
+		}
+		else artifactDetails = new ArtifactReqDetails(artifactName, artifactType, artifactDescription,
+				updatedPayloadData, artifactLabel);
+		
+		artifactDetails.setArtifactGroupType(ArtifactGroupTypeEnum.DEPLOYMENT.getType());
+		artifactDetails.setUrl(url);
+		artifactDetails.setTimeout(timeout);
+		artifactDetails.setArtifactDisplayName(artifactLabel);
+		return artifactDetails;
+	}
+
+	private static String getDcaeArtifactName(ArtifactTypeEnum artifactTypeEnum, String artifactType) {
+		String artifactName = null;
+		switch (artifactTypeEnum) {
+		case DCAE_INVENTORY_TOSCA: {
+			artifactName = generateUUIDforSufix() + artifactType + "_toscaSampleArtifact.yml";
+			break;
+		}
+		case DCAE_INVENTORY_JSON: {
+			artifactName = generateUUIDforSufix() + artifactType + "_jsonSampleArtifact.json";
+			break;
+		}
+		case DCAE_INVENTORY_POLICY: {
+			artifactName = generateUUIDforSufix() + artifactType + "_emfSampleArtifact.emf";
+			break;
+		}
+		case DCAE_INVENTORY_DOC: {
+			artifactName = generateUUIDforSufix() + artifactType + "_docSampleArtifact.doc";
+			break;
+		}
+		case DCAE_INVENTORY_BLUEPRINT: {
+			artifactName = generateUUIDforSufix() + artifactType + "_bluePrintSampleArtifact.xml";
+			break;
+		}
+		case DCAE_INVENTORY_EVENT: {
+			artifactName = generateUUIDforSufix() + artifactType + "_eventSampleArtifact.xml";
+			break;
+		}
+		}
+		return artifactName;
+	}
+
+	// ---------------------Audit message------------------
+	public static ExpectedResourceAuditJavaObject getDefaultImportResourceAuditMsgSuccess() {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.IMPORT_RESOURCE.getName());
+		expectedResourceAuditJavaObject.setResourceName("defaultImportResourceName.yaml");
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("0.1");
+		expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setToscaNodeType("");
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public static ExpectedResourceAuditJavaObject getDefaultImportResourceAuditMsgFailure(ErrorInfo errorInfo, List<String> variables) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.IMPORT_RESOURCE.getName());
+		expectedResourceAuditJavaObject.setResourceName("");
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		expectedResourceAuditJavaObject.setToscaNodeType("");
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public static ExpectedResourceAuditJavaObject getDefaultCertificationRequestAuditMsgSuccess() {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CERTIFICATION_REQUEST_RESOURCE.getName());
+		expectedResourceAuditJavaObject.setResourceName("defaultResourceName");
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("0.1");
+		expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setComment("");
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public static ExpectedResourceAuditJavaObject getDefaultCertificationRequestAuditMsgFailure(ErrorInfo errorInfo, List<String> variables) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CERTIFICATION_REQUEST_RESOURCE.getName());
+		expectedResourceAuditJavaObject.setResourceName("");
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		expectedResourceAuditJavaObject.setCurrVersion("0.1");
+		expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
+		expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		expectedResourceAuditJavaObject.setComment("");
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultExternalAuditObject(AssetTypeEnum assetType, AuditingActionEnum action, String query) {
+
+		ExpectedExternalAudit expectedExternalAudit = new ExpectedExternalAudit();
+		expectedExternalAudit.setACTION(action.getName());
+		expectedExternalAudit.setCONSUMER_ID("ci");
+		expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetType.getValue() + (query == null ? "" : query));
+		expectedExternalAudit.setSTATUS("200");
+		expectedExternalAudit.setDESC("OK");
+		return expectedExternalAudit;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultAssetListAudit(AssetTypeEnum assetType, AuditingActionEnum auditAction) {
+
+		// ExpectedExternalAudit expectedAssetListAuditJavaObject = new
+		// ExpectedExternalAudit();
+		ExpectedExternalAudit expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, auditAction, null);
+		return expectedAssetListAuditJavaObject;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultFilteredAssetListAudit(AssetTypeEnum assetType, String query) {
+
+		// ExpectedExternalAudit expectedAssetListAuditJavaObject = new
+		// ExpectedExternalAudit();
+		ExpectedExternalAudit expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_FILTERED_ASSET_LIST, query);
+		return expectedAssetListAuditJavaObject;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultExternalArtifactAuditSuccess(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID) {
+
+		// ExpectedExternalAudit expectedExternalArtifactAudit = new
+		// ExpectedExternalAudit();
+
+		ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalAuditObject(assetType, action, null);
+		expectedExternalArtifactAudit.setMODIFIER(AuditValidationUtils.getModifierString(artifactDefinition.getUpdaterFullName(), artifactDefinition.getUserIdLastUpdater()));
+		expectedExternalArtifactAudit.setPREV_ARTIFACT_UUID("");
+		expectedExternalArtifactAudit.setCURR_ARTIFACT_UUID(artifactDefinition.getArtifactUUID());
+		expectedExternalArtifactAudit.setARTIFACT_DATA(AuditValidationUtils.buildArtifactDataAudit(artifactDefinition));
+		expectedExternalArtifactAudit.setRESOURCE_URL(expectedExternalArtifactAudit.getRESOURCE_URL() + "/" + componentUUID + "/artifacts");
+		return expectedExternalArtifactAudit;
+
+	}
+	
+	public static ExpectedExternalAudit getDefaultExternalArtifactAuditSuccess(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, Component component) {
+
+		 //ExpectedExternalAudit expectedExternalArtifactAudit = new ExpectedExternalAudit();
+		
+		ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalAuditObject(assetType, action, null);
+		expectedExternalArtifactAudit.setMODIFIER(AuditValidationUtils.getModifierString(artifactDefinition.getUpdaterFullName(), artifactDefinition.getUserIdLastUpdater()));
+		expectedExternalArtifactAudit.setPREV_ARTIFACT_UUID("");
+		expectedExternalArtifactAudit.setCURR_ARTIFACT_UUID(artifactDefinition.getArtifactUUID());
+		expectedExternalArtifactAudit.setARTIFACT_DATA(AuditValidationUtils.buildArtifactDataAudit(artifactDefinition));
+		expectedExternalArtifactAudit.setRESOURCE_URL(expectedExternalArtifactAudit.getRESOURCE_URL() + "/" + component.getUUID() + "/artifacts");
+		expectedExternalArtifactAudit.setRESOURCE_NAME(component.getName());
+		expectedExternalArtifactAudit.setRESOURCE_TYPE(component.getComponentType().getValue());
+		return expectedExternalArtifactAudit;
+		
+	}
+	
+	public static ExpectedResourceAuditJavaObject getDefaultCreateResourceExternalAPI(String resourceName) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CREATE_RESOURCE_BY_API.getName());
+		expectedResourceAuditJavaObject.setResourceName(resourceName);
+		expectedResourceAuditJavaObject.setResourceType("Resource");
+		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+		expectedResourceAuditJavaObject.setRESOURCE_URL("/sdc/v1/catalog/resources");
+		expectedResourceAuditJavaObject.setMODIFIER("");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("0.1");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		
+		return expectedResourceAuditJavaObject;
+		
+		
+	}
+	
+	public static ExpectedResourceAuditJavaObject getDefaultChangeAssetLifeCycleExternalAPI(Component resourceAssetStructure, User defaultUser, LifeCycleStatesEnum lifecycleStateEnum, AssetTypeEnum assetTypeEnum) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CHANGE_LIFECYCLE_BY_API.getName());
+		expectedResourceAuditJavaObject.setResourceName(resourceAssetStructure.getName());
+		expectedResourceAuditJavaObject.setResourceType(assetTypeEnum.getCorrespondingComponent());
+		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+		expectedResourceAuditJavaObject.setRESOURCE_URL(String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", assetTypeEnum.getValue().toLowerCase(), resourceAssetStructure.getUUID(), lifecycleStateEnum.getState()));
+		expectedResourceAuditJavaObject.setMODIFIER(defaultUser.getFullName() + "(" + defaultUser.getUserId() + ")");
+		expectedResourceAuditJavaObject.setPrevVersion("0.1");
+		expectedResourceAuditJavaObject.setCurrVersion("0.1");
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		// TODO: Remove comment
+//		expectedResourceAuditJavaObject.setINVARIANT_UUID(resourceAssetStructure.getInvariantUUID());
+		// TODO: SERVICE_INSTANCE_ID
+		expectedResourceAuditJavaObject.setStatus("201");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		
+		return expectedResourceAuditJavaObject;
+		
+	}
+	
+	public static ExpectedResourceAuditJavaObject getDefaultInvalidChangeAssetLifeCycleExternalAPI(String assetUUID, User defaultUser, LifeCycleStatesEnum lifecycleStateEnum, AssetTypeEnum assetTypeEnum) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+		expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CHANGE_LIFECYCLE_BY_API.getName());
+		expectedResourceAuditJavaObject.setResourceName("");
+		expectedResourceAuditJavaObject.setResourceType(assetTypeEnum.getCorrespondingComponent());
+		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+		expectedResourceAuditJavaObject.setRESOURCE_URL(String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", assetTypeEnum.getValue().toLowerCase(), assetUUID, lifecycleStateEnum.getState()));
+		expectedResourceAuditJavaObject.setMODIFIER("");
+		expectedResourceAuditJavaObject.setMODIFIER(defaultUser.getFullName() + "(" + defaultUser.getUserId() + ")");
+		expectedResourceAuditJavaObject.setPrevVersion("");
+		expectedResourceAuditJavaObject.setCurrVersion("");
+		expectedResourceAuditJavaObject.setPrevState("");
+		expectedResourceAuditJavaObject.setCurrState("");
+		expectedResourceAuditJavaObject.setStatus("404");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		
+		return expectedResourceAuditJavaObject;
+		
+	}
+
+	public static ExpectedExternalAudit getDefaultExternalArtifactAuditSuccess(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID, String resourceInstanceName) {
+
+		ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalArtifactAuditSuccess(assetType, action, artifactDefinition, componentUUID);
+		expectedExternalArtifactAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetType.getValue() + "/" + componentUUID + "/resourceInstances/" + resourceInstanceName + "/artifacts");
+		return expectedExternalArtifactAudit;
+	}
+
+	public static ExpectedExternalAudit getDefaultExternalArtifactAuditFailure(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID, ErrorInfo errorInfo, List<String> variables) {
+
+		// ExpectedExternalAudit expectedExternalArtifactAudit = new
+		// ExpectedExternalAudit();
+
+		ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalAuditObject(assetType, action, null);
+		expectedExternalArtifactAudit.setMODIFIER(AuditValidationUtils.getModifierString(artifactDefinition.getUpdaterFullName(), artifactDefinition.getUserIdLastUpdater()));
+		expectedExternalArtifactAudit.setPREV_ARTIFACT_UUID("");
+		expectedExternalArtifactAudit.setCURR_ARTIFACT_UUID(artifactDefinition.getArtifactUUID());
+		expectedExternalArtifactAudit.setARTIFACT_DATA(AuditValidationUtils.buildArtifactDataAudit(artifactDefinition));
+		expectedExternalArtifactAudit.setRESOURCE_URL(expectedExternalArtifactAudit.getRESOURCE_URL() + "/" + componentUUID + "/artifacts");
+		expectedExternalArtifactAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedExternalArtifactAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		return expectedExternalArtifactAudit;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultExternalArtifactAuditFailure(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID, ErrorInfo errorInfo, List<String> variables,
+			String resourceInstanceName) {
+
+		ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalArtifactAuditFailure(assetType, action, artifactDefinition, componentUUID, errorInfo, variables);
+		expectedExternalArtifactAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetType.getValue() + "/" + componentUUID + "/resourceInstances/" + resourceInstanceName + "/artifacts");
+		return expectedExternalArtifactAudit;
+	}
+
+	public static ExpectedExternalAudit getFilteredAssetListAuditCategoryNotFound(AssetTypeEnum assetType, String query, String category) {
+
+		// ExpectedExternalAudit expectedAssetListAuditJavaObject = new
+		// ExpectedExternalAudit();
+		ExpectedExternalAudit expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_FILTERED_ASSET_LIST, query);
+		expectedAssetListAuditJavaObject.setSTATUS("404");
+		ErrorInfo errorInfo = null;
+		try {
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		String desc = (errorInfo.getMessageId() + ": " + errorInfo.getMessage()).replace("%2", "category").replace("%3", category).replace("%1", "resource");
+		expectedAssetListAuditJavaObject.setDESC(desc);
+
+		return expectedAssetListAuditJavaObject;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultAssetMetadataAudit(AssetTypeEnum assetType, Component component) {
+
+		ExpectedExternalAudit expectedAssetListAuditJavaObject = new ExpectedExternalAudit();
+		expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_ASSET_METADATA, null);
+		expectedAssetListAuditJavaObject.setRESOURCE_URL(expectedAssetListAuditJavaObject.getRESOURCE_URL() + "/" + component.getUUID() + "/metadata");
+		expectedAssetListAuditJavaObject.setRESOURCE_NAME(component.getName());
+		expectedAssetListAuditJavaObject.setRESOURCE_TYPE(component.getComponentType().getValue());
+		expectedAssetListAuditJavaObject.setSERVICE_INSTANCE_ID(component.getUUID());
+		return expectedAssetListAuditJavaObject;
+
+	}
+
+	public static ExpectedExternalAudit getDefaultAssetMetadataAuditFailure(AssetTypeEnum assetType, String serviceUuid, String resourceType) {
+
+		ExpectedExternalAudit expectedAssetListAuditJavaObject = new ExpectedExternalAudit();
+		expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_ASSET_METADATA, null);
+		expectedAssetListAuditJavaObject.setSTATUS("404");
+		expectedAssetListAuditJavaObject.setDESC("OK");
+		expectedAssetListAuditJavaObject.setRESOURCE_URL(expectedAssetListAuditJavaObject.getRESOURCE_URL() + "/" + serviceUuid + "/metadata");
+		expectedAssetListAuditJavaObject.setRESOURCE_TYPE(resourceType);
+		expectedAssetListAuditJavaObject.setSERVICE_INSTANCE_ID(serviceUuid);
+		return expectedAssetListAuditJavaObject;
+
+	}
+
+	// Category/Subcategory/Group
+	public static CategoryDefinition getDefaultCategory() {
+		CategoryDefinition productCategoryDefinition = new CategoryDefinition();
+		productCategoryDefinition.setName("CiCateg" + generateUUIDforSufix());
+		return productCategoryDefinition;
+	}
+
+	public static SubCategoryDefinition getDefaultSubCategory() {
+		SubCategoryDefinition productSubCategoryDefinition = new SubCategoryDefinition();
+		productSubCategoryDefinition.setName("CiSubCateg" + generateUUIDforSufix());
+		return productSubCategoryDefinition;
+	}
+
+	public static GroupingDefinition getDefaultGroup() {
+		GroupingDefinition productGroupDefinition = new GroupingDefinition();
+		productGroupDefinition.setName("CiGrouping1" + generateUUIDforSufix());
+		return productGroupDefinition;
+	}
+
+	// Product
+
+	public static ProductReqDetails getDefaultProduct() {
+		return createDefaultProductReqDetails(CI_PRODUCT, null);
+	}
+
+	public static ProductReqDetails getDefaultProduct(String name) {
+		return createDefaultProductReqDetails(name, null);
+	}
+
+	public static ProductReqDetails getDefaultProduct(CategoryDefinition category) {
+		List<CategoryDefinition> categories = new ArrayList<>();
+		categories.add(category);
+		return createDefaultProductReqDetails(CI_PRODUCT, categories);
+	}
+
+	public static ProductReqDetails getDefaultProduct(String name, CategoryDefinition category) {
+		List<CategoryDefinition> categories = new ArrayList<>();
+		categories.add(category);
+		return createDefaultProductReqDetails(name, categories);
+	}
+
+	public static ProductReqDetails getDefaultProduct(List<CategoryDefinition> categories) {
+		return createDefaultProductReqDetails(CI_PRODUCT, categories);
+	}
+
+	public static ProductReqDetails getDefaultProduct(String name, List<CategoryDefinition> categories) {
+		return createDefaultProductReqDetails(name, categories);
+	}
+
+	private static ProductReqDetails createDefaultProductReqDetails(String productName, List<CategoryDefinition> categories) {
+		ProductReqDetails product = new ProductReqDetails(productName);
+		productName = (productName + generateUUIDforSufix());
+		product.setName(productName);
+		ArrayList<String> tags = new ArrayList<String>();
+		tags.add(productName);
+		product.setTags(tags);
+		product.setProjectCode("12345");
+		product.setIcon("myIcon");
+		ArrayList<String> contacts = new ArrayList<String>();
+		// contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1).getUserId());
+		// contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST2).getUserId());
+		contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1).getUserId());
+		// contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER2).getUserId());
+		product.setContacts(contacts);
+		product.setContactId(UserRoleEnum.PRODUCT_MANAGER1.getUserId());
+		product.setCategories(categories);
+		String fullName = "This is my full name: " + productName;
+		product.setFullName(fullName);
+		String description = "This is product description";
+		product.setDescription(description);
+		return product;
+	}
+
+	public static RequirementCapabilityRelDef getReqCapRelation(String fromCompInstId, String toCompInstId, String reqOwnerId, String capOwnerId, String capType, String reqCapName, List<CapabilityDefinition> capList,
+			List<RequirementDefinition> reqList) {
+		RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
+		requirementDef.setFromNode(fromCompInstId);
+		requirementDef.setToNode(toCompInstId);
+		RequirementAndRelationshipPair pair = new RequirementAndRelationshipPair();
+		pair.setRequirementOwnerId(reqOwnerId);
+		pair.setCapabilityOwnerId(capOwnerId);
+		pair.setRequirement(reqCapName);
+		RelationshipImpl relationship = new RelationshipImpl();
+		relationship.setType(capType);
+		pair.setRelationships(relationship);
+		pair.setCapabilityUid(capList.get(0).getUniqueId());
+		pair.setRequirementUid(reqList.get(0).getUniqueId());
+		List<RequirementAndRelationshipPair> relationships = new ArrayList<>();
+		relationships.add(pair);
+		requirementDef.setRelationships(relationships);
+		return requirementDef;
+	}
+
+	private static String generateUUIDforSufix() {
+
+		String uniqueSufix = UUID.randomUUID().toString();
+		String[] split = uniqueSufix.split("-");
+		return uniqueSufix = split[4];
+	}
+
+	private static String normalizeArtifactLabel(String label) {
+
+		label = label.substring(0, label.indexOf("."));
+		String normalizedLabel = ValidationUtils.normalizeArtifactLabel(label);
+		return normalizedLabel.substring(0, Math.min(25, normalizedLabel.length()));
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java
new file mode 100644
index 0000000..28964e2
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java
@@ -0,0 +1,137 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.general;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.openecomp.sdc.ci.tests.utils.Decoder;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import fj.data.Either;
+
+public class FileUtils {
+	static Logger logger = LoggerFactory.getLogger(Utils.class.getName());
+
+	public static void writeToFile(String filePath, String content) {
+		try {
+			Files.write(Paths.get(filePath), content.getBytes());
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static String getFileName(String fullyQualified) {
+		String fileName = fullyQualified;
+
+		int i = fullyQualified.lastIndexOf('.');
+		if (i > 0) {
+			fileName = fullyQualified.substring(i + 1);
+		}
+		return fileName;
+
+	}
+
+	public static Either<String, Exception> getFileContentUTF8(String filePath) {
+		Either<String, Exception> eitherResult;
+		try {
+			String content = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);
+			eitherResult = Either.left(content);
+		} catch (Exception e) {
+			eitherResult = Either.right(e);
+		}
+		return eitherResult;
+	}
+
+	public static List<String> getFileListFromBaseDirectoryByTestName(String testResourcesPath) {
+
+		File file = new File(testResourcesPath);
+		File[] listFiles = file.listFiles();
+		if (listFiles != null) {
+			List<String> listFileName = new ArrayList<String>();
+			for (File newFile : listFiles) {
+				if (newFile.isFile()) {
+					listFileName.add(newFile.getPath());
+				}
+			}
+			return listFileName;
+		}
+		assertTrue("directory " + testResourcesPath + " is empty", false);
+		return null;
+	}
+
+	public static String getFilePathFromListByPattern(List<String> fileList, String pattern) {
+
+		for (String filePath : fileList) {
+			if (filePath.contains(pattern)) {
+				return filePath;
+			}
+		}
+		return null;
+	}
+
+	public static String loadPayloadFileFromListUsingPosition(List<String> listFileName, String pattern,
+			Boolean isBase64, int positionInList) throws IOException {
+		List<String> newList = new ArrayList<String>(Arrays.asList(listFileName.get(positionInList)));
+		return loadPayloadFile(newList, pattern, isBase64);
+	}
+
+	public static String loadPayloadFile(List<String> listFileName, String pattern, Boolean isBase64)
+			throws IOException {
+		String fileName;
+		String payload = null;
+		fileName = FileUtils.getFilePathFromListByPattern(listFileName, pattern);
+		logger.debug("fileName: {}", fileName);
+
+		if (fileName != null) {
+			payload = Decoder.readFileToString(fileName);
+			if (isBase64) {
+				payload = Decoder.encode(payload.getBytes());
+			}
+		} else {
+			assertTrue("file to upload not found", false);
+		}
+		return payload;
+	}
+
+	public static String getFileNameFromPath(String testResourcesPath) {
+
+		File file = new File(testResourcesPath);
+		String fileName = null;
+		if (file.exists()) {
+			return file.getName();
+		} else {
+			assertTrue("file to upload not found", false);
+		}
+		return fileName;
+
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java
new file mode 100644
index 0000000..c1f311a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.general;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+public class ImportUtils {
+
+	public static ImportReqDetails getImportResourceDetailsByPathAndName(ImportReqDetails importReqDetails,
+			String filePath, String fileName) throws IOException {
+
+		// ImportReqDetails importReqDetails;
+		// User sdncUserDetails;
+		// String testResourcesPath;
+		// ResourceReqDetails resourceDetails;
+		// Config config;
+		// config = Utils.getConfig();
+		//
+		// importReqDetails = ElementFactory.getDefaultImportResource();
+		// User sdncUserDetails =
+		// ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		// ResourceReqDetails resourceDetails =
+		// ElementFactory.getDefaultResource();
+		// String sourceDir = config.getResourceConfigDir();
+		// String testResourcesPath = sourceDir + File.separator + workDir;
+		// final String workDir = "importToscaResourceByCreateUrl";
+
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(filePath);
+		importReqDetails.setPayloadName(fileName);
+		String payloadData = FileUtils.loadPayloadFile(listFileName, fileName, true);
+		importReqDetails.setPayloadData(payloadData);
+
+		return importReqDetails;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java
new file mode 100644
index 0000000..a7ab544
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java
@@ -0,0 +1,934 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.util.ValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.AssertJUnit;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
+public class ArtifactRestUtils extends BaseRestUtils {
+	private static Logger logger = LoggerFactory.getLogger(ArtifactRestUtils.class.getName());
+	
+	
+	// External API
+	// Delete Artifact on rI of the asset 
+	public static RestResponse externalAPIDeleteArtifactOfComponentInstanceOnAsset(Component component, User user, ComponentInstance resourceInstance, String artifactUUID) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		String resourceInstanceName = resourceInstance.getNormalizedName();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName, artifactUUID);
+		
+		return deleteInformationalArtifact(user, url);
+	}
+	
+	// Delete Artifact of the asset 
+	public static RestResponse externalAPIDeleteArtifactOfTheAsset(Component component, User user, String artifactUUID) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, artifactUUID);
+		
+		RestResponse restResponse = deleteInformationalArtifact(user, url);
+		
+		return restResponse;
+	}
+	
+	
+	// Update Artifact on rI of the asset 
+	public static RestResponse externalAPIUpdateArtifactOfComponentInstanceOnAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, ComponentInstance resourceInstance, String artifactUUID) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		String resourceInstanceName = resourceInstance.getNormalizedName();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName, artifactUUID);
+		
+		return updateInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
+	}
+	
+	// Update Artifact of the asset 
+	public static RestResponse externalAPIUpdateArtifactOfTheAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, String artifactUUID) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, artifactUUID);
+		
+		return updateInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
+	}
+	
+	
+	// Upload Artifact on rI of the asset 
+	public static RestResponse externalAPIUploadArtifactOfComponentInstanceOnAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, ComponentInstance resourceInstance) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		String resourceInstanceName = resourceInstance.getNormalizedName();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName);
+		
+		return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
+	}
+	
+	// Upload Artifact of the asset 
+	public static RestResponse externalAPIUploadArtifactOfTheAsset(Component component, User user, ArtifactReqDetails artifactReqDetails) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID);
+		
+		return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
+	}
+	
+	
+	// Upload Artifact of the asset with invalid checksum
+	public static RestResponse externalAPIUploadArtifactWithInvalidCheckSumOfComponentInstanceOnAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, ComponentInstance resourceInstance) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		String resourceInstanceName = resourceInstance.getNormalizedName();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName);
+		
+		return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails) + "123", url);
+	}
+		
+	// Upload Artifact of the asset with invalid checksum
+	public static RestResponse externalAPIUploadArtifactWithInvalidCheckSumOfTheAsset(Component component, User user, ArtifactReqDetails artifactReqDetails) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceType = null;
+		String resourceUUID = component.getUUID();
+		
+		System.out.println(component.getComponentType());
+		
+		if(component.getComponentType().toString().toLowerCase().equals("resource")) {
+			resourceType = "resources";
+		} else {
+			resourceType = "services";
+		}
+		
+		String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID);
+		
+		return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails) + "123", url);
+	}
+	
+	
+	//
+	// Testing
+	//
+	public static RestResponse getResourceDeploymentArtifactExternalAPI(String resourceUUID, String artifactUUID,User sdncModifierDetails, String resourceType) throws IOException {
+		Config config = Utils.getConfig();
+		String url = null;
+		
+		if (resourceType.toUpperCase().equals("SERVICE")) {
+			url = String.format(Urls.GET_DOWNLOAD_SERVICE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, artifactUUID);
+
+		} else {
+			url = String.format(Urls.GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, artifactUUID);
+		}
+		
+		Map<String, String> headersMap = new HashMap<String,String>();
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		
+		HttpRequest http = new HttpRequest();
+
+		logger.debug("Send GET request to get Resource Assets: {}", url);
+		System.out.println("Send GET request to get Resource Assets: " + url);
+		
+		logger.debug("Request headers: {}", headersMap);
+		System.out.println("Request headers: " + headersMap);
+
+		RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
+
+		return sendGetResourceAssets;
+
+	}
+	
+	
+	
+	public static RestResponse getComponentInstanceDeploymentArtifactExternalAPI(String resourceUUID, String componentNormalizedName, String artifactUUID,User sdncModifierDetails, String resourceType) throws IOException {
+		Config config = Utils.getConfig();
+		String url = null;
+		
+		if (resourceType.toLowerCase().equals("service")) {
+			url = String.format(Urls.GET_DOWNLOAD_SERVICE_ARTIFACT_OF_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, componentNormalizedName, artifactUUID);
+
+		} else {
+			url = String.format(Urls.GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, componentNormalizedName, artifactUUID);
+		}
+		
+		Map<String, String> headersMap = new HashMap<String,String>();
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		
+		HttpRequest http = new HttpRequest();
+
+		logger.debug("Send GET request to get Resource Assets: {}", url);
+		System.out.println("Send GET request to get Resource Assets: " + url);
+		
+		logger.debug("Request headers: {}", headersMap);
+		System.out.println("Request headers: " + headersMap);
+
+		RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
+
+		return sendGetResourceAssets;
+
+	}
+	
+	
+	//***********  SERVICE ****************
+	public static RestResponse getArtifactTypesList() throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_ARTIFACTS, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+	}
+
+	public static RestResponse addInformationalArtifactToService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid) throws IOException {
+		return addInformationalArtifactToService(artifactDetails, sdncModifierDetails, serviceUid, calculateChecksum(artifactDetails));
+	}
+
+	public static RestResponse addInformationalArtifactToService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String checksum) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.ADD_ARTIFACT_TO_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceUid);
+
+		return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, checksum, url);
+	}
+
+	public static RestResponse downloadServiceArtifact(ServiceReqDetails service, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders) throws Exception
+	{
+	
+		return downloadServiceArtifact( service,  artifact,  user,addionalHeaders,true);
+	}
+	
+	public static RestResponse downloadServiceArtifact(ServiceReqDetails service, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders,boolean addEcompHeader) throws Exception
+	{
+		Config config = Utils.getConfig();
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL, ValidationUtils.convertToSystemName(service.getName()), service.getVersion(),  ValidationUtils.normalizeFileName(artifact.getArtifactName())));
+		String fullUrl = String.format(Urls.DOWNLOAD_SERVICE_ARTIFACT_FULL_URL, config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
+		
+		return downloadArtifact(fullUrl, user, addionalHeaders,addEcompHeader);
+	}
+	
+	public static RestResponse downloadResourceArtifact(ServiceReqDetails service, ResourceReqDetails resource, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders) throws Exception
+	{	
+		return downloadResourceArtifact(service, resource,  artifact,  user,addionalHeaders, true);
+	}
+	
+	public static RestResponse downloadResourceArtifact(ServiceReqDetails service,ResourceReqDetails resource, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders,boolean addEcompHeader) throws Exception
+	{
+		Config config = Utils.getConfig();
+		String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL, ValidationUtils.convertToSystemName(service.getName()),service.getVersion(),ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(),  ValidationUtils.normalizeFileName(artifact.getArtifactName())));
+		String fullUrl = String.format(Urls.DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL, config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
+		
+		return downloadArtifact(fullUrl, user, addionalHeaders,addEcompHeader);
+	}
+	
+	
+	
+	public static RestResponse downloadResourceInstanceArtifact(String serviceUniqueId,String resourceInstanceId, User user, String artifactUniqeId) throws Exception
+	{
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DOWNLOAD_COMPONENT_INSTANCE_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUniqueId, resourceInstanceId, artifactUniqeId);
+		RestResponse res =  sendGet(url, user.getUserId(), null);
+		return res;
+	}
+	
+	////	
+
+	//update
+	
+	public static RestResponse updateInformationalArtifactOfServiceByMethod(ArtifactReqDetails artifactReqDetails, String serviceUid, String artifactUid, User sdncModifierDetails, String httpMethod) throws IOException {
+		return updateInformationalArtifactOfServiceByMethod(artifactReqDetails, serviceUid, artifactUid, sdncModifierDetails, httpMethod, calculateChecksum(artifactReqDetails));
+	}
+	
+	public static RestResponse updateInformationalArtifactOfServiceByMethod(ArtifactReqDetails artifactReqDetails, String serviceUid, User sdncModifierDetails, String httpMethod) throws IOException {
+		return updateInformationalArtifactOfServiceByMethod(artifactReqDetails, serviceUid, artifactReqDetails.getUniqueId(), sdncModifierDetails, httpMethod, calculateChecksum(artifactReqDetails));
+	}
+	
+	public static RestResponse downloadResourceArtifactInternalApi(String resourceId, User user, String artifactUniqeId) throws Exception
+	{
+		return downloadComponentArtifactInternalApi(resourceId, user, artifactUniqeId, Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT);
+	}
+
+	public static RestResponse downloadServiceArtifactInternalApi(String componentId, User user, String artifactUniqeId) throws Exception
+	{
+		return downloadComponentArtifactInternalApi(componentId, user, artifactUniqeId, Urls.UI_DOWNLOAD_SERVICE_ARTIFACT);
+	}
+	public static RestResponse downloadComponentArtifactInternalApi(String componentId, User user, String artifactUniqeId, String urlTemplate) throws Exception
+	{
+		Config config = Utils.getConfig();
+		String url = String.format(urlTemplate, config.getCatalogBeHost(),config.getCatalogBePort(), componentId, artifactUniqeId);
+		RestResponse res =  sendGet(url, user.getUserId(), null);
+		return res;
+	}
+	
+//	public static RestResponse downloadServiceArtifactInternalApi(String resourceId, User user, String artifactUniqeId) throws Exception
+//	{
+//		Config config = Utils.getConfig();
+//		String url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), resourceId, artifactUniqeId);
+//		RestResponse res =  sendGet(url, user.getUserId(), null);
+//		return res;
+//	}
+	
+	/*
+	public static RestResponse updateInformationalArtifactPayloadOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum) throws IOException
+	{
+		return updateInformationalArtifactOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, checksum, true);
+	}
+
+	public static RestResponse updateInformationalArtifactMetadataOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid) throws IOException
+	{
+		return updateInformationalArtifactOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, calculateChecksum(artifactDetails), false);
+	}
+
+	public static RestResponse updateInformationalArtifactOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum, boolean isPayloadUpdate) throws IOException
+	{
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = getHeadersMap(sdncModifierDetails);
+
+		if (isPayloadUpdate){
+			headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+		}
+
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+
+		HttpRequest http = new HttpRequest();
+
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUid, artifactUid);
+		RestResponse res =  http.httpSendPost(url, jsonBody, headersMap);
+		System.out.println("update artifact was finished with response: "+ res.getErrorCode());
+		return res;
+	}*/
+	
+	
+	
+	public static RestResponse updateInformationalArtifactOfServiceByMethod(ArtifactReqDetails artifactReqDetails, String serviceUid, String artifactUid, User sdncModifierDetails, String httpMethod, String checksum) throws IOException 
+	{
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = getHeadersMap(sdncModifierDetails);
+		headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(artifactReqDetails);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUid, artifactUid);
+		RestResponse updateResourceResponse = http.httpSendByMethod(url, httpMethod, userBodyJson, headersMap);
+//		System.out.println("update artifact was finished with response: "+ updateResourceResponse.getErrorCode());
+
+		return updateResourceResponse;
+	}
+	
+	
+	public static Map<String, String> getHeadersMap(User sdncModifierDetails) {
+		Map<String, String> headersMap = new HashMap<String,String>();	
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptJsonHeader);
+		
+		try{
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		}
+		catch(Exception e)
+		{
+			
+		}
+		
+		return headersMap;
+	}
+
+	//***********  RESOURCE ****************
+	//add
+	public static RestResponse addInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException{
+		return addInformationalArtifactToResource(artifactDetails, sdncModifierDetails, resourceUid, calculateChecksum(artifactDetails));
+	}
+	
+	public static RestResponse explicitAddInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException{
+		Config config = Utils.getConfig();
+
+
+		String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),config.getCatalogBePort(), resourceUid);
+
+		return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
+	}
+
+	
+	public static RestResponse addInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid, String checksum) throws IOException{
+		Config config = Utils.getConfig();
+			
+			if (artifactDetails.getArtifactGroupType()!=null && artifactDetails.getArtifactGroupType().equals(ArtifactGroupTypeEnum.DEPLOYMENT.getType())){
+				//YANG_XML and OTHER deployment artifact should be added through this API, not updated
+				String artifactType = artifactDetails.getArtifactType();
+				if (!(ArtifactTypeEnum.YANG_XML.getType().equals(artifactType) ||
+						ArtifactTypeEnum.OTHER.getType().equals(artifactType) ||
+						ArtifactTypeEnum.VNF_CATALOG.getType().equals(artifactType) ||
+						ArtifactTypeEnum.VF_LICENSE.getType().equals(artifactType) ||
+						ArtifactTypeEnum.VENDOR_LICENSE.getType().equals(artifactType) ||
+						ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType().equals(artifactType) ||
+						ArtifactTypeEnum.MODEL_QUERY_SPEC.getType().equals(artifactType) ||
+						ArtifactTypeEnum.APPC_CONFIG.getType().equals(artifactType))){
+					//return updateInformationalArtifactToResource(artifactDetails, sdncModifierDetails, resourceUid);
+				}
+			}
+		String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),config.getCatalogBePort(), resourceUid);
+			
+		return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, checksum, url);
+	}
+	//update
+	public static RestResponse updateInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException{
+		return updateInformationalArtifactToResource(artifactDetails, sdncModifierDetails, resourceUid, calculateChecksum(artifactDetails));
+	}
+
+	public static RestResponse updateInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid, String checksum) throws IOException {
+		Config config = Utils.getConfig();
+		if (artifactDetails.getArtifactGroupType()!=null && artifactDetails.getArtifactGroupType().equals("DEPLOYMENT")){
+			RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceUid );
+			Resource resourceRespJavaObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+			Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+			ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactDetails.getArtifactLabel());
+			artifactDetails.setUniqueId(artifactDefinition.getUniqueId());
+			artifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
+			
+		}
+		
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactDetails.getUniqueId());
+
+		return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
+	}
+	
+	public static RestResponse uploadArtifactToPlaceholderOnResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid, String placeHolderLabel) throws IOException {
+		Config config = Utils.getConfig();
+		if (artifactDetails.getArtifactLabel() != null && !artifactDetails.getArtifactLabel().isEmpty()){
+			RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceUid );
+			Resource resourceRespJavaObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
+			Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
+			ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactDetails.getArtifactLabel());
+			AssertJUnit.assertNotNull(artifactDefinition);
+			artifactDetails.setUniqueId(artifactDefinition.getUniqueId());
+			artifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
+			
+		}
+		
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactDetails.getUniqueId());
+
+		return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
+	}
+	
+	public static RestResponse updateArtifactToResourceInstance(ArtifactDefinition artifactDefinition, User sdncModifierDetails, String resourceInstanceId, String serviceId) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_RESOURCE_INSTANCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId, resourceInstanceId, artifactDefinition.getUniqueId());
+		return updateDeploymentArtifact(artifactDefinition, sdncModifierDetails, url);
+	}
+	
+	public static RestResponse updateDeploymentArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactDetails.getUniqueId());
+	
+		return updateDeploymentArtifact(artifactDetails, sdncModifierDetails, url);
+	}
+
+
+	public static RestResponse updateDeploymentArtifactToRI(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceInstanceId, String serviceId) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_RESOURCE_INSTANCE_HEAT_ENV_PARAMS, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId, resourceInstanceId, artifactDetails.getUniqueId());
+		return updateDeploymentArtifact(artifactDetails, sdncModifierDetails, url);
+	}
+	
+	//delete
+	public static RestResponse deleteArtifactFromResourceInstance (ArtifactDefinition artifactDefinition, User sdncModifierDetails, String resourceUid, String serviceId) throws IOException{
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_RESOURCE_INSTANCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId, resourceUid, artifactDefinition.getUniqueId());
+		return sendDelete(url, sdncModifierDetails.getUserId());		
+	}
+	
+	public static RestResponse deleteInformationalArtifactFromResource(String resourceUid, ArtifactReqDetails artifactDetails, User sdncModifierDetails) throws IOException{
+		return deleteInformationalArtifactFromResource( resourceUid, artifactDetails.getUniqueId(),  sdncModifierDetails);
+	}
+	
+	public static RestResponse deleteInformationalArtifactFromResource( String resourceUid, String artifactId, User sdncModifierDetails) throws IOException{
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactId);
+		return sendDelete(url, sdncModifierDetails.getUserId());
+	}
+	
+	public static RestResponse deleteServiceApiArtifact(ArtifactReqDetails artifactDetails, String serviceUniqueId, User user) throws Exception
+	{
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_DELETE_SERVICE_API_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUniqueId, artifactDetails.getUniqueId());
+		RestResponse res =  sendDelete(url, user.getUserId());
+		logger.debug("Deleting api artifact was finished with response: {}", res.getErrorCode());
+		logger.debug("Response body: {}", res.getResponseMessage());
+		return res;
+	}
+	
+	//*************** RESOURCE INSTANCE **************
+	/**
+	 * Add DCAE artifacts to resource instance.
+	 * @param artifactDetails
+	 * @param sdncModifierDetails
+	 * @param resourceInstanceId
+	 * @param serviceId
+	 * @return
+	 * @throws IOException
+	 */
+	public static RestResponse addArtifactToResourceInstance(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceInstanceId, String serviceId) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.ADD_RESOURCE_INSTANCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId,resourceInstanceId, artifactDetails.getUniqueId());
+		return addArtifactToInstance(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
+	}
+	
+	//*************** COMPONENT **************
+	
+	public static RestResponse uploadDeploymentArtifact(ArtifactReqDetails artifactDetails, Component component, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+		Map<String, String> additionalHeaders = null;
+		String checksum = ResponseParser.calculateMD5Header(artifactDetails);
+		additionalHeaders = new HashMap<String, String>();
+		additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+		
+		ComponentTypeEnum componentType = component.getComponentType();
+		
+		String url = null;
+				
+		switch (componentType){
+
+		case RESOURCE:
+		{
+			url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), component.getUniqueId(), artifactDetails.getUniqueId());
+			
+			break;
+		}
+		case SERVICE: {
+			
+			break;
+		}
+		
+		case PRODUCT: {
+			
+			break;
+		}
+		
+		default: {//dummy
+			assertTrue("failed on enum selection", false);
+			
+			break;
+		}
+		}
+		
+		
+		
+
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+//		System.out.println("ArtifactDetails: "+ jsonBody);
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
+		if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
+			artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+		}
+//		System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
+		return res;
+	}
+	
+	public static RestResponse uploadArtifact(ArtifactReqDetails artifactDetails, Component component, User sdncModifierDetails) throws IOException {
+		Config config = Utils.getConfig();
+		List<String> placeHolderlst = Utils.getListOfResPlaceHoldersDepArtTypes();
+		Map<String, String> additionalHeaders = null;
+		String checksum = null;	
+		String url= null;
+//
+//		
+//		if (artifactDetails.getArtifactGroupType() != null
+//				&& artifactDetails.getArtifactGroupType().equals("DEPLOYMENT")
+//				&& placeHolderlst.contains(artifactDetails.getArtifactType())) {
+//			Map<String, ArtifactDefinition> deploymentArtifacts = component.getDeploymentArtifacts();
+//			ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactDetails.getArtifactLabel());
+//			artifactDetails.setUniqueId(artifactDefinition.getUniqueId());
+//			artifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
+//			checksum = ResponseParser.calculateMD5Header(artifactDetails);
+//			additionalHeaders = new HashMap<String, String>();
+//			additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+//			url = String.format(Urls.UPDATE_ARTIFACT_OF_COMPONENT, config.getCatalogBeHost(),
+//					config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
+//					component.getUniqueId(), artifactDetails.getUniqueId());
+//		}
+//
+//		else {
+			checksum = ResponseParser.calculateMD5Header(artifactDetails);
+			additionalHeaders = new HashMap<String, String>();
+			additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+			url = String.format(Urls.UPLOAD_DELETE_ARTIFACT_OF_COMPONENT, config.getCatalogBeHost(),
+					config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
+					component.getUniqueId(), artifactDetails.getUniqueId());
+//		}
+		
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+//		System.out.println("ArtifactDetails: "+ jsonBody);
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
+		if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
+			artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+		}
+//		System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
+		return res;
+	}
+	
+	
+
+	
+	//*************** PRIVATE **************
+	private static RestResponse deleteInformationalArtifact(User sdncModifierDetails, String url) throws IOException {
+		Map<String, String> additionalHeaders = null;
+
+			additionalHeaders = new HashMap<String, String>();
+		
+		
+		additionalHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		additionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		
+		return sendDelete(url, sdncModifierDetails.getUserId(), additionalHeaders);
+
+//		Gson gson = new Gson();
+////		System.out.println("ArtifactDetails: "+ jsonBody);
+//		String jsonBody = gson.toJson(artifactDetails);
+//
+//		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
+//		if ((res.getErrorCode() == STATUS_CODE_SUCCESS) || (res.getErrorCode() == STATUS_CODE_CREATED)) {
+//			artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+//		}
+////		System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
+//		return res;
+	}
+	
+	private static RestResponse updateInformationalArtifact(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String checksum, String url) throws IOException {
+		return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, checksum, url);
+	}
+	
+	private static RestResponse uploadInformationalArtifact(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String checksum, String url) throws IOException {
+		Map<String, String> additionalHeaders = null;
+		if (checksum != null && !checksum.isEmpty()) {
+			additionalHeaders = new HashMap<String, String>();
+			additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+		}
+		
+		additionalHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		additionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		Gson gson = new Gson();
+//		System.out.println("ArtifactDetails: "+ jsonBody);
+		String jsonBody = gson.toJson(artifactDetails);
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
+		if ((res.getErrorCode() == STATUS_CODE_SUCCESS) || (res.getErrorCode() == STATUS_CODE_CREATED)) {
+			artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+		}
+//		System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
+		return res;
+	}
+	
+	private static RestResponse addArtifactToInstance(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String checksum, String url) throws IOException {
+		Map<String, String> additionalHeaders = null;
+		additionalHeaders = new HashMap<String, String>();
+		if (checksum != null && !checksum.isEmpty()) {
+			additionalHeaders = new HashMap<String, String>();
+			additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+		}
+		additionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json, text/plain, */*");
+		additionalHeaders.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json;charset=UTF-8");
+
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), "application/json, text/plain, */*", additionalHeaders);
+		if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
+			artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+		}
+		return res;
+	}
+	
+	private static RestResponse updateDeploymentArtifact(ArtifactDefinition artifactDefinition, User sdncModifierDetails, String url) throws IOException {
+		Map<String, String> additionalHeaders = null;
+		additionalHeaders = new HashMap<String, String>();
+		additionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json, text/plain, */*");
+		additionalHeaders.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json;charset=UTF-8");
+		
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDefinition);
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), "application/json, text/plain, */*", additionalHeaders);
+		return res;
+	}
+	
+	private static RestResponse updateDeploymentArtifact(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String url) throws IOException {
+		Map<String, String> additionalHeaders = null;
+		
+			additionalHeaders = new HashMap<String, String>();
+			additionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json, text/plain, */*");
+			additionalHeaders.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json;charset=UTF-8");
+//			additionalHeaders.put(HttpHeaderEnum..getValue(), "application/json;charset=UTF-8");
+		
+
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+//		System.out.println("ArtifactDetails: "+ jsonBody);
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), "application/json, text/plain, */*", additionalHeaders);
+		if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
+			artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+		}
+//		System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
+		return res;
+	}
+	
+	private static RestResponse downloadArtifact(String url, User user, Map<String, String> addionalHeaders,boolean addEcompHeader) throws IOException
+	{	
+		if(addEcompHeader){
+			addionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), ecomp);
+		}
+		return downloadArtifact(url, user, addionalHeaders, acceptOctetStream);
+	}
+	
+	private static RestResponse downloadArtifact(String url, User user, Map<String, String> addionalHeaders, String accept) throws IOException
+	{
+		addionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), accept);
+		
+		RestResponse res =  sendGet(url, user.getUserId(), addionalHeaders);
+//		System.out.println("download artifact was finished with response: "+ res.getErrorCode());
+//		System.out.println("response is: " + res.getResponse());
+		return res;
+	}
+	
+	private static Map<String,Map<String,Object>> getArtifactsListFromResponse(String jsonResponse, String fieldOfArtifactList){
+		JSONObject object = (JSONObject)JSONValue.parse(jsonResponse);
+		Map<String,Map<String,Object>> map = (Map<String,Map<String,Object>>)object.get(fieldOfArtifactList);
+		return map;
+	}
+
+	public static String calculateChecksum(ArtifactReqDetails artifactDetails) {
+		String checksum = null;
+		if (artifactDetails.getPayload() != null) {
+			checksum = ResponseParser.calculateMD5Header(artifactDetails);
+		}
+		return checksum;
+	}
+	
+	public static String encodeUrlForDownload(String url){
+
+		return url.replaceAll(" ", "%20");
+	}
+	
+	public static String getPartialUrlByArtifactName(ServiceReqDetails serviceDetails,String serviceVersion ,String artifactName){
+		return encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL, ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceVersion, artifactName));
+	}
+	
+	public static String getUniqueIdOfArtifact(RestResponse createResponse, String artifactField, String requieredArtifactLabel) throws Exception
+	{
+		Map<String, Object> artifact = getArtifactFromRestResponse(createResponse, artifactField, requieredArtifactLabel);
+		assertNotNull(artifact);
+		return artifact.get("uniqueId").toString();
+	}
+	
+	public static Map<String, Object> getArtifactFromRestResponse(RestResponse response, String artifactField, String requieredArtifactLabel)
+	{
+		Map<String, Map<String, Object>> map = getArtifactsListFromResponse(response.getResponse(), artifactField);
+		return map.get(requieredArtifactLabel);
+	}
+	
+
+	
+	public static RestResponse updateInformationalArtifactPayloadOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid) throws IOException
+	{
+		return updateInformationalArtifactPayloadOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, calculateMD5Header(artifactDetails));
+	}
+	
+	private static RestResponse updateInformationalArtifactPayloadOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum) throws IOException
+	{
+		return updateInformationalArtifactOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, checksum, true);
+	}
+	
+	private static RestResponse updateInformationalArtifactOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum, boolean isPayloadUpdate) throws IOException
+	{
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
+
+		if (isPayloadUpdate){
+			headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
+		}
+
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+
+		HttpRequest http = new HttpRequest();
+
+		String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUid, artifactUid);
+		RestResponse res =  http.httpSendPost(url, jsonBody, headersMap);
+//		System.out.println("update artifact was finished with response: "+ res.getErrorCode());
+		return res;
+	}
+	
+	public static String calculateMD5Header(ArtifactReqDetails artifactDetails)
+	{
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+		// calculate MD5 for json body
+		return calculateMD5(jsonBody);
+
+	}
+	
+	public static String calculateMD5 (String data){
+		String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data);
+		// encode base-64 result
+		byte[] encodeBase64 = Base64.encodeBase64(calculatedMd5.getBytes());
+		String encodeBase64Str = new String(encodeBase64);
+		return encodeBase64Str;
+
+	}
+
+	
+	public static ArtifactDefinition getArtifactDataFromJson(String json) {
+		Gson gson = new Gson();
+		JsonObject jsonElement = new JsonObject();
+		jsonElement = gson.fromJson(json, jsonElement.getClass());
+		ArtifactDefinition artifact = new ArtifactDefinition(); 
+		String payload = null;
+		JsonElement artifactPayload = jsonElement.get(Constants.ARTIFACT_PAYLOAD_DATA);
+		if (artifactPayload != null && !artifactPayload.isJsonNull()) {
+			payload = artifactPayload.getAsString();
+		}
+		jsonElement.remove(Constants.ARTIFACT_PAYLOAD_DATA);
+		artifact = gson.fromJson(jsonElement, ArtifactDefinition.class);
+		artifact.setPayloadData(payload);
+		
+		/*atifact.setArtifactName(UPLOAD_ARTIFACT_NAME);
+artifact.setArtifactDisplayName("configure");
+artifact.setArtifactType("SHELL");
+artifact.setMandatory(false);
+artifact.setDescription("ff");
+artifact.setPayloadData(UPLOAD_ARTIFACT_PAYLOAD);
+artifact.setArtifactLabel("configure");*/
+		return artifact;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
new file mode 100644
index 0000000..13a5641
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
@@ -0,0 +1,626 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.AssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceDetailedAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceInstanceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceDetailedAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public class AssetRestUtils extends BaseRestUtils {
+	static Gson gson = new Gson();
+	static ObjectMapper objectMapper = new ObjectMapper();
+
+	static Logger logger = LoggerFactory.getLogger(AssetRestUtils.class.getName());
+	static final String contentTypeHeaderData = "application/json";
+	static final String acceptHeaderDate = "application/json";
+	static final String basicAuthentication = "Basic Y2k6MTIzNDU2";
+	// /sdc/v1/catalog/{services/resources}/{componentUUID}/artifacts/{artifactUUID}
+	static final String COMPONENT_ARTIFACT_URL = "/sdc/v1/catalog/%s/%s/artifacts/%s";
+	// /sdc/v1/catalog/{services/resources}/{componentUUID}/resourceInstances/{resourceInstanceName}/artifacts/{artifactUUID}
+	static final String RESOURCE_INSTANCE_ARTIFACT_URL = "/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
+
+	public static HttpResponse getComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
+		Config config = Utils.getConfig();
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
+				assetType.getValue(), uuid);
+		HttpGet httpGet = new HttpGet(url);
+
+		httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		httpGet.addHeader(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
+
+		logger.debug("Send GET request to get Tosca model: {}", url);
+
+		return httpclient.execute(httpGet);
+	}
+	
+	public static File getToscaModelCsarFile(AssetTypeEnum assetType, String uuid) throws IOException {
+		Config config = Utils.getConfig();
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
+				assetType.getValue(), uuid);
+		HttpGet httpGet = new HttpGet(url);
+		File myFile = new File("tmpCSAR");
+
+		
+		httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		httpGet.addHeader(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
+
+		logger.debug("Send GET request to get Tosca model: {}", url);
+		CloseableHttpResponse execute = httpclient.execute(httpGet);
+		
+	    HttpEntity entity = execute.getEntity();
+	    if (entity != null) {
+	        try (FileOutputStream outstream = new FileOutputStream(myFile)) {
+	            entity.writeTo(outstream);
+	            outstream.close();
+	        }
+	    }
+		return myFile;
+	}
+	
+	public static RestResponse getRestResponseComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
+		Config config = Utils.getConfig();
+		
+		String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
+				assetType.getValue(), uuid);
+		
+		Map<String, String> headersMap = new HashMap<String,String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		
+		HttpRequest http = new HttpRequest();
+
+		logger.debug("Send GET request to get Resource Assets: {}", url);
+		System.out.println("Send GET request to get Resource Assets: " + url);
+		
+		logger.debug("Request headers: {}", headersMap);
+		System.out.println("Request headers: " + headersMap);
+
+		RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
+
+		return sendGetResourceAssets;
+
+	}
+
+	public static RestResponse getComponentListByAssetType(boolean isBasicAuthentication, AssetTypeEnum assetType,
+			String... filterArrayString) throws IOException {
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		if (isBasicAuthentication) {
+			headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
+		}
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(),
+				assetType.getValue());
+		if (filterArrayString != null && filterArrayString.length > 0) {
+			url = buildUrlWithFilter(url, filterArrayString);
+		}
+
+		RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
+
+		return sendGetResourceAssets;
+	}
+
+	public static RestResponse getFilteredComponentList(AssetTypeEnum assetType, String query) throws IOException {
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		HttpRequest http = new HttpRequest();
+
+		String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(),
+				assetType.getValue(), query);
+
+		logger.debug("Send GET request to get Resource Assets: {}", url);
+		logger.debug("Request headers: {}", headersMap);
+
+		RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
+
+		return sendGetResourceAssets;
+	}
+
+	public static String buildUrlWithFilter(String url, String[] filterArrayString) {
+		StringBuilder sb = new StringBuilder();
+		int length = filterArrayString.length;
+		int count = 0;
+		for (String filterString : filterArrayString) {
+			sb.append(filterString);
+			count++;
+			if (length != count) {
+				sb.append("&");
+			}
+		}
+		return url + "?" + sb;
+	}
+
+	public static RestResponse getAssetMetadataByAssetTypeAndUuid(boolean isBasicAuthentication,
+			AssetTypeEnum assetType, String uuid) throws IOException {
+
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		if (isBasicAuthentication) {
+			headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
+		}
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ASSET_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				assetType.getValue(), uuid);
+
+		logger.debug("Send GET request to get Resource Assets: {}", url);
+		logger.debug("Request headers: {}", headersMap);
+
+		RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
+
+		return sendGetResourceAssets;
+	}
+
+	public static List<ResourceAssetStructure> getResourceAssetList(RestResponse assetResponse) {
+		List<ResourceAssetStructure> resourceAssetList = new ArrayList<>();
+
+		JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
+		JsonArray componenetArray = (JsonArray) jelement;
+		for (JsonElement jElement : componenetArray) {
+			ResourceAssetStructure resource = gson.fromJson(jElement, ResourceAssetStructure.class);
+			resourceAssetList.add(resource);
+		}
+		return resourceAssetList;
+	}
+
+	public static ResourceDetailedAssetStructure getResourceAssetMetadata(RestResponse assetResponse) {
+
+		List<ResourceInstanceAssetStructure> resourcesList = new ArrayList<>();
+		List<ArtifactAssetStructure> artifactsList = new ArrayList<>();
+		ResourceDetailedAssetStructure resourceAssetMetadata = new ResourceDetailedAssetStructure();
+		String response = assetResponse.getResponse();
+
+		JsonObject jObject = (JsonObject) new JsonParser().parse(response);
+		resourceAssetMetadata = gson.fromJson(jObject, ResourceDetailedAssetStructure.class);
+
+		setResourceInstanceAssetList(resourcesList, jObject);
+		resourceAssetMetadata.setResources(resourcesList);
+
+		setArtifactAssetList(artifactsList, jObject);
+		resourceAssetMetadata.setArtifacts(artifactsList);
+
+		return resourceAssetMetadata;
+	}
+
+	public static void generalMetadataFieldsValidatior(AssetStructure assetMetadata, Component component) {
+
+		assertTrue("Expected resourceUuid is " + component.getUUID() + " actual: " + assetMetadata.getUuid(),
+				assetMetadata.getUuid().equals(component.getUUID()));
+		assertTrue(
+				"Expected resourceInvariantUuid is " + component.getInvariantUUID() + " actual: "
+						+ assetMetadata.getInvariantUUID(),
+				assetMetadata.getInvariantUUID().equals(component.getInvariantUUID()));
+		assertTrue("Expected asset name is " + component.getName() + " actual: " + assetMetadata.getName(),
+				assetMetadata.getName().equals(component.getName()));
+		assertTrue("Expected asset version is " + component.getVersion() + " actual: " + assetMetadata.getVersion(),
+				assetMetadata.getVersion().equals(component.getVersion()));
+		assertTrue(
+				"Expected asset lastUpdaterUserId is " + component.getLastUpdaterUserId() + " actual: "
+						+ assetMetadata.getLastUpdaterUserId(),
+				assetMetadata.getLastUpdaterUserId().equals(component.getLastUpdaterUserId()));
+		assertNotNull("Expected asset toscaModel is null", assetMetadata.getToscaModelURL());
+		assertTrue(
+				"Expected asset category is " + component.getCategories().get(0).getName() + " actual: "
+						+ assetMetadata.getCategory(),
+				assetMetadata.getCategory().equals(component.getCategories().get(0).getName()));
+		assertTrue(
+				"Expected asset lifeCycleState is " + component.getLifecycleState() + " actual: "
+						+ assetMetadata.getLifecycleState(),
+				assetMetadata.getLifecycleState().equals(component.getLifecycleState().toString()));
+
+	}
+
+	public static void resourceMetadataValidatior(ResourceDetailedAssetStructure resourceAssetMetadata,
+			Resource resource, AssetTypeEnum assetType) throws Exception {
+
+		generalMetadataFieldsValidatior(resourceAssetMetadata, resource);
+		assertTrue(
+				"Expected asset lastUpdaterFullName is " + resource.getLastUpdaterFullName() + " actual: "
+						+ resourceAssetMetadata.getLastUpdaterFullName(),
+				resourceAssetMetadata.getLastUpdaterFullName().equals(resource.getLastUpdaterFullName()));
+		assertTrue(
+				"Expected asset subCategory is " + resource.getCategories().get(0).getSubcategories().get(0).getName()
+						+ " actual: " + resourceAssetMetadata.getSubCategory(),
+				resourceAssetMetadata.getSubCategory()
+						.equals(resource.getCategories().get(0).getSubcategories().get(0).getName()));
+		assertTrue(
+				"Expected asset toscaResourceName is " + resource.getToscaResourceName() + " actual: "
+						+ resourceAssetMetadata.getToscaResourceName(),
+				resourceAssetMetadata.getToscaResourceName().equals(resource.getToscaResourceName()));
+		assertTrue(
+				"Expected asset resourceType is " + resource.getResourceType() + " actual: "
+						+ resourceAssetMetadata.getResourceType(),
+				resourceAssetMetadata.getResourceType().equals(resource.getResourceType().toString()));
+		resourceInstanceAssetValidator(resourceAssetMetadata.getResources(), resource, assetType);
+		// resourceInstanceAssetValidator(resourceAssetMetadata.getResources(),
+		// resource);
+		artifactAssetValidator(resourceAssetMetadata.getArtifacts(), resource, assetType);
+
+	}
+
+	public static void serviceMetadataValidatior(ServiceDetailedAssetStructure serviceAssetMetadata, Service service,
+			AssetTypeEnum assetType) throws Exception {
+
+		generalMetadataFieldsValidatior(serviceAssetMetadata, service);
+		assertTrue(
+				"Expected asset lastUpdaterFullName is " + service.getLastUpdaterFullName() + " actual: "
+						+ serviceAssetMetadata.getLastUpdaterFullName(),
+				serviceAssetMetadata.getLastUpdaterFullName().equals(service.getLastUpdaterFullName()));
+		assertTrue("Expected asset distributionStatus is " + service.getDistributionStatus() + " actual: "
+						+ serviceAssetMetadata.getDistributionStatus(),
+				serviceAssetMetadata.getDistributionStatus().equals(service.getDistributionStatus().toString()));
+		resourceInstanceAssetValidator(serviceAssetMetadata.getResources(), service, assetType);
+		// resourceInstanceAssetValidator(serviceAssetMetadata.getResources(),
+		// service);
+		artifactAssetValidator(serviceAssetMetadata.getArtifacts(), service, assetType);
+
+	}
+
+	private static void artifactAssetValidator(List<ArtifactAssetStructure> artifactAssetStructureList,
+			Component component, AssetTypeEnum assetType) {
+		Map<String, ArtifactDefinition> componentDeploymentArtifacts = component.getDeploymentArtifacts();
+		validateArtifactMetadata(componentDeploymentArtifacts, artifactAssetStructureList, component.getUUID(),
+				assetType, null);
+	}
+
+	private static void validateArtifactMetadata(Map<String, ArtifactDefinition> componentDeploymentArtifacts,
+			List<ArtifactAssetStructure> artifactAssetStructureList, String componentUuid, AssetTypeEnum assetType,
+			String resourceInstanceName) {
+		if(componentDeploymentArtifacts != null){
+			for (Entry<String, ArtifactDefinition> componentDeploymentArtifact : componentDeploymentArtifacts.entrySet()) {
+				ArtifactAssetStructure artifactAssetStructure = getArtifactMetadata(artifactAssetStructureList,
+						componentDeploymentArtifact.getValue().getArtifactUUID());
+				ArtifactDefinition componentDeploymentArtifactValue = componentDeploymentArtifact.getValue();
+				if (artifactAssetStructure != null) {
+					assertTrue(
+							"Expected artifact asset artifactName is " + componentDeploymentArtifactValue.getArtifactName()
+									+ " actual: " + artifactAssetStructure.getArtifactName(),
+							componentDeploymentArtifactValue.getArtifactName()
+									.equals(artifactAssetStructure.getArtifactName()));
+					assertTrue(
+							"Expected artifact asset Type is " + componentDeploymentArtifactValue.getArtifactType()
+									+ " actual: " + artifactAssetStructure.getArtifactType(),
+							componentDeploymentArtifactValue.getArtifactType()
+									.equals(artifactAssetStructure.getArtifactType()));
+					// assertNotNull("Expected artifact asset resourceInvariantUUID
+					// is null",
+					// resourceInstanceAssetStructure.getResourceInvariantUUID());
+					// String expectedArtifactUrl = "/sdc/v1/catalog/" +
+					// assetType.getValue() + "/" + componentUuid + "/artifacts/" +
+					// componentDeploymentArtifactValue.getArtifactUUID();
+					String expectedArtifactUrl = "";
+					if (resourceInstanceName == null) {
+						expectedArtifactUrl = String.format(COMPONENT_ARTIFACT_URL, assetType.getValue(), componentUuid,
+								componentDeploymentArtifactValue.getArtifactUUID());
+					} else {
+						expectedArtifactUrl = String.format(RESOURCE_INSTANCE_ARTIFACT_URL, assetType.getValue(),
+								componentUuid, resourceInstanceName, componentDeploymentArtifactValue.getArtifactUUID());
+					}
+	
+					assertTrue(
+							"Expected artifact asset URL is " + expectedArtifactUrl + " actual: "
+									+ artifactAssetStructure.getArtifactURL(),
+							artifactAssetStructure.getArtifactURL().equals(expectedArtifactUrl));
+					assertTrue(
+							"Expected artifact asset description is " + componentDeploymentArtifactValue.getDescription()
+									+ " actual: " + artifactAssetStructure.getArtifactDescription(),
+							componentDeploymentArtifactValue.getDescription().toString()
+									.equals(artifactAssetStructure.getArtifactDescription()));
+					assertTrue(
+							"Expected artifact asset checkSum is " + componentDeploymentArtifactValue.getArtifactChecksum()
+									+ " actual: " + artifactAssetStructure.getArtifactChecksum(),
+							componentDeploymentArtifactValue.getArtifactChecksum()
+									.equals(artifactAssetStructure.getArtifactChecksum()));
+					assertTrue(
+							"Expected artifact asset version is " + componentDeploymentArtifactValue.getArtifactVersion()
+									+ " actual: " + artifactAssetStructure.getArtifactVersion(),
+							componentDeploymentArtifactValue.getArtifactVersion()
+									.equals(artifactAssetStructure.getArtifactVersion()));
+					if (componentDeploymentArtifactValue.getTimeout() > 0) {
+						assertTrue(
+								"Expected artifact asset timeout is " + componentDeploymentArtifactValue.getTimeout()
+										+ " actual: " + artifactAssetStructure.getArtifactTimeout(),
+								componentDeploymentArtifactValue.getTimeout()
+										.equals(artifactAssetStructure.getArtifactTimeout()));
+					}
+	
+				} else {
+					assertTrue("artifact asset with UUID" + componentDeploymentArtifact.getValue().getArtifactUUID()
+							+ " not found in get Metadata response", false);
+				}
+			}
+		}else{
+			System.out.println("componentDeploymentArtifacts is null");
+			logger.debug("componentDeploymentArtifacts is null");
+		}
+
+	}
+
+	private static ArtifactAssetStructure getArtifactMetadata(List<ArtifactAssetStructure> artifactAssetStructureList,
+			String artifactUUID) {
+		for (ArtifactAssetStructure artifactAssetStructure : artifactAssetStructureList) {
+			if (artifactAssetStructure.getArtifactUUID().equals(artifactUUID)) {
+				return artifactAssetStructure;
+			}
+		}
+		return null;
+	}
+
+	private static void resourceInstanceAssetValidator(
+			List<ResourceInstanceAssetStructure> resourceInstanceAssetStructures, Component component,
+			AssetTypeEnum assetType) throws Exception {
+
+		List<ComponentInstance> componentInstances = component.getComponentInstances();
+		if (componentInstances != null) {
+			for (ComponentInstance componentInstance : componentInstances) {
+				ResourceInstanceAssetStructure resourceInstanceAssetStructure = getResourceInstanceMetadata(
+						resourceInstanceAssetStructures, componentInstance.getName());
+				if (resourceInstanceAssetStructure != null) {
+					assertTrue(
+							"Expected RI asset resourceName is " + componentInstance.getComponentName() + " actual: "
+									+ resourceInstanceAssetStructure.getResourceName(),
+							componentInstance.getComponentName()
+									.equals(resourceInstanceAssetStructure.getResourceName()));
+					assertTrue(
+							"Expected RI asset Name is " + componentInstance.getName() + " actual: "
+									+ resourceInstanceAssetStructure.getResourceInstanceName(),
+							componentInstance.getName()
+									.equals(resourceInstanceAssetStructure.getResourceInstanceName()));
+					assertNotNull("Expected RI asset resourceInvariantUUID is null",
+							resourceInstanceAssetStructure.getResourceInvariantUUID());
+					assertTrue(
+							"Expected RI asset resourceVersion is " + componentInstance.getComponentVersion()
+									+ " actual: " + resourceInstanceAssetStructure.getResourceVersion(),
+							componentInstance.getComponentVersion()
+									.equals(resourceInstanceAssetStructure.getResourceVersion()));
+					assertTrue(
+							"Expected RI asset resourceType is " + componentInstance.getOriginType() + " actual: "
+									+ resourceInstanceAssetStructure.getResoucreType(),
+							componentInstance.getOriginType().toString()
+									.equals(resourceInstanceAssetStructure.getResoucreType()));
+					Resource resource = AtomicOperationUtils.getResourceObject(componentInstance.getComponentUid());
+					assertTrue("Expected RI asset resourceUUID is " + resource.getUUID() + " actual: " + resourceInstanceAssetStructure.getResourceUUID(),
+							resource.getUUID().equals(resourceInstanceAssetStructure.getResourceUUID()));
+					validateArtifactMetadata(componentInstance.getDeploymentArtifacts(),
+							resourceInstanceAssetStructure.getArtifacts(), component.getUUID(), assetType,
+							componentInstance.getNormalizedName());
+					// validateArtifactMetadata(componentInstance.getDeploymentArtifacts(),
+					// resourceInstanceAssetStructure.getArtifacts(),
+					// component.getUUID(), AssetTypeEnum.RESOURCES);
+				} else {
+					assertTrue("resourceInstance asset with UUID" + componentInstance.getComponentUid()
+							+ " not found in get Metadata response", false);
+				}
+			}
+		}
+
+	}
+
+	// private static ResourceInstanceAssetStructure
+	// getResourceInstanceMetadata(List<ResourceInstanceAssetStructure>
+	// resourceInstanceAssetStructures, String componentUid) {
+	private static ResourceInstanceAssetStructure getResourceInstanceMetadata(
+			List<ResourceInstanceAssetStructure> resourceInstanceAssetStructures, String name) {
+		for (ResourceInstanceAssetStructure resourceInstanceAssetStructure : resourceInstanceAssetStructures) {
+			if (resourceInstanceAssetStructure.getResourceInstanceName().equals(name)) {
+				return resourceInstanceAssetStructure;
+			}
+		}
+		return null;
+	}
+
+	public static ServiceDetailedAssetStructure getServiceAssetMetadata(RestResponse assetResponse) {
+
+		List<ResourceInstanceAssetStructure> resourcesList = new ArrayList<>();
+		List<ArtifactAssetStructure> artifactsList = new ArrayList<>();
+		ServiceDetailedAssetStructure serviceAssetMetadata;
+
+		JsonObject jObject = (JsonObject) new JsonParser().parse(assetResponse.getResponse());
+		serviceAssetMetadata = gson.fromJson(jObject, ServiceDetailedAssetStructure.class);
+
+		setResourceInstanceAssetList(resourcesList, jObject);
+		serviceAssetMetadata.setResources(resourcesList);
+
+		setArtifactAssetList(artifactsList, jObject);
+		serviceAssetMetadata.setArtifacts(artifactsList);
+
+		return serviceAssetMetadata;
+	}
+
+	public static void setArtifactAssetList(List<ArtifactAssetStructure> artifactsList, JsonObject jObject) {
+		JsonArray artifactsArray = jObject.getAsJsonArray("artifacts");
+		if (artifactsArray != null) {
+			for (JsonElement jElement : artifactsArray) {
+				ArtifactAssetStructure artifact = gson.fromJson(jElement, ArtifactAssetStructure.class);
+				artifactsList.add(artifact);
+			}
+		}
+	}
+
+	public static void setResourceInstanceAssetList(List<ResourceInstanceAssetStructure> resourcesList,
+			JsonObject jObject) {
+		JsonArray resourcesArray = jObject.getAsJsonArray("resources");
+		if (resourcesArray != null) {
+			for (JsonElement jElement : resourcesArray) {
+				ResourceInstanceAssetStructure resource = gson.fromJson(jElement, ResourceInstanceAssetStructure.class);
+				resourcesList.add(resource);
+			}
+		}
+	}
+
+	public static List<ServiceAssetStructure> getServiceAssetList(RestResponse assetResponse) {
+		List<ServiceAssetStructure> serviceAssetList = new ArrayList<>();
+
+		JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
+		JsonArray componenetArray = (JsonArray) jelement;
+		for (JsonElement jElement : componenetArray) {
+			ServiceAssetStructure service = gson.fromJson(jElement, ServiceAssetStructure.class);
+			serviceAssetList.add(service);
+		}
+		return serviceAssetList;
+	}
+
+	public static List<String> getResourceNamesList(List<ResourceAssetStructure> resourceAssetList) {
+		List<String> assetNamesList = new ArrayList<>();
+		for (ResourceAssetStructure resourceAsset : resourceAssetList) {
+			assetNamesList.add(resourceAsset.getName());
+		}
+		return assetNamesList;
+	}
+	
+	public static Map<String,String> getResourceAssetMap(RestResponse assetResponse) {
+		Map<String,String> resourceAssetMap =  new HashMap<>();
+
+		JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
+		JsonArray componenetArray = (JsonArray) jelement;
+		for (JsonElement jElement : componenetArray) {
+			ResourceAssetStructure resource = gson.fromJson(jElement, ResourceAssetStructure.class);
+			resourceAssetMap.put(resource.getName(), resource.getVersion());
+		}
+		return resourceAssetMap;
+	}
+	
+	public static Map<String,String> getResourceListFiltteredByWholeVersion(Map<String,String> resourceAssetList) {
+		Map<String,String> assetNamesMap = new HashMap<>();
+			for (Entry<String, String> entry : resourceAssetList.entrySet()) {
+			    String key = entry.getKey();
+			    String[] parts = entry.getValue().split("\\.");
+			    String lastOne = parts[parts.length-1];
+			    
+			    if (key.contains("CinderVolume") ){
+			    	assetNamesMap.put(key,entry.getValue());
+			    }
+			    
+			    if (lastOne.equals("0") && !key.contains("Ci") ){
+			    	assetNamesMap.put(key,entry.getValue());
+			    }
+			}
+			
+		return assetNamesMap;
+	}
+
+	public static List<String> getResourceObjectByNameAndVersionToscaNamesList(Map<String,String> resourceAssetList) throws Exception {
+		List<String> assetNamesList = new ArrayList<>();
+		for (Entry<String, String> entry : resourceAssetList.entrySet()) {
+			System.out.println("fetch data---->"+entry.getKey()+entry.getValue());
+			Resource resourceObjectByNameAndVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, entry.getKey(), entry.getValue());
+		    	assetNamesList.add(resourceObjectByNameAndVersion.getToscaResourceName());
+		    
+		}
+		
+		return assetNamesList;
+	}
+	
+
+	public static List<String> getServiceNamesList(List<ServiceAssetStructure> serviceAssetList) {
+		List<String> assetNamesList = new ArrayList<>();
+		for (ServiceAssetStructure serviceAsset : serviceAssetList) {
+			assetNamesList.add(serviceAsset.getName());
+		}
+		return assetNamesList;
+	}
+
+	public static void checkResourceTypeInObjectList(List<ResourceAssetStructure> resourceAssetList, ResourceTypeEnum resourceType) {
+		for (ResourceAssetStructure resourceAsset : resourceAssetList) {
+			assertTrue("Expected resourceType is " + resourceType.toString() + " actual: " + resourceAsset.getResourceType(),
+					resourceAsset.getResourceType().equals(resourceType.toString()));
+		}
+	}
+
+	public static void checkComponentTypeInObjectList(List<ResourceAssetStructure> resourceAssetList, ComponentTypeEnum componentType) {
+		ComponentTypeEnum actualComponentType;
+		for (ResourceAssetStructure resourceAsset : resourceAssetList) {
+			actualComponentType = detectComponentType(resourceAsset);
+			assertTrue("Expected componentType is " + componentType.getValue() + " actual: " + actualComponentType.getValue(), actualComponentType.equals(componentType));
+		}
+	}
+
+	private static ComponentTypeEnum detectComponentType(ResourceAssetStructure resourceAsset) {
+		String resourceType = resourceAsset.getResourceType();
+		if(ResourceTypeEnum.getType(resourceType) !=null){
+			return ComponentTypeEnum.RESOURCE;
+		}
+		return null;
+	}
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java
new file mode 100644
index 0000000..2e27907
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java
@@ -0,0 +1,110 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+public class AutomationUtils extends BaseRestUtils {
+	
+	
+	public static String getOnboardVersion()  {
+		String onboardVersionStr = null;
+		try {
+			
+			RestResponse onboardVersion = CatalogRestUtils.getOnboardVersion();
+			onboardVersionStr = ResponseParser.getValueFromJsonResponse(onboardVersion.getResponse() , "Version");
+						
+		} catch (Exception e) {
+			System.out.println("UnknownOnboardVersion");
+		}
+		return onboardVersionStr != null ? onboardVersionStr : "UnknownOnboardVersion";
+		
+	}
+
+	public static String getOSVersion()  {
+		String osVersionStr = null;
+		try {
+			RestResponse osVersion = CatalogRestUtils.getOsVersion();
+			osVersionStr = ResponseParser.getVersionFromResponse(osVersion);
+			
+		} catch (Exception e) {
+			System.out.println("UnknownOSversion");
+		}
+	
+		return osVersionStr != null  ? osVersionStr : "UnknownOSversion" ;
+	}
+	
+	
+	
+	public static void createVersionsInfoFile(String filepath, String onboardVersion, String osVersion, String envData, String suiteName)
+			throws FileNotFoundException, IOException {
+		File myFoo = new File(filepath);
+		FileOutputStream fooStream = new FileOutputStream(myFoo, false); // true to append
+		String versions =  ("onboardVesrion=\""+ onboardVersion+ "\"\n" + "osVersion=\"" + osVersion + "\"\n" + "env=\""+ envData + "\"\n" + "suiteName=\""+ suiteName+ "\"\n");
+		byte[] myBytes = versions.getBytes();
+		fooStream.write(myBytes);
+		fooStream.close();
+	}
+	
+	public static void createVersionsInfoFile(String filepath, String onboardVersion, String osVersion, String envData)
+			throws FileNotFoundException, IOException {
+		createVersionsInfoFile(filepath, onboardVersion, osVersion, envData, null);
+	}
+	
+	public static void addEnvDetailsToReport() throws FileNotFoundException{
+	
+		Config config = Utils.getConfig();
+		config.getUrl();
+	}
+	
+	public static File getConfigFile(String configFileName) throws Exception {
+		File configFile = new File(getBasePath() + File.separator + "conf" + File.separator + configFileName);
+		if (!configFile.exists()) {
+			configFile = new File(getConfFilesPath() + configFileName);
+		}
+		return configFile;
+	}
+	
+	public static String getCiFilesPath() {
+		return getBasePath() + File.separator + "src" + File.separator + "main" + File.separator + "resources"
+				+ File.separator + "ci";
+	}
+
+	public static String getConfFilesPath() {
+		return getCiFilesPath() + File.separator + "conf" + File.separator;
+	}
+
+	public static String getTestSuitesFilesPath() {
+		return getCiFilesPath() + File.separator + "testSuites" + File.separator;
+	}
+	public static String getBasePath() {
+		return System.getProperty("user.dir");
+	}
+	
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java
new file mode 100644
index 0000000..4ea4047
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java
@@ -0,0 +1,265 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BaseRestUtils extends BaseValidationUtils {
+	public static final String contentTypeHeaderData = "application/json";
+	public static final String acceptHeaderData = "application/json";
+	public static final String acceptJsonHeader = "application/json";
+	public static final String acceptOctetHeader = "application/octet-stream";
+	public static final String authorizationHeader = "Basic " + Base64.encodeBase64String("ci:123456".getBytes());
+	public static final String acceptOctetStream = "application/octet-stream";
+	public static final String ecomp = "ecomp";
+	public static final String authorizationPrefixString = "Basic ";
+
+	public static final String RESOURCE_COMPONENT_TYPE = "resources";
+	public static final String PRODUCT_COMPONENT_TYPE = "products";
+	public static final String SERVICE_COMPONENT_TYPE = "services";
+
+	public static final int STATUS_CODE_SUCCESS = 200;
+	public static final int STATUS_CODE_CREATED = 201;
+	public static final int STATUS_CODE_DELETE = 204;
+	public static final int STATUS_CODE_NOT_FOUND = 404;
+	public static final int STATUS_CODE_SUCCESS_NO_CONTENT = 204;
+	public static final int STATUS_CODE_SUCCESS_DELETE = 204;
+	public static final int STATUS_CODE_INVALID_CONTENT = 400;
+	public static final int STATUS_CODE_MISSING_DATA = 400;
+	public static final int STATUS_CODE_MISSING_INFORMATION = 403;
+	public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
+	public static final int STATUS_CODE_ALREADY_EXISTS = 409;
+	public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
+	public static final int STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT = 400;
+	public static final int STATUS_CODE_MISSING_COMPONENT_NAME = 400;
+	public static final int STATUS_CODE_UNSUPPORTED_ERROR = 400;
+	public static final int STATUS_CODE_IMPORT_SUCCESS = 201;
+	public static final int STATUS_CODE_UPDATE_SUCCESS = 200;
+	public static final int RESTRICTED_OPERATION = 409;
+	public static final int STATUS_CODE_GET_SUCCESS = 200;
+
+	public static final String SUCCESS_MESSAGE = "OK";
+	private static Logger logger = LoggerFactory.getLogger(BaseRestUtils.class.getName());
+
+	private static byte[] encodeBase64;
+
+	// ************* PRIVATE METHODS ************************
+
+	protected static Map<String, String> prepareHeadersMap(String userId) {
+		return prepareHeadersMap(userId, acceptHeaderData);
+	}
+
+	protected static Map<String, String> prepareHeadersMap(String userId, String accept) {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		if (contentTypeHeaderData != null) {
+			headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		}
+		if (accept != null) {
+			headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), accept);
+		}
+		if (userId != null) {
+			headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
+		}
+
+		return headersMap;
+	}
+
+	// send request
+	// GET
+	protected static RestResponse sendGet(String url, String userId) throws IOException {
+		return sendGet(url, userId, null);
+	}
+
+	protected static RestResponse sendGet(String url, String userId, Map<String, String> additionalHeaders)
+			throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		if (additionalHeaders != null) {
+			headersMap.putAll(additionalHeaders);
+		}
+
+		HttpRequest http = new HttpRequest();
+		RestResponse getResourceResponse = http.httpSendGet(url, headersMap);
+		return getResourceResponse;
+	}
+
+	public static RestResponse sendGetAndRemoveHeaders(String url, String userId, List<String> headersToRemove)
+			throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		if (headersToRemove != null) {
+			for (String header : headersToRemove) {
+				headersMap.remove(header);
+			}
+		}
+
+		HttpRequest http = new HttpRequest();
+		RestResponse getResourceResponse = http.httpSendGet(url, headersMap);
+		return getResourceResponse;
+	}
+
+	// PUT
+	protected static RestResponse sendPut(String url, String userBodyJson, String userId, String cont)
+			throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(userId, cont);
+
+		HttpRequest http = new HttpRequest();
+		RestResponse updateResourceResponse = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
+		return updateResourceResponse;
+	}
+
+	// POST
+	public static RestResponse sendPost(String url, String userBodyJson, String userId, String accept)
+			throws IOException {
+		return sendPost(url, userBodyJson, userId, accept, null);
+	}
+
+	protected static RestResponse sendPost(String url, String userBodyJson, String userId, String accept,
+			Map<String, String> additionalHeaders) throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(userId, accept);
+		if (additionalHeaders != null) {
+			headersMap.putAll(additionalHeaders);
+		}
+		HttpRequest http = new HttpRequest();
+		RestResponse postResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
+		return postResourceResponse;
+	}
+
+	// used form complex requests like import categories..
+	protected static RestResponse sendPost(String url, HttpEntity entity, String userId, String accept)
+			throws IOException {
+		RestResponse postResponse = new RestResponse();
+		CloseableHttpResponse response = null;
+		CloseableHttpClient client = null;
+		try {
+			client = HttpClients.createDefault();
+			HttpPost httpPost = new HttpPost(url);
+
+			httpPost.addHeader("USER_ID", userId);
+			httpPost.setEntity(entity);
+			response = client.execute(httpPost);
+			HttpEntity responseEntity = response.getEntity();
+			int statusCode = response.getStatusLine().getStatusCode();
+
+			postResponse.setErrorCode(statusCode);
+			StringBuffer sb = new StringBuffer();
+			try {
+				BufferedReader in = new BufferedReader(new InputStreamReader(responseEntity.getContent()));
+				String inputLine;
+				while ((inputLine = in.readLine()) != null) {
+					sb.append(inputLine);
+				}
+				in.close();
+			} catch (Exception e) {
+				logger.debug("response body is null");
+			}
+			postResponse.setResponse(sb.toString());
+		} finally {
+			try {
+				if (response != null) {
+					response.close();
+				}
+
+			} catch (IOException e) {
+				logger.debug("failed to close client or response: ", e);
+			}
+			try {
+				if (client != null) {
+					client.close();
+				}
+			} catch (IOException e) {
+				logger.debug("failed to close client or response: ", e);
+			}
+		}
+		return postResponse;
+	}
+
+	// DELETE
+	protected static RestResponse sendDelete(String url, String userId) throws IOException {
+//		Map<String, String> headersMap = prepareHeadersMap(userId);
+		
+		return sendDelete(url, userId, null);
+	}
+	
+	protected static RestResponse sendDelete(String url, String userId, Map<String, String> additionalHeaders) throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		if (additionalHeaders != null) {
+			headersMap.putAll(additionalHeaders);
+		}
+		
+		HttpRequest http = new HttpRequest();
+		RestResponse deleteResourceResponse = http.httpSendDelete(url, headersMap);
+		return deleteResourceResponse;
+	}
+
+	/*
+	 * // ------ protected static Boolean checkErrorCode(RestResponse
+	 * deleteResponse) { if (deleteResponse.getErrorCode() ==
+	 * STATUS_CODE_SUCCESS || deleteResponse.getErrorCode() ==
+	 * STATUS_CODE_DELETE) { return true; } return false; }
+	 * 
+	 * // *** STATUS CODE VALIDATION UTIITIES **** public static void
+	 * checkStatusCode(RestResponse response, String assertMessage, boolean AND,
+	 * int... statuses) { int statusCode = response.getErrorCode(); for (int
+	 * status : statuses) { if (AND && statusCode != status) {
+	 * Assert.fail(assertMessage + " status: " + statusCode); } else if
+	 * (statusCode == status) { return; } } if (!AND) {
+	 * Assert.fail(assertMessage + " status: " + statusCode); } }
+	 * 
+	 * public static void checkDeleteResponse(RestResponse response) {
+	 * checkStatusCode(response,"delete request failed",false,STATUS_CODE_DELETE
+	 * ,STATUS_CODE_NOT_FOUND, STATUS_CODE_SUCCESS); // STATUS_CODE_SUCCESS for
+	 * deActivate user }
+	 * 
+	 * public static void checkCreateResponse(RestResponse response) {
+	 * checkStatusCode(response, "create request failed", false,
+	 * STATUS_CODE_CREATED); }
+	 */
+	public static String encodeUrlForDownload(String url) {
+		return url.replaceAll(" ", "%20");
+	}
+
+	public static Map<String, String> addAuthorizeHeader(String userName, String password) {
+		String userCredentials = userName + ":" + password;
+		encodeBase64 = Base64.encodeBase64(userCredentials.getBytes());
+		String encodedUserCredentials = authorizationPrefixString + new String(encodeBase64);
+		Map<String, String> authorizationHeader = new HashMap<String, String>();
+		authorizationHeader.put(HttpHeaderEnum.AUTHORIZATION.getValue(), encodedUserCredentials);
+		return authorizationHeader;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java
new file mode 100644
index 0000000..25fce34
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+public class CatalogRestUtils extends BaseRestUtils {
+
+	public static RestResponse getAbstractResources() throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_ABSTRACT_RESOURCES, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
+	}
+
+	public static RestResponse getCatalog() throws IOException {
+		return getCatalog(UserRoleEnum.DESIGNER.getUserId());
+	}
+
+	public static RestResponse getCatalog(String userId) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_CATALOG_DATA, config.getCatalogBeHost(), config.getCatalogBePort());
+		return sendGet(url, userId);
+	}
+
+	public static RestResponse getAllCategoriesTowardsCatalogBe() throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_CATEGORIES, config.getCatalogBeHost(), config.getCatalogBePort(),
+				BaseRestUtils.RESOURCE_COMPONENT_TYPE);
+
+		return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
+	}
+
+	public static RestResponse getAllCategoriesTowardsCatalogFeWithUuid(String uuid) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
+				BaseRestUtils.RESOURCE_COMPONENT_TYPE);
+
+		Map<String, String> additionalHeaders = new HashMap<String, String>();
+		additionalHeaders.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), uuid);
+
+		return sendGet(url, UserRoleEnum.DESIGNER.getUserId(), additionalHeaders);
+	}
+	
+	public static RestResponse getOnboardVersion() throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.ONBOARD_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
+	}
+	
+	public static RestResponse getOsVersion() throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.OS_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java
new file mode 100644
index 0000000..460518b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java
@@ -0,0 +1,309 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+public class CategoryRestUtils extends BaseRestUtils {
+
+	private static final int STATUS_CODE_CREATED = 201;
+
+	private static Gson gson = new Gson();
+
+	public static RestResponse createCategory(CategoryDefinition categoryDefinition, User sdncModifierDetails,
+			String categoryType) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType);
+		String bodyJson = gson.toJson(categoryDefinition);
+		RestResponse addCategoryResponse = BaseRestUtils.sendPost(url, bodyJson, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		if (addCategoryResponse.getErrorCode().intValue() == STATUS_CODE_CREATED)
+			categoryDefinition.setUniqueId(
+					ResponseParser.getValueFromJsonResponse(addCategoryResponse.getResponse(), "uniqueId"));
+		return addCategoryResponse;
+	}
+
+	// GET categories
+	public static RestResponse getAllCategories(User sdncModifierDetails, String categoryType) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_CATEGORIES, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType);
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		RestResponse getCategotyResponse = http.httpSendGet(url, headersMap);
+		return getCategotyResponse;
+	}
+
+	public static RestResponse getAllCategoriesTowardsFe(User sdncModifierDetails, String categoryType)
+			throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
+				categoryType);
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		RestResponse getCategotyResponse = http.httpSendGet(url, headersMap);
+		return getCategotyResponse;
+	}
+
+	// Delete Category
+	public static RestResponse deleteCategory(String categoryId, String psUserId, String categoryType)
+			throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType, categoryId);
+		url = url.replace("#", "%23"); // HEX
+		url = url.replace(" ", "%20"); // HEX
+		RestResponse deleteCategoryResponse = sendDelete(url, psUserId);
+		return deleteCategoryResponse;
+	}
+
+	public static RestResponse createSubCategory(SubCategoryDefinition subCategory, CategoryDefinition parentCategory,
+			User sdncModifierDetails, String categoryType) throws Exception {
+		// categoryType = service/resource/product
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_SUB_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType, parentCategory.getUniqueId());
+		String bodyJson = gson.toJson(subCategory);
+		RestResponse createSubCategoryPost = BaseRestUtils.sendPost(url, bodyJson, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		if (createSubCategoryPost.getErrorCode().intValue() == STATUS_CODE_CREATED)
+			subCategory.setUniqueId(
+					ResponseParser.getValueFromJsonResponse(createSubCategoryPost.getResponse(), "uniqueId"));
+
+		return createSubCategoryPost;
+	}
+
+	public static RestResponse deleteSubCategory(String subCategoryId, String categoryId, String psUserId,
+			String categoryType) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_SUB_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType, categoryId, subCategoryId);
+		url = url.replace("#", "%23"); // HEX
+		url = url.replace(" ", "%20"); // HEX
+		RestResponse deleteSubCategoryResponse = sendDelete(url, psUserId);
+		return deleteSubCategoryResponse;
+	}
+
+	public static RestResponse deleteGrouping(String groupId, String subCategoryId, String categoryId, String psUserId,
+			String categoryType) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_GROUPING, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType, categoryId, subCategoryId, groupId);
+		url = url.replace("#", "%23"); // HEX
+		url = url.replace(" ", "%20"); // HEX
+		RestResponse deleteGroupResponse = sendDelete(url, psUserId);
+		return deleteGroupResponse;
+	}
+
+	public static RestResponse createServiceCategoryHttpCspAtuUidIsMissing(CategoryDefinition categoryDataDefinition,
+			User sdncModifierDetails) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				SERVICE_COMPONENT_TYPE);
+
+		Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
+		headersMap.remove("USER_ID");
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(categoryDataDefinition);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+		RestResponse createCatergoryResponse = http.httpSendPost(url, userBodyJson, headersMap);
+		return createCatergoryResponse;
+	}
+
+	public static RestResponse createSubCategoryHttpCspAtuUidIsMissing(SubCategoryDefinition subCategory,
+			CategoryDefinition parentCategory, User sdncModifierDetails, String categoryType) throws Exception {
+		// categoryType = service/resource/product
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_SUB_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType, parentCategory.getUniqueId());
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		headersMap.remove("USER_ID");
+		Gson gson = new Gson();
+		String subCatJson = gson.toJson(subCategory);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(subCatJson);
+		RestResponse addCategoryResponse = http.httpSendPost(url, subCatJson, headersMap);
+		return addCategoryResponse;
+	}
+
+	public static RestResponse deleteCatergoryHttpCspAtuUidIsMissing(CategoryDefinition categoryDataDefinition,
+			User sdncModifierDetails) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryDataDefinition.getName());
+
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		headersMap.remove("USER_ID");
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(categoryDataDefinition);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+		RestResponse deleteCategotyResponse = http.httpSendDelete(url, headersMap);
+		return deleteCategotyResponse;
+	}
+
+	public static RestResponse createGrouping(GroupingDefinition grouping, SubCategoryDefinition subCategory,
+			CategoryDefinition parentCategory, User sdncModifierDetails, String categoryType) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_GROUPING, config.getCatalogBeHost(), config.getCatalogBePort(),
+				categoryType, parentCategory.getUniqueId(), subCategory.getUniqueId());
+		String bodyJson = gson.toJson(grouping);
+		RestResponse addGroupingResponse = BaseRestUtils.sendPost(url, bodyJson, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		return addGroupingResponse;
+	}
+
+	public static RestResponse importCategories(MultipartEntityBuilder mpBuilder, String userId) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.IMPORT_CATEGORIES, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		RestResponse importResponse = BaseRestUtils.sendPost(url, mpBuilder.build(), userId, acceptHeaderData);
+		return importResponse;
+	}
+
+	public static int getMatchingCategoriesNum(RestResponse getAllCategoryRest, CategoryDefinition categoryDefinition) {
+		String response = getAllCategoryRest.getResponse();
+		Gson gson = new Gson();
+		List<CategoryDefinition> categoryDefinitions = gson.fromJson(response,
+				new TypeToken<List<CategoryDefinition>>() {
+				}.getType());
+		int categoriesNum = 0;
+		String catName = categoryDefinition.getName();
+		for (CategoryDefinition elem : categoryDefinitions) {
+			if (elem.getName().equals(catName)) {
+				categoryDefinition.setUniqueId(elem.getUniqueId());
+				categoriesNum++;
+			}
+		}
+
+		return categoriesNum;
+	}
+
+	public static int getMatchingSubCategoriesNum(RestResponse getAllCategoryRest, String parentCategoryId,
+			SubCategoryDefinition expectedSubCategoryDefinition) {
+
+		String response = getAllCategoryRest.getResponse();
+		Gson gson = new Gson();
+		List<CategoryDefinition> categoryDefinitions = gson.fromJson(response,
+				new TypeToken<List<CategoryDefinition>>() {
+				}.getType());
+		int subCatNum = 0;
+		String subCatName = expectedSubCategoryDefinition.getName();
+		for (CategoryDefinition elem : categoryDefinitions) {
+			if (elem.getUniqueId().equals(parentCategoryId)) {
+				List<SubCategoryDefinition> subCategories = elem.getSubcategories();
+				if (subCategories != null) {
+					for (SubCategoryDefinition subCategoryDataDefinition : subCategories) {
+						if (subCatName.equals(subCategoryDataDefinition.getName())) {
+							expectedSubCategoryDefinition.setUniqueId(subCategoryDataDefinition.getUniqueId());
+							subCatNum++;
+						}
+					}
+				}
+
+			}
+		}
+		return subCatNum;
+	}
+
+	public static int getMatchingGroupingNum(RestResponse getAllCategoryRest, String parentCategoryId,
+			String subCategoryId, GroupingDefinition expectedGroupingDefinition) {
+
+		String response = getAllCategoryRest.getResponse();
+		Gson gson = new Gson();
+		List<CategoryDefinition> categoryDefinitions = gson.fromJson(response,
+				new TypeToken<List<CategoryDefinition>>() {
+				}.getType());
+		int groupingNum = 0;
+		String groupingName = expectedGroupingDefinition.getName();
+		for (CategoryDefinition elem : categoryDefinitions) {
+			if (elem.getUniqueId().equals(parentCategoryId)) {
+				List<SubCategoryDefinition> subCategories = elem.getSubcategories();
+				if (subCategories != null) {
+					for (SubCategoryDefinition subCategoryDataDefinition : subCategories) {
+						// if
+						// (subCategoryId.equals(subCategoryDataDefinition.getUniqueId()))
+						// {
+						if (subCategoryId.equals(subCategoryDataDefinition.getUniqueId())
+								&& subCategoryDataDefinition.getGroupings() != null) {
+							List<GroupingDefinition> grouping = subCategoryDataDefinition.getGroupings();
+							for (GroupingDefinition groupingDataDefinition : grouping) {
+								if (groupingName.equals(groupingDataDefinition.getName())) {
+									expectedGroupingDefinition.setUniqueId(groupingDataDefinition.getUniqueId());
+									groupingNum++;
+								}
+							}
+
+						}
+					}
+				}
+
+			}
+		}
+		return groupingNum;
+	}
+
+	public enum CategoryAuditJsonKeysEnum {
+		ACTION("ACTION"), MODIFIER("MODIFIER"), CATEGORY_NAME("CATEGORY_NAME"), SUB_CATEGORY_NAME("SUB_CATEGORY_NAME"), GROUPING_NAME("GROUPING_NAME"), RESOURCE_TYPE("RESOURCE_TYPE"), ECOMP_USER("ECOMP_USER"), STATUS("STATUS"), DESCRIPTION("DESCRIPTION"), DETAILS("DETAILS");
+		
+		private String auditJsonKeyName;
+
+		private CategoryAuditJsonKeysEnum(String auditJsonKeyName) {
+			this.auditJsonKeyName = auditJsonKeyName;
+		}
+
+		public String getAuditJsonKeyName() {
+			return auditJsonKeyName.toLowerCase();
+		}
+	}
+	
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java
new file mode 100644
index 0000000..1b550e4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java
@@ -0,0 +1,276 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+import com.google.gson.Gson;
+
+public class ComponentInstanceRestUtils extends BaseRestUtils {
+	public static String acceptHeaderDate = "application/json";
+	static Config config = Config.instance();
+	public static Gson gson = new Gson();
+
+	// 'componentType' can be 'services' or 'resources'
+
+	public static RestResponse createComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
+			User sdncModifierDetails, Component component) throws Exception {
+		return createComponentInstance(componentInstanceReqDetails, sdncModifierDetails, component.getUniqueId(),
+				component.getComponentType());
+	}
+
+	public static RestResponse createComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
+			User sdncModifierDetails, String componentId, ComponentTypeEnum componentType) throws Exception {
+
+		return createComponentInstance(componentInstanceReqDetails, sdncModifierDetails, componentId,
+				ComponentTypeEnum.findParamByType(componentType));
+	}
+
+	public static RestResponse createComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
+			User sdncModifierDetails, String componentId, String componentType) throws Exception {
+		Config config = Utils.getConfig();
+		String userId = sdncModifierDetails.getUserId();
+		String serviceBodyJson = gson.toJson(componentInstanceReqDetails);
+		String url = String.format(Urls.CREATE_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				componentType, componentId);
+		RestResponse createResourceInstance = sendPost(url, serviceBodyJson, userId, acceptHeaderData);
+		if (createResourceInstance.getErrorCode().equals(BaseRestUtils.STATUS_CODE_CREATED)) {
+			String uniqueId = ResponseParser.getValueFromJsonResponse(createResourceInstance.getResponse(), "uniqueId");
+			componentInstanceReqDetails.setUniqueId(uniqueId);
+			// Gson gson = new Gson();
+			// ResourceInstanceReqDetails fromJson =
+			// gson.fromJson(createResourceInstance.getResponse(),
+			// ResourceInstanceReqDetails.class);
+			// componentInstanceReqDetails.setUniqueId(fromJson.getUniqueId());
+		}
+		return createResourceInstance;
+	}
+
+	public static RestResponse getComponentInstances(ComponentTypeEnum type, String componentId, User user)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
+
+		String url = String.format(Urls.GET_COMPONENT_INSTANCES, config.getCatalogBeHost(), config.getCatalogBePort(),
+				ComponentTypeEnum.findParamByType(type), componentId);
+
+		RestResponse sendGetServerRequest = sendGet(url, user.getUserId(), headersMap);
+
+		return sendGetServerRequest;
+
+	}
+
+	public static RestResponse deleteComponentInstance(User sdncModifierDetails, String componentId,
+			String resourceInstanceId, ComponentTypeEnum componentType) throws Exception {
+
+		return deleteComponentInstance(sdncModifierDetails, componentId, resourceInstanceId,
+				ComponentTypeEnum.findParamByType(componentType));
+	}
+
+	public static RestResponse deleteComponentInstance(User sdncModifierDetails, String componentId,
+			String resourceInstanceId, String componentTypeString) throws Exception {
+		Config config = Utils.getConfig();
+		String userId = sdncModifierDetails.getUserId();
+		String url = String.format(Urls.DELETE_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				componentTypeString, componentId, resourceInstanceId);
+		RestResponse sendCreateUserRequest = sendDelete(url, userId);
+		return sendCreateUserRequest;
+	}
+
+	public static RestResponse updateComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
+			User sdncModifierDetails, String componentId, ComponentTypeEnum componentType) throws IOException {
+
+		Config config = Utils.getConfig();
+		String userId = sdncModifierDetails.getUserId();
+		String serviceBodyJson = gson.toJson(componentInstanceReqDetails);
+		String url = String.format(Urls.UPDATE_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				ComponentTypeEnum.findParamByType(componentType), componentId,
+				componentInstanceReqDetails.getUniqueId());
+		RestResponse updateResourceInstance = sendPost(url, serviceBodyJson, userId, acceptHeaderData);
+		return updateResourceInstance;
+	}
+
+	//Tal G - CI for New API Multiple Instance Update
+	public static RestResponse updateMultipleComponentInstance(
+			List<ComponentInstanceReqDetails> componentInstanceReqDetailsList, User sdncModifierDetails,
+			String componentId, ComponentTypeEnum componentType) throws IOException {
+		Config config = Utils.getConfig();
+		String userId = sdncModifierDetails.getUserId();
+		String serviceBodyJson = gson.toJson(componentInstanceReqDetailsList.toArray());
+		String url = String.format(Urls.UPDATE_MULTIPLE_COMPONENT_INSTANCE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), componentId);
+		RestResponse updateResourceInstance = sendPost(url, serviceBodyJson, userId, acceptHeaderData);
+		return updateResourceInstance;
+	}
+
+	public static RestResponse associateInstances(RequirementCapabilityRelDef relation, User sdncModifierDetails,
+			String componentId, ComponentTypeEnum componentTypeEnum) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		String componentType = "";
+		switch (componentTypeEnum) {
+		case RESOURCE:
+			componentType = ComponentTypeEnum.RESOURCE_PARAM_NAME;
+			break;
+		case SERVICE:
+			componentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
+			break;
+		default:
+			break;
+		}
+		String serviceBodyJson = gson.toJson(relation);
+		String url = String.format(Urls.ASSOCIATE__RESOURCE_INSTANCE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), componentType, componentId);
+
+		RestResponse associateInstance = sendPost(url, serviceBodyJson, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		return associateInstance;
+
+	}
+
+	public static RestResponse dissociateInstances(RequirementCapabilityRelDef relation, User sdncModifierDetails,
+			String componentId, ComponentTypeEnum componentTypeEnum) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		String componentType = "";
+		switch (componentTypeEnum) {
+		case RESOURCE:
+			componentType = ComponentTypeEnum.RESOURCE_PARAM_NAME;
+			break;
+		case SERVICE:
+			componentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
+			break;
+		default:
+			break;
+		}
+		String serviceBodyJson = gson.toJson(relation);
+		String url = String.format(Urls.DISSOCIATE__RESOURCE_INSTANCE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), componentType, componentId);
+
+		RestResponse associateInstance = sendPut(url, serviceBodyJson, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		return associateInstance;
+
+	}
+
+	public static void checkComponentInstanceType(RestResponse response, String expectedComponentType) {
+		String actualComponentType = ResponseParser.getComponentTypeFromResponse(response);
+		assertTrue(expectedComponentType.equals(actualComponentType),
+				"Failed. expected: " + expectedComponentType + ", actual: " + actualComponentType + "/");
+	}
+
+	public static RestResponse updatePropertyValueOnResourceInstance(Component component, ComponentInstance instDetails,
+			User user, ComponentInstanceProperty updatedInstanceProperty) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
+
+		String url = String.format(Urls.UPDATE_PROPERTY_TO_RESOURCE_INSTANCE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
+				component.getUniqueId(), instDetails.getUniqueId());
+		String body = gson.toJson(updatedInstanceProperty);
+
+		RestResponse sendGetServerRequest = sendPost(url, body, user.getUserId(), acceptHeaderData);
+		return sendGetServerRequest;
+
+	}
+
+	public static RestResponse changeComponentInstanceVersion(Component container,
+			ComponentInstance componentInstanceToReplace, Component newInstance, User sdncModifierDetails)
+			throws Exception {
+
+		return changeComponentInstanceVersion(container.getUniqueId(), componentInstanceToReplace, newInstance,
+				sdncModifierDetails, container.getComponentType());
+	}
+
+	public static RestResponse changeComponentInstanceVersion(String containerUID,
+			ComponentInstance componentInstanceToReplace, Component component, User sdncModifierDetails,
+			ComponentTypeEnum componentType) throws IOException {
+
+		Config config = Utils.getConfig();
+		String resourceUid = ("{\"componentUid\":\"" + component.getUniqueId() + "\"}");
+		String url = String.format(Urls.CHANGE__RESOURCE_INSTANCE_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), containerUID,
+				componentInstanceToReplace.getUniqueId());
+		RestResponse changeResourceInstanceVersion = sendPost(url, resourceUid, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+
+		if (changeResourceInstanceVersion.getErrorCode() == 200
+				|| changeResourceInstanceVersion.getErrorCode() == 201) {
+			Gson gson = new Gson();
+			// ResourceInstanceReqDetails
+			// convertResourceInstanceResponseToJavaObject =
+			// ResponseParser.convertResourceInstanceResponseToJavaObject(createResourceInstance.getResponse());
+			ComponentInstanceReqDetails fromJson = gson.fromJson(changeResourceInstanceVersion.getResponse(),
+					ComponentInstanceReqDetails.class);
+
+			componentInstanceToReplace.setUniqueId(fromJson.getUniqueId());
+
+		}
+
+		return changeResourceInstanceVersion;
+
+	}
+
+	public static RestResponse changeComponentInstanceVersion(String componentUniqueId,
+			String serviceInstanceToReplaceUniqueId, String serviceUniqueId, User sdncModifierDetails,
+			ComponentTypeEnum componentType) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceUid = ("{\"componentUid\":\"" + serviceUniqueId + "\"}");
+		String url = String.format(Urls.CHANGE__RESOURCE_INSTANCE_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), componentUniqueId,
+				serviceInstanceToReplaceUniqueId);
+		RestResponse changeResourceInstanceVersion = sendPost(url, resourceUid, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		return changeResourceInstanceVersion;
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java
new file mode 100644
index 0000000..dcebe4a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.CapReqDef;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+public class ComponentRestUtils extends BaseRestUtils {
+	public static RestResponse getComponentRequirmentsCapabilities(User sdncModifierDetails,
+			ComponentReqDetails componentReqDetails) throws IOException {
+		Config config = Utils.getConfig();
+		ComponentTypeEnum componentType = null;
+		if (componentReqDetails instanceof ResourceReqDetails) {
+			componentType = ComponentTypeEnum.RESOURCE;
+		} else if (componentReqDetails instanceof ServiceReqDetails) {
+			componentType = ComponentTypeEnum.SERVICE;
+		} else if (componentReqDetails instanceof ProductReqDetails) {
+			componentType = ComponentTypeEnum.PRODUCT;
+		}
+		String url = String.format(Urls.GET_COMPONENT_REQUIRMENTS_CAPABILITIES, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType),
+				componentReqDetails.getUniqueId());
+		return sendGet(url, sdncModifierDetails.getUserId());
+	}
+
+	public static CapReqDef getAndParseComponentRequirmentsCapabilities(User user, ComponentReqDetails componentDetails)
+			throws IOException {
+		RestResponse getComponentReqCap = getComponentRequirmentsCapabilities(user, componentDetails);
+		ResourceRestUtils.checkSuccess(getComponentReqCap);
+		CapReqDef capReqDef = ResponseParser.parseToObject(getComponentReqCap.getResponse(), CapReqDef.class);
+		return capReqDef;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java
new file mode 100644
index 0000000..71735d5
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java
@@ -0,0 +1,245 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.Map;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+import com.google.gson.Gson;
+
+public class ConsumerRestUtils extends BaseRestUtils {
+
+	public static final int STATUS_CODE_SUCCESS = 200;
+	public static final int STATUS_CODE_CREATED = 201;
+	public static final int STATUS_CODE_DELETE = 204;
+	public static final int STATUS_CODE_NOT_FOUND = 404;
+	Utils utils = new Utils();
+	private static Long expectedsLastupdatedtime;
+	private static Long expectedLastAuthenticationTime;
+
+	public static RestResponse createConsumer(ConsumerDataDefinition consumerDataDefinition, User sdncModifierDetails)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		String userId = sdncModifierDetails.getUserId();
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(consumerDataDefinition);
+
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+		RestResponse createConsumerResponse = http.httpSendPost(url, userBodyJson, headersMap);
+		if (createConsumerResponse.getErrorCode() == STATUS_CODE_CREATED) {
+			ConsumerDataDefinition getConsumerDataObject = parseComsumerResp(createConsumerResponse);
+			consumerDataDefinition
+					.setConsumerDetailsLastupdatedtime(getConsumerDataObject.getConsumerDetailsLastupdatedtime());
+			consumerDataDefinition
+					.setConsumerLastAuthenticationTime(getConsumerDataObject.getConsumerLastAuthenticationTime());
+			consumerDataDefinition.setLastModfierAtuid(getConsumerDataObject.getLastModfierAtuid());
+		}
+		return createConsumerResponse;
+	}
+
+	public static RestResponse createConsumerHttpCspAtuUidIsMissing(ConsumerDataDefinition consumerDataDefinition,
+			User sdncModifierDetails) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		headersMap.remove("USER_ID");
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(consumerDataDefinition);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+		RestResponse createConsumerResponse = http.httpSendPost(url, userBodyJson, headersMap);
+		if (createConsumerResponse.getErrorCode() == STATUS_CODE_CREATED) {
+			ConsumerDataDefinition getConsumerDataObject = parseComsumerResp(createConsumerResponse);
+			consumerDataDefinition
+					.setConsumerDetailsLastupdatedtime(getConsumerDataObject.getConsumerDetailsLastupdatedtime());
+			consumerDataDefinition
+					.setConsumerLastAuthenticationTime(getConsumerDataObject.getConsumerLastAuthenticationTime());
+			consumerDataDefinition.setLastModfierAtuid(getConsumerDataObject.getLastModfierAtuid());
+		}
+		return createConsumerResponse;
+	}
+
+	public static RestResponse deleteConsumerHttpCspAtuUidIsMissing(ConsumerDataDefinition consumerDataDefinition,
+			User sdncModifierDetails) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				consumerDataDefinition.getConsumerName());
+
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		headersMap.remove("USER_ID");
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(consumerDataDefinition);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+		RestResponse deleteConsumerResponse = http.httpSendDelete(url, headersMap);
+		return deleteConsumerResponse;
+	}
+
+	public static ConsumerDataDefinition parseComsumerResp(RestResponse restResponse) throws Exception {
+
+		String bodyToParse = restResponse.getResponse();
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			ConsumerDataDefinition component = mapper.readValue(bodyToParse, ConsumerDataDefinition.class);
+			return component;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		return null;
+	}
+
+	public static RestResponse deleteConsumer(ConsumerDataDefinition consumerDataDefinition, User sdncModifierDetails)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				consumerDataDefinition.getConsumerName());
+
+		String userId = sdncModifierDetails.getUserId();
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		RestResponse deleteConsumerResponse = http.httpSendDelete(url, headersMap);
+		return deleteConsumerResponse;
+	}
+
+	public static RestResponse getConsumer(ConsumerDataDefinition consumerDataDefinition, User sdncModifierDetails)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				consumerDataDefinition.getConsumerName());
+
+		String userId = sdncModifierDetails.getUserId();
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		RestResponse getConsumerResponse = http.httpSendGet(url, headersMap);
+		return getConsumerResponse;
+	}
+
+	public static void validateConsumerReqVsResp(ConsumerDataDefinition consumerDefinition,
+			ConsumerDataDefinition getConsumerDataObject) {
+
+		String expected;
+
+		expected = consumerDefinition.getConsumerName();
+		assertEquals("consumer name - ", expected, getConsumerDataObject.getConsumerName());
+
+		expected = consumerDefinition.getConsumerPassword().toLowerCase();
+		assertEquals("consumer password  - ", expected, getConsumerDataObject.getConsumerPassword());
+
+		expected = consumerDefinition.getLastModfierAtuid();
+		assertEquals("consumer Last Modfier Atuid - ", expected, getConsumerDataObject.getLastModfierAtuid());
+
+		expected = consumerDefinition.getConsumerSalt();
+		assertEquals("consumer Salt - ", expected, getConsumerDataObject.getConsumerSalt());
+
+		expectedsLastupdatedtime = consumerDefinition.getConsumerDetailsLastupdatedtime();
+		assertEquals("consumer Last updated time - ", expectedsLastupdatedtime,
+				getConsumerDataObject.getConsumerDetailsLastupdatedtime());
+
+		expectedLastAuthenticationTime = consumerDefinition.getConsumerLastAuthenticationTime();
+		assertEquals("consumer Last authentication time - ", expectedLastAuthenticationTime,
+				getConsumerDataObject.getConsumerLastAuthenticationTime());
+	}
+
+	///// New
+	public enum EcompConsumerAuditJsonKeysEnum {
+		ACTION("ACTION"), MODIFIER("MODIFIER"), ECOMP_USER("ECOMP_USER"), STATUS("STATUS"), DESC("DESCRIPTION");
+		private String auditJsonKeyName;
+
+		private EcompConsumerAuditJsonKeysEnum(String auditJsonKeyName) {
+			this.auditJsonKeyName = auditJsonKeyName;
+		}
+
+		public String getAuditJsonKeyName() {
+			return auditJsonKeyName.toLowerCase();
+		}
+	}
+
+	/*
+	 * protected void resourceArtifatAuditSuccess(String action,
+	 * ArtifactReqDetails artifact, ResourceReqDetails resourceDetails , User
+	 * user) throws Exception { ExpectedResourceAuditJavaObject
+	 * expectedResourceAuditJavaObject =
+	 * Convertor.constructFieldsForAuditValidation(resourceDetails,
+	 * resourceDetails.getVersion(), user); String auditAction = action;
+	 * expectedResourceAuditJavaObject.setAction(auditAction);
+	 * expectedResourceAuditJavaObject.setPrevState("");
+	 * expectedResourceAuditJavaObject.setPrevVersion("");
+	 * expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.
+	 * NOT_CERTIFIED_CHECKOUT).toString());
+	 * expectedResourceAuditJavaObject.setStatus("200");
+	 * expectedResourceAuditJavaObject.setDesc("OK");
+	 * expectedResourceAuditJavaObject.setArtifactName(artifact.getArtifactName(
+	 * )); AuditUtils.validateAudit(expectedResourceAuditJavaObject,
+	 * auditAction, null); }
+	 */
+
+	/*
+	 * protected void resourceArtifatValidateAuditWithErrorMessage(String
+	 * actionStatus, ResourceReqDetails resourceDetails, String auditAction,
+	 * String setCurrState, Object ... variables)throws Exception { ErrorInfo
+	 * errorInfo = utils.parseYaml(actionStatus);
+	 * ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
+	 * Convertor.constructFieldsForAuditValidation(resourceDetails,
+	 * resourceDetails.getVersion(), sdncUserDetails);
+	 * expectedResourceAuditJavaObject.setAction(auditAction);
+	 * expectedResourceAuditJavaObject.setPrevState("");
+	 * expectedResourceAuditJavaObject.setPrevVersion("");
+	 * expectedResourceAuditJavaObject.setCurrState(setCurrState);
+	 * expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString())
+	 * ;
+	 * expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables)
+	 * ); expectedResourceAuditJavaObject.setArtifactName("");
+	 * AuditUtils.validateAudit(expectedResourceAuditJavaObject, auditAction,
+	 * null); }
+	 */
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
new file mode 100644
index 0000000..458aa4a
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
@@ -0,0 +1,253 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.openecomp.portalsdk.core.restful.domain.EcompRole;
+import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.run.StartTest;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+
+public class EcompUserRestUtils extends BaseRestUtils {
+
+	static Gson gson = new Gson();
+
+	static Logger logger = LoggerFactory.getLogger(EcompUserRestUtils.class.getName());
+	static String contentTypeHeaderData = "application/json";
+	static String acceptHeaderDate = "application/json";
+	static String ecompUsername = "12345";
+	static String ecompPassword = "12345";
+
+	public EcompUserRestUtils() {
+		super();
+
+		StartTest.enableLogger();
+	}
+
+	public static RestResponse pushUser(EcompUser ecompUser) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		String userBodyJson = gson.toJson(ecompUser);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_PUSH_USER, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		logger.debug("Send POST request to create user: {}", url);
+		logger.debug("User body: {}", userBodyJson);
+		logger.debug("User headers: {}", headersMap);
+
+		RestResponse sendPushUserResponse = http.httpSendPost(url, userBodyJson, headersMap);
+
+		return sendPushUserResponse;
+	}
+
+	/*
+	 * loginId - equals to userId
+	 */
+	public static RestResponse editUser(String loginId, EcompUser ecompUser) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		String userBodyJson = gson.toJson(ecompUser);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_EDIT_USER, config.getCatalogBeHost(), config.getCatalogBePort(), loginId);
+
+		logger.debug("Send POST request to edit user: {}", url);
+		logger.debug("User body: {}", userBodyJson);
+		logger.debug("User headers: {}", headersMap);
+
+		RestResponse sendEditUserResponse = http.httpSendPost(url, userBodyJson, headersMap);
+
+		return sendEditUserResponse;
+	}
+
+	/*
+	 * loginId - equals to userId
+	 */
+	public static RestResponse getUser(String loginId) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_GET_USER, config.getCatalogBeHost(), config.getCatalogBePort(), loginId);
+
+		logger.debug("Send GET request to get user: {}", url);
+		logger.debug("User headers: {}", headersMap);
+
+		RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
+
+		return sendGetUserRequest;
+	}
+
+	public static RestResponse getAllUsers() throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_GET_ALL_USERS, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		logger.debug("Send POST request to get all users: {}", url);
+		logger.debug("User headers: {}", headersMap);
+
+		RestResponse sendGetAllUsersRequest = http.httpSendGet(url, headersMap);
+
+		return sendGetAllUsersRequest;
+	}
+
+	public static RestResponse getAllAvailableRoles() throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_GET_ALL_AVAILABLE_ROLES, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		logger.debug("Send GET request to get all available roles: {}", url);
+		logger.debug("User headers: {}", headersMap);
+
+		RestResponse sendUpdateUserRequest = http.httpSendGet(url, headersMap);
+
+		return sendUpdateUserRequest;
+	}
+
+	/*
+	 * loginId - equals to userId
+	 */
+	public static RestResponse pushUserRoles(String loginId, List<EcompRole> roles) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		String roleBodyJson = gson.toJson(roles);
+		if(roleBodyJson.equals("[{}]")) {
+			roleBodyJson = "[]";
+		}
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_PUSH_USER_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(),
+				loginId);
+
+		logger.debug("Send POST request to push user role: {}", url);
+		logger.debug("Roles body: {}", roleBodyJson);
+		logger.debug("Request headers: {}", headersMap);
+
+		RestResponse sendpushUserRolesResponse = http.httpSendPost(url, roleBodyJson, headersMap);
+
+		return sendpushUserRolesResponse;
+	}
+
+	/*
+	 * loginId - equals to userId
+	 */
+	public static RestResponse getUserRoles(String loginId) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
+		headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.ECOMP_GET_USER_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(),
+				loginId);
+
+		logger.debug("Send GET request to get user roles: {}", url);
+		logger.debug("User headers: {}", headersMap);
+
+		RestResponse sendGetUserRolesRequest = http.httpSendGet(url, headersMap);
+
+		return sendGetUserRolesRequest;
+	}
+
+	// TODO !!!!!!!!!!!!!!
+	/*
+	 * Ask Eli if implementation of users is needed DELETE ECOMP USER
+	 */
+
+	/*
+	 * public static void main(String[] args) { EcompUser ecompUser = new
+	 * EcompUser(); ecompUser.setFirstName("Test");
+	 * ecompUser.setLastName("Testovich");
+	 * ecompUser.setActive(true);
+	 * 
+	 * EcompRole roleToUpdate = new EcompRole(); roleToUpdate.setId(new
+	 * Long(6)); roleToUpdate.setName("PRODUCT_STRATEGIST"); List<EcompRole>
+	 * listOfRoles = new LinkedList<>(); listOfRoles.add(roleToUpdate);
+	 * 
+	 * try {
+	 * System.out.println("\n-----------------------------\n Testing pushUser");
+	 * System.out.println(pushUser(ecompUser));
+	 * System.out.println("\n-----------------------------\n Testing editUser");
+	 * System.out.println("\n-----------------------------\n Testing getUser");
+	 * // System.out.println(getUser(ecompUser.getLoginId())); System.out.
+	 * println("\n-----------------------------\n Testing getAllUsers"); //
+	 * System.out.println(getAllUsers()); System.out.
+	 * println("\n-----------------------------\n Testing getAllAvailableRoles"
+	 * ); // System.out.println(getAllAvailableRoles().toString()); System.out.
+	 * println("\n-----------------------------\n Testing pushUserRoles");
+	 * TODO Auto-generated catch block e.printStackTrace(); } }
+	 */
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java
new file mode 100644
index 0000000..d79c8e0
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+import com.google.gson.Gson;
+
+public class GroupRestUtils extends BaseRestUtils {
+	public static String acceptHeaderDate = "application/json";
+	static Config config = Config.instance();
+	public static Gson gson = new Gson();
+
+	public static RestResponse getGroupById(Component component, String groupId, User user) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
+
+		String url = String.format(Urls.GET_GROUP_BY_ID, config.getCatalogBeHost(), config.getCatalogBePort(),
+				ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(), groupId);
+
+		RestResponse sendGetServerRequest = sendGet(url, user.getUserId(), headersMap);
+
+		return sendGetServerRequest;
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java
new file mode 100644
index 0000000..951831c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java
@@ -0,0 +1,408 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
+import org.apache.http.entity.mime.content.StringBody;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.codehaus.jettison.json.JSONException;
+import org.openecomp.sdc.be.dao.rest.HttpRestClient;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ImportTestTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.rest.api.RestResponseAsByteArray;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ImportRestUtils extends BaseRestUtils {
+
+	private static Logger log = LoggerFactory.getLogger(ImportRestUtils.class.getName());
+	private static Properties downloadCsarHeaders = new Properties();
+
+	static {
+		downloadCsarHeaders.put("Accept", "application/octet-stream");
+	}
+
+	@SuppressWarnings("unused")
+	private static Integer importNormativeResource(NormativeTypesEnum resource, UserRoleEnum userRole)
+			throws IOException {
+		Config config = Utils.getConfig();
+		CloseableHttpResponse response = null;
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resource.getFolderName())));
+		mpBuilder.addPart("resourceMetadata",
+				new StringBody(getTestJsonStringOfFile(resource.getFolderName(), resource.getFolderName() + ".json"),
+						ContentType.APPLICATION_JSON));
+
+		String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		CloseableHttpClient client = HttpClients.createDefault();
+		try {
+			HttpPost httpPost = new HttpPost(url);
+			httpPost.addHeader("USER_ID", userRole.getUserId());
+			httpPost.setEntity(mpBuilder.build());
+			response = client.execute(httpPost);
+			return response.getStatusLine().getStatusCode();
+		} finally {
+			closeResponse(response);
+			closeHttpClient(client);
+
+		}
+	}
+
+	/*
+	 * public static RestResponse importResourceByName(String resourceName, User
+	 * user) throws IOException { Config config = Utils.getConfig();
+	 * CloseableHttpResponse response = null; MultipartEntityBuilder mpBuilder =
+	 * MultipartEntityBuilder.create();
+	 * 
+	 * mpBuilder.addPart("resourceZip", new
+	 * FileBody(getTestZipFile(resourceName)));
+	 * mpBuilder.addPart("resourceMetadata", new
+	 * StringBody(getTestJsonStringOfFile(resourceName, resourceName + ".json"),
+	 * ContentType.APPLICATION_JSON));
+	 * 
+	 * String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE,
+	 * config.getCatalogBeHost(), config.getCatalogBePort());
+	 * 
+	 * CloseableHttpClient client = HttpClients.createDefault(); try { HttpPost
+	 * httpPost = new HttpPost(url); RestResponse restResponse = new
+	 * RestResponse(); httpPost.addHeader("USER_ID", user.getUserId());
+	 * httpPost.setEntity(mpBuilder.build()); response =
+	 * client.execute(httpPost); HttpEntity entity = response.getEntity();
+	 * String responseBody = null; if (entity != null) { InputStream instream =
+	 * entity.getContent(); StringWriter writer = new StringWriter();
+	 * IOUtils.copy(instream, writer); responseBody = writer.toString(); try {
+	 * 
+	 * } finally { instream.close(); } }
+	 * 
+	 * restResponse.setErrorCode(response.getStatusLine().getStatusCode());
+	 * restResponse.setResponse(responseBody); if (restResponse.getErrorCode()
+	 * == STATUS_CODE_CREATED ){
+	 * 
+	 * }
+	 * 
+	 * return restResponse;
+	 * 
+	 * } finally { closeResponse(response); closeHttpClient(client);
+	 * 
+	 * }
+	 * 
+	 * }
+	 */
+
+	public static RestResponse importResourceByName(ResourceReqDetails resourceDetails, User importer)
+			throws Exception {
+		Config config = Utils.getConfig();
+		CloseableHttpResponse response = null;
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resourceDetails.getName())));
+		mpBuilder.addPart("resourceMetadata",
+				new StringBody(getTestJsonStringOfFile(resourceDetails.getName(), resourceDetails.getName() + ".json"),
+						ContentType.APPLICATION_JSON));
+
+		String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		CloseableHttpClient client = HttpClients.createDefault();
+		try {
+			HttpPost httpPost = new HttpPost(url);
+			RestResponse restResponse = new RestResponse();
+			httpPost.addHeader("USER_ID", importer.getUserId());
+			httpPost.setEntity(mpBuilder.build());
+			response = client.execute(httpPost);
+			HttpEntity entity = response.getEntity();
+			String responseBody = null;
+			if (entity != null) {
+				InputStream instream = entity.getContent();
+				StringWriter writer = new StringWriter();
+				IOUtils.copy(instream, writer);
+				responseBody = writer.toString();
+				try {
+
+				} finally {
+					instream.close();
+				}
+			}
+
+			restResponse.setErrorCode(response.getStatusLine().getStatusCode());
+			restResponse.setResponse(responseBody);
+
+			if (restResponse.getErrorCode() == STATUS_CODE_CREATED) {
+				resourceDetails.setUUID(ResponseParser.getUuidFromResponse(restResponse));
+				resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
+				resourceDetails.setVersion(ResponseParser.getVersionFromResponse(restResponse));
+				resourceDetails.setCreatorUserId(importer.getUserId());
+				resourceDetails.setCreatorFullName(importer.getFullName());
+			}
+
+			return restResponse;
+
+		} finally {
+			closeResponse(response);
+			closeHttpClient(client);
+
+		}
+
+	}
+
+	public static RestResponse importNewResourceByName(String resourceName, UserRoleEnum userRole) throws IOException {
+		Config config = Utils.getConfig();
+
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resourceName)));
+		mpBuilder.addPart("resourceMetadata", new StringBody(
+				getTestJsonStringOfFile(resourceName, resourceName + ".json"), ContentType.APPLICATION_JSON));
+		HttpEntity requestEntity = mpBuilder.build();
+		String url = String.format(Urls.IMPORT_USER_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put("USER_ID", userRole.getUserId());
+
+		return HttpRequest.sendHttpPostWithEntity(requestEntity, url, headers);
+	}
+
+	public static RestResponse importNormativeResourceByName(String resourceName, UserRoleEnum userRole)
+			throws IOException {
+		Config config = Utils.getConfig();
+
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resourceName)));
+		mpBuilder.addPart("resourceMetadata", new StringBody(
+				getTestJsonStringOfFile(resourceName, resourceName + ".json"), ContentType.APPLICATION_JSON));
+		HttpEntity requestEntity = mpBuilder.build();
+		String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put("USER_ID", userRole.getUserId());
+
+		return HttpRequest.sendHttpPostWithEntity(requestEntity, url, headers);
+	}
+
+	public static RestResponse importTestResource(ImportTestTypesEnum resource, UserRoleEnum userRole)
+			throws IOException {
+		Config config = Utils.getConfig();
+		CloseableHttpResponse response = null;
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resource.getFolderName())));
+		mpBuilder.addPart("resourceMetadata",
+				new StringBody(getTestJsonStringOfFile(resource.getFolderName(), resource.getFolderName() + ".json"),
+						ContentType.APPLICATION_JSON));
+
+		String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		CloseableHttpClient client = HttpClients.createDefault();
+		try {
+			HttpPost httpPost = new HttpPost(url);
+			RestResponse restResponse = new RestResponse();
+			httpPost.addHeader("USER_ID", UserRoleEnum.ADMIN.getUserId());
+			httpPost.setEntity(mpBuilder.build());
+			response = client.execute(httpPost);
+			HttpEntity entity = response.getEntity();
+			String responseBody = null;
+			if (entity != null) {
+				InputStream instream = entity.getContent();
+				StringWriter writer = new StringWriter();
+				IOUtils.copy(instream, writer);
+				responseBody = writer.toString();
+				try {
+
+				} finally {
+					instream.close();
+				}
+			}
+
+			restResponse.setErrorCode(response.getStatusLine().getStatusCode());
+			// restResponse.setResponse(response.getEntity().toString());
+			restResponse.setResponse(responseBody);
+			return restResponse;
+		} finally {
+			closeResponse(response);
+			closeHttpClient(client);
+
+		}
+	}
+
+	public static Boolean removeNormativeTypeResource(NormativeTypesEnum current)
+			throws FileNotFoundException, IOException, ClientProtocolException {
+		User user = new User(UserRoleEnum.ADMIN.getFirstName(), UserRoleEnum.ADMIN.getLastName(),
+				UserRoleEnum.ADMIN.getUserId(), null, null, null);
+		RestResponse deleteResponse = ResourceRestUtils.deleteResourceByNameAndVersion(user, current.getNormativeName(),
+				"1.0");
+		if (deleteResponse.getErrorCode() == 200) {
+			return true;
+		}
+		return false;
+	}
+
+	public static void validateImportTestTypesResp(ImportTestTypesEnum currResource, RestResponse restResponse)
+			throws IOException, JSONException {
+
+		// assertTrue( status != ResourceUtils.STATUS_CODE_IMPORT_SUCCESS );
+
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(currResource.getActionStatus().name());
+
+		assertNotNull("check response object is not null after create service", restResponse);
+		assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
+		assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
+
+		// validate create service response vs actual
+		List<String> variables = (currResource.getErrorParams() != null ? currResource.getErrorParams()
+				: new ArrayList<String>());
+		if (restResponse.getErrorCode() != 200) {
+			ErrorValidationUtils.checkBodyResponseOnError(currResource.getActionStatus().name(), variables,
+					restResponse.getResponse());
+		}
+	}
+
+	private static String getTestJsonStringOfFile(String folderName, String fileName) throws IOException {
+		// String sourceDir = "src/test/resources/CI/importResourceTests";
+		Config config = Utils.getConfig();
+		String sourceDir = config.getImportResourceTestsConfigDir();
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + folderName,
+				fileName);
+		byte[] fileContent = Files.readAllBytes(filePath);
+		String content = new String(fileContent);
+		return content;
+	}
+
+	private static File getTestZipFile(String elementName) throws IOException {
+		Config config = Utils.getConfig();
+		String sourceDir = config.getImportResourceTestsConfigDir();
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName,
+				"normative-types-new-" + elementName + ".zip");
+		return filePath.toFile();
+	}
+
+	private static void closeHttpClient(CloseableHttpClient client) {
+		try {
+			if (client != null) {
+				client.close();
+			}
+		} catch (IOException e) {
+			log.debug("failed to close client or response: ", e);
+		}
+	}
+
+	private static void closeResponse(CloseableHttpResponse response) {
+		try {
+			if (response != null) {
+				response.close();
+			}
+		} catch (IOException e) {
+			log.debug("failed to close client or response: {}", e);
+		}
+	}
+
+	public static RestResponseAsByteArray getCsar(String csarUid, User sdncModifierDetails) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_CSAR_USING_SIMULATOR, config.getCatalogBeHost(), config.getCatalogBePort(),
+				csarUid);
+
+		String userId = sdncModifierDetails.getUserId();
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+
+		// Gson gson = new Gson();
+		// String userBodyJson = gson.toJson(resourceDetails);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+
+		HttpRestClient httpRestClient = new HttpRestClient();
+
+		for (Map.Entry<String, String> mapEntry : headersMap.entrySet()) {
+
+			downloadCsarHeaders.put(mapEntry.getKey(), mapEntry.getValue());
+		}
+		RestResponseAsByteArray doGetAsByteArray = httpRestClient.doGetAsByteArray(url, downloadCsarHeaders);
+		// RestResponse getCsar = http.httpSendGet(url, headersMap);
+
+		return doGetAsByteArray;
+
+	}
+
+	private static File getGroupTypeZipFile(String elementName) throws IOException {
+		Config config = Utils.getConfig();
+		String sourceDir = config.getImportResourceTestsConfigDir();
+		sourceDir += File.separator + ".." + File.separator + "importTypesTest" + File.separator;
+		java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName,
+				elementName + ".zip");
+		return filePath.toFile();
+	}
+
+	public static RestResponse importNewGroupTypeByName(String groupTypeName, UserRoleEnum userRole)
+			throws IOException {
+		Config config = Utils.getConfig();
+
+		MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
+
+		mpBuilder.addPart("groupTypesZip", new FileBody(getGroupTypeZipFile(groupTypeName)));
+		HttpEntity requestEntity = mpBuilder.build();
+		String url = String.format(Urls.IMPORT_GROUP_TYPE, config.getCatalogBeHost(), config.getCatalogBePort());
+		Map<String, String> headers = new HashMap<String, String>();
+		headers.put("USER_ID", userRole.getUserId());
+
+		return HttpRequest.sendHttpPostWithEntity(requestEntity, url, headers);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java
new file mode 100644
index 0000000..de7be07
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java
@@ -0,0 +1,122 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstInputsMap;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+
+/**
+ * RestUtils for inputs
+ * 
+ * @author il0695
+ *
+ */
+public class InputsRestUtils extends BaseRestUtils {
+
+	@SuppressWarnings("unused")
+	private static Logger logger = LoggerFactory.getLogger(InputsRestUtils.class.getName());
+	
+	/**
+	 * Add inputs to service
+	 * 
+	 * @param component
+	 * @param inputs
+	 * @param userRole
+	 * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
+	 * @throws Exception
+	 */
+	public static RestResponse addInput(Component component, ComponentInstInputsMap inputs, UserRoleEnum userRole) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.ADD_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
+		String json = new Gson().toJson(inputs);
+		return sendPost(url, json, userRole.getUserId(), acceptHeaderData);
+	}
+
+	/**
+	 * Get all Component inputs
+	 * 
+	 * @param component
+	 * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
+	 * @throws Exception
+	 */
+	public static RestResponse getComponentInputs(Component component) throws Exception {
+		Config config = Utils.getConfig();
+		//services/{componentId}/inputs
+		String url = String.format(Urls.GET_COMPONENT_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(), component.getUniqueId());		
+		return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+	}
+	
+	/**
+	 * Get all inputs of component instance
+	 * 
+	 * @param parentComponent
+	 * @param componentInstance
+	 * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
+	 * @throws Exception
+	 */
+	public static RestResponse getComponentInstanceInputs(Component parentComponent, ComponentInstance componentInstance) throws Exception {
+		Config config = Utils.getConfig();
+		//{componentType}/{componentId}/componentInstances/{instanceId}/{originComonentUid}/inputs		
+		String url = String.format(Urls.GET_COMPONENT_INSTANCE_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(), ComponentTypeEnum.findParamByType(parentComponent.getComponentType()), parentComponent.getUniqueId(), componentInstance.getUniqueId(), componentInstance.getComponentUid());
+		return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+	}
+	
+	/**
+	 * Delete input from component
+	 * 
+	 * @param parentComponent
+	 * @param inputId
+	 * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
+	 * @throws Exception
+	 */
+	public static RestResponse deleteInputFromComponent(Component parentComponent, String inputId) throws Exception {
+		return deleteInputFromComponent(ComponentTypeEnum.findParamByType(parentComponent.getComponentType()), parentComponent.getUniqueId(), inputId);
+	}
+
+	/**
+	 * Delete input from component
+	 * 
+	 * @param componentType
+	 * @param componentId
+	 * @param inputUniqueId
+	 * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
+	 * @throws Exception
+	 */
+	public static RestResponse deleteInputFromComponent(String componentType, String componentId, String inputUniqueId) throws Exception {
+		Config config = Utils.getConfig();
+		//{componentType}/{componentId}/delete/{inputId}/input
+		String url = String.format(Urls.DELETE_INPUT_BY_ID, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, componentId, inputUniqueId);
+		return sendDelete(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+	}
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java
new file mode 100644
index 0000000..d53d2da
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java
@@ -0,0 +1,451 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.json.simple.JSONObject;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LifecycleRestUtils extends BaseRestUtils {
+	private static Logger logger = LoggerFactory.getLogger(LifecycleRestUtils.class.getName());
+	public static final String COMMENT = "comment";
+	
+	// External APIs
+	public static RestResponse checkInResource(String resourceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Chekin resource: " + resourceUUID;
+		return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKIN, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse checkInService(String serviceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Chekin service: " + serviceUUID;
+		return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKIN, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse checkOutResource(String resourceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "CheckOut resource: " + resourceUUID;
+		return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKOUT, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse checkOutService(String serviceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "CheckOut service: " + serviceUUID;
+		return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKOUT, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse certificationRequestService(String serviceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Certification request service: " + serviceUUID;
+		return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CERTIFICATIONREQUEST, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse certificationRequestResource(String resourceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Certification request resource: " + resourceUUID;
+		return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CERTIFICATIONREQUEST, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse startTestingService(String serviceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Start testing request service: " + serviceUUID;
+		return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.STARTCERTIFICATION, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse startTestingResource(String resourceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Start testing request resource: " + resourceUUID;
+		return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.STARTCERTIFICATION, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse certifyService(String serviceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Certify request service: " + serviceUUID;
+		return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CERTIFY, sdncModifierDetails, comment);
+	}
+	
+	public static RestResponse certifyResource(String resourceUUID, User sdncModifierDetails) throws IOException {
+		String comment = "Certify request resource: " + resourceUUID;
+		return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CERTIFY, sdncModifierDetails, comment);
+	}
+	
+	
+	
+	
+	
+	private static RestResponse changeLifeCycleOfAsset(String assetUUID, AssetTypeEnum assetTypeEnum, LifeCycleStatesEnum lifeCycleStatesEnum, User sdncModifierDetails, String comment) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.POST_EXTERNAL_API_CHANGE_LIFE_CYCLE_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), assetTypeEnum.getValue(), assetUUID, lifeCycleStatesEnum.getState());
+		
+		Map<String, String> additionalHeaders = new HashMap<String, String>();
+		
+		additionalHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		additionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		String jsonBody = "{\"userRemarks\": \"" + comment + "\"}";
+
+		RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
+
+		return res;
+	}
+	
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+	public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
+			String version, LifeCycleStatesEnum LifeCycleStatesEnum) throws IOException {
+		return changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum,
+				createLifecycleCommentJson(COMMENT));
+	}
+
+	public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
+			String version, LifeCycleStatesEnum LifeCycleStatesEnum, String LifecycleChangeInfo) throws IOException {
+
+		return changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum, LifecycleChangeInfo);
+
+	}
+
+	public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum) throws IOException {
+
+		return changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum,
+				createLifecycleCommentJson(COMMENT));
+
+	}
+
+	public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, String modifierUserId,
+			LifeCycleStatesEnum LifeCycleStatesEnum) throws IOException {
+		User user = new User();
+		user.setUserId(modifierUserId);
+		return changeResourceState(resourceDetails, user, LifeCycleStatesEnum, createLifecycleCommentJson(COMMENT));
+	}
+
+	private static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum, String LifecycleChangeInfo) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CHANGE_RESOURCE_LIFECYCLE_STATE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), resourceDetails.getUniqueId(), LifeCycleStatesEnum);
+		// System.out.println("url: " + url);
+
+		RestResponse LifeCycleStatesEnumResourceResponse = sendPost(url, LifecycleChangeInfo,
+				sdncModifierDetails.getUserId(), acceptHeaderData);
+		if (LifeCycleStatesEnumResourceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
+			String stateFromJsonResponse = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumResourceResponse.getResponse(), "lifecycleState");
+			resourceDetails.setVersion(ResponseParser.getVersionFromResponse(LifeCycleStatesEnumResourceResponse));
+			resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(LifeCycleStatesEnumResourceResponse));
+			if (stateFromJsonResponse != null) {
+				resourceDetails.setLifecycleState(LifecycleStateEnum.valueOf(stateFromJsonResponse));
+			}
+		}
+		return LifeCycleStatesEnumResourceResponse;
+	}
+
+	public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
+			String version, LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
+		{
+			return changeServiceState(serviceDetails, sdncModifierDetails, version, LifeCycleStatesEnum,
+					createLifecycleCommentJson(COMMENT));
+		}
+	}
+
+	public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
+		{
+			return changeServiceState(serviceDetails, sdncModifierDetails, null, LifeCycleStatesEnum,
+					createLifecycleCommentJson(COMMENT));
+		}
+	}
+
+	public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
+		{
+			return changeServiceState(serviceDetails, sdncModifierDetails, null, LifeCycleStatesEnum,
+					lifecycleChangeInfo);
+		}
+	}
+
+	public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
+			String version, LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
+
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CHANGE_SERVICE_LIFECYCLE_STATE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), serviceDetails.getUniqueId(), LifeCycleStatesEnum);
+		// System.out.println("url: " + url);
+		RestResponse LifeCycleStatesEnumServiceResponse = http.httpSendPost(url, lifecycleChangeInfo, headersMap);
+		if (LifeCycleStatesEnumServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
+			String serviceUniqueId = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "uniqueId");
+			serviceDetails.setUniqueId(serviceUniqueId);
+			String serviceVersion = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "version");
+			serviceDetails.setVersion(serviceVersion);
+			String stateFromJsonResponse = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "lifecycleState");
+			serviceDetails.setLifecycleState(LifecycleStateEnum.valueOf(stateFromJsonResponse));
+		}
+		return LifeCycleStatesEnumServiceResponse;
+	}
+
+	public static RestResponse changeProductState(Product product, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
+		{
+			return _changeProductState(product, sdncModifierDetails, LifeCycleStatesEnum, lifecycleChangeInfo);
+		}
+	}
+
+	public static RestResponse changeProductState(Product product, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
+		{
+			return _changeProductState(product, sdncModifierDetails, LifeCycleStatesEnum, COMMENT);
+		}
+	}
+
+	public static RestResponse changeProductState(ProductReqDetails productDetails, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CHANGE_PRODUCT_LIFECYCLE_STATE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), productDetails.getUniqueId(), LifeCycleStatesEnum);
+		RestResponse LifeCycleStatesEnumServiceResponse = sendPost(url, createLifecycleCommentJson(COMMENT),
+				sdncModifierDetails.getUserId(), acceptHeaderData);
+		if (LifeCycleStatesEnumServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
+			String productUniqueId = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "uniqueId");
+			productDetails.setUniqueId(productUniqueId);
+			String productVersion = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "version");
+			productDetails.setVersion(productVersion);
+			String newLifecycleState = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "lifecycleState");
+			productDetails.setLifecycleState(LifecycleStateEnum.valueOf(newLifecycleState));
+		}
+		return LifeCycleStatesEnumServiceResponse;
+
+	}
+
+	public static RestResponse changeComponentState(Component component, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CHANGE_COMPONENT_LIFECYCLE_STATE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
+				component.getUniqueId(), LifeCycleStatesEnum);
+		RestResponse LifeCycleStatesEnumServiceResponse = sendPost(url, createLifecycleCommentJson(COMMENT),
+				sdncModifierDetails.getUserId(), acceptHeaderData);
+		if (LifeCycleStatesEnumServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
+			String productUniqueId = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "uniqueId");
+			component.setUniqueId(productUniqueId);
+			String productVersion = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "version");
+			component.setVersion(productVersion);
+			String newLifecycleState = ResponseParser
+					.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "lifecycleState");
+			component.setLifecycleState(LifecycleStateEnum.valueOf(newLifecycleState));
+		}
+		return LifeCycleStatesEnumServiceResponse;
+
+	}
+
+	public static RestResponse certifyResource(ResourceReqDetails resourceDetails) throws Exception {
+		RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
+		// if (restResponseResource.getErrorCode() == 200){
+		restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		// }else
+		// return restResponseResource;
+		User testerDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+		if (restResponseResource.getErrorCode() == 200) {
+			restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, testerDetails,
+					LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponseResource;
+		if (restResponseResource.getErrorCode() == 200) {
+			restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, testerDetails,
+					LifeCycleStatesEnum.CERTIFY);
+			if (restResponseResource.getErrorCode() == 200) {
+				String newVersion = ResponseParser.getVersionFromResponse(restResponseResource);
+				resourceDetails.setVersion(newVersion);
+				resourceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
+				resourceDetails.setLastUpdaterUserId(testerDetails.getUserId());
+				resourceDetails.setLastUpdaterFullName(testerDetails.getFullName());
+				String uniqueIdFromRresponse = ResponseParser.getUniqueIdFromResponse(restResponseResource);
+				resourceDetails.setUniqueId(uniqueIdFromRresponse);
+			}
+		}
+		return restResponseResource;
+	}
+
+	public static RestResponse certifyService(ServiceReqDetails serviceDetails) throws Exception {
+		RestResponse restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
+		// if (restResponseService.getErrorCode() == 200){
+		restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
+		// }else
+		// return restResponseService;
+		if (restResponseService.getErrorCode() == 200) {
+			restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails,
+					ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
+		} else
+			return restResponseService;
+		if (restResponseService.getErrorCode() == 200) {
+			User testerDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
+			restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, testerDetails,
+					LifeCycleStatesEnum.CERTIFY);
+			if (restResponseService.getErrorCode() == 200) {
+				String newVersion = ResponseParser.getVersionFromResponse(restResponseService);
+				serviceDetails.setVersion(newVersion);
+				serviceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
+				serviceDetails.setLastUpdaterUserId(testerDetails.getUserId());
+				serviceDetails.setLastUpdaterFullName(testerDetails.getFullName());
+				String uniqueIdFromRresponse = ResponseParser.getUniqueIdFromResponse(restResponseService);
+				serviceDetails.setUniqueId(uniqueIdFromRresponse);
+			}
+		}
+		return restResponseService;
+	}
+
+	private static RestResponse _changeProductState(Product product, User sdncModifierDetails,
+			LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CHANGE_PRODUCT_LIFECYCLE_STATE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), product.getUniqueId(), LifeCycleStatesEnum);
+		RestResponse LifeCycleStatesEnumServiceResponse = sendPost(url, createLifecycleCommentJson(lifecycleChangeInfo),
+				sdncModifierDetails.getUserId(), acceptHeaderData);
+
+		return LifeCycleStatesEnumServiceResponse;
+	}
+
+	public static String createLifecycleCommentJson(String commentContent) {
+		String res = null;
+		if (commentContent != null) {
+			res = "{\"userRemarks\": \"" + commentContent + "\"}";
+		}
+		return res;
+	}
+
+	public static void checkLCS_Response(RestResponse response) {
+		checkStatusCode(response, "change lifecycle request failed", false, STATUS_CODE_SUCCESS);
+	}
+
+	private static Map<String, String> prepareHeadersMap(User sdncModifierDetails) {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		return headersMap;
+	}
+
+	public static RestResponse changeDistributionStatus(ServiceReqDetails serviceDetails, String version, User user,
+			String userRemarks, DistributionStatusEnum reqDistributionStatus) throws Exception {
+		String uniqueId = serviceDetails.getUniqueId();
+		Config config = Utils.getConfig();
+		String environmentName = "PROD-Andreys-Only";
+//		String environmentName = ConfigurationManager.getConfigurationManager().getDistributionEngineConfiguration().getEnvironments().get(0);
+		DistributionStatusEnum distributionStatusEnum = DistributionStatusEnum.findState(reqDistributionStatus.getValue());
+		switch(distributionStatusEnum){
+			case DISTRIBUTION_APPROVED:
+				return sendApproveDistribution(user, uniqueId, userRemarks);
+			case DISTRIBUTED:
+				String url = String.format(Urls.ACTIVATE_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(), uniqueId, environmentName);
+				return sendDistrState(user, userRemarks, url);
+			case DISTRIBUTION_REJECTED:
+				return rejectDistribution(user, userRemarks, uniqueId);
+			default:
+				return null;	
+			
+		}
+		
+//		if (reqDistributionStatus == DistributionStatusEnum.DISTRIBUTION_APPROVED) {
+//			return sendApproveDistribution(user, uniqueId, userRemarks);
+//		} else if (reqDistributionStatus == DistributionStatusEnum.DISTRIBUTION_REJECTED) {
+//			return rejectDistribution(user, userRemarks, uniqueId);
+//		} else if (reqDistributionStatus == DistributionStatusEnum.DISTRIBUTED) {
+//			Config config = Utils.getConfig();
+//			// String url =
+//			// String.format("http://%s:%s/sdc2/rest/v1/catalog/services/%s/tempUrlToBeDeleted",
+//			// config.getCatalogBeHost(), config.getCatalogBePort(), uniqueId);
+//			String url = String.format(Urls.ACTIVATE_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
+//					uniqueId, "PROD");
+//			return sendDistrState(user, userRemarks, url);
+//		} else
+//			return null;
+
+	}
+
+	public static RestResponse sendApproveDistribution(User sdncModifierDetails, String uniqueId, String userRemarks)
+			throws FileNotFoundException, IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.APPROVE_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
+				uniqueId);
+		return sendDistrState(sdncModifierDetails, userRemarks, url);
+	}
+
+	public static RestResponse rejectDistribution(ServiceReqDetails serviceDetails, String version, User user,
+			String userRemarks) throws Exception {
+		return rejectDistribution(user, userRemarks, serviceDetails.getUniqueId());
+	}
+
+	public static RestResponse rejectDistribution(User user, String userRemarks, String uniqueId)
+			throws FileNotFoundException, IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.REJECT_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
+				uniqueId);
+		return sendDistrState(user, userRemarks, url);
+	}
+
+	private static RestResponse sendDistrState(User user, String userRemarks, String url) throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(user);
+		Map<String, String> userRemarksMap = new HashMap<String, String>();
+		userRemarksMap.put("userRemarks", userRemarks);
+
+		String serviceBodyJson = new JSONObject().toJSONString(userRemarksMap);
+
+		HttpRequest httpRequest = new HttpRequest();
+		logger.debug(url);
+		logger.debug("Send POST request to create service: {}", url);
+		logger.debug("Service body: {}", serviceBodyJson);
+		logger.debug("Service headers: {}", headersMap);
+		RestResponse rejectDistributionResponse = httpRequest.httpSendPost(url, serviceBodyJson, headersMap);
+
+		return rejectDistributionResponse;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java
new file mode 100644
index 0000000..93c0d05
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java
@@ -0,0 +1,196 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+
+import com.google.gson.Gson;
+
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ProductRestUtils extends BaseRestUtils {
+	private static Gson gson = new Gson();
+	private static Logger logger = LoggerFactory.getLogger(ProductRestUtils.class.getName());
+
+	public static RestResponse createProduct(ProductReqDetails product, User user) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort());
+		String serviceBodyJson = gson.toJson(product);
+
+		logger.debug("Send POST request to create service: {}", url);
+		logger.debug("Service body: {}", serviceBodyJson);
+
+		RestResponse res = sendPost(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
+		if (res.getErrorCode() == STATUS_CODE_CREATED) {
+			product.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+			product.setVersion(ResponseParser.getVersionFromResponse(res));
+			product.setUUID(ResponseParser.getUuidFromResponse(res));
+			// Creator details never change after component is created - Ella,
+			// 12/1/2016
+			product.setCreatorUserId(user.getUserId());
+			product.setCreatorFullName(user.getFullName());
+			product.setLastUpdaterFullName(user.getFullName());
+			product.setLastUpdaterUserId(user.getUserId());
+			product.setLastUpdaterFullName(user.getFullName());
+			product.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+			product.setVersion("0.1");
+			String lastUpdate = ResponseParser.getValueFromJsonResponse(res.getResponse(), "lastUpdateDate");
+			product.setLastUpdateDate(Long.parseLong(lastUpdate, 10));
+			product.setCreationDate(Long.parseLong(lastUpdate, 10));
+		}
+		return res;
+	}
+
+	public static RestResponse updateProduct(ProductReqDetails product, User user) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(),
+				product.getUniqueId());
+		String serviceBodyJson = gson.toJson(product);
+
+		logger.debug("Send POST request to create service: {}", url);
+		logger.debug("Service body: {}", serviceBodyJson);
+
+		RestResponse res = sendPut(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
+		if (res.getErrorCode() == STATUS_CODE_CREATED) {
+			product.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+			product.setVersion(ResponseParser.getVersionFromResponse(res));
+			product.setUUID(ResponseParser.getUuidFromResponse(res));
+			// Creator details never change after component is created - Ella,
+			// 12/1/2016
+			product.setCreatorUserId(user.getUserId());
+			product.setCreatorFullName(user.getFullName());
+			product.setLastUpdaterFullName(user.getFullName());
+			product.setLastUpdaterUserId(user.getUserId());
+			product.setLastUpdaterFullName(user.getFullName());
+			product.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
+			String valueFromJsonResponse = ResponseParser.getValueFromJsonResponse(res.getResponse(), "version");
+			product.setVersion(valueFromJsonResponse);
+			String lastUpdate = ResponseParser.getValueFromJsonResponse(res.getResponse(), "lastUpdateDate");
+			product.setLastUpdateDate(Long.parseLong(lastUpdate, 10));
+			product.setCreationDate(Long.parseLong(lastUpdate, 10));
+		}
+		return res;
+	}
+
+	public static RestResponse createProduct_Invalid_Json(String userId) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		RestResponse res = sendPost(url, "kukumuku", userId, acceptHeaderData);
+		return res;
+	}
+
+	public static RestResponse deleteProduct(String id, String userId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), id);
+		return sendDelete(url, userId);
+	}
+
+	public static RestResponse getProduct(String productId) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), productId);
+		logger.debug("Send GET request to get product: {}", url);
+
+		return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
+	}
+
+	public static RestResponse getProduct(String productId, String userId) throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), productId);
+		logger.debug("Send GET request to get product: {}", url);
+
+		return sendGet(url, userId);
+	}
+
+	public static RestResponse getFollowed(String userId) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
+		logger.debug("Send GET request to get user followed page: {}", url);
+		return sendGet(url, userId);
+
+	}
+
+	public static RestResponse changeProductLifeCycle(Product product, User userModifier, LifeCycleStatesEnum lifeCycle)
+			throws Exception {
+		String checkinComment = "my comment";
+		RestResponse changeLifeCycleResponse = LifecycleRestUtils.changeProductState(product, userModifier, lifeCycle,
+				checkinComment);
+		if (changeLifeCycleResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
+			product.setLastUpdaterUserId(userModifier.getUserId());
+			product.setLastUpdaterFullName(userModifier.getFullName());
+			String latestVersion = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
+					"version");
+			product.setVersion(latestVersion);
+			String lifecycleState = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
+					"lifecycleState");
+			product.setLifecycleState((LifecycleStateEnum.valueOf(lifecycleState)));
+			String uniqueId = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
+					"uniqueId");
+			product.setUniqueId(uniqueId);
+			String lastUpdate = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
+					"lastUpdateDate");
+			product.setLastUpdateDate((Long.parseLong(lastUpdate, 10)));
+			String uuid = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(), "uuid");
+			product.setUUID(uuid);
+		}
+		return changeLifeCycleResponse;
+	}
+
+	public static RestResponse changeServiceInstanceVersion(String componentUniqueId,
+			String serviceInstanceToReplaceUniqueId, String serviceUniqueId, User sdncModifierDetails,
+			ComponentTypeEnum componentType) throws IOException {
+		Config config = Utils.getConfig();
+		String resourceUid = ("{\"componentUid\":\"" + serviceUniqueId + "\"}");
+		String url = String.format(Urls.CHANGE__RESOURCE_INSTANCE_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), componentUniqueId,
+				serviceInstanceToReplaceUniqueId);
+		RestResponse changeResourceInstanceVersion = sendPost(url, resourceUid, sdncModifierDetails.getUserId(),
+				acceptHeaderData);
+		return changeResourceInstanceVersion;
+
+	}
+
+	public static RestResponse getProductByNameAndVersion(String productName, String productVersion, String userId)
+			throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_PRODUCT_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), productName, productVersion);
+		logger.debug("Send GET request to get product by name and version: {}", url);
+		return sendGet(url, userId);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java
new file mode 100644
index 0000000..b035694
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java
@@ -0,0 +1,310 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PropertyRestUtils extends BaseRestUtils {
+	private static Logger logger = LoggerFactory.getLogger(PropertyRestUtils.class.getName());
+
+	public static RestResponse createProperty(String resourceId, String body, User user) throws Exception {
+		Config config = Config.instance();
+		String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId);
+
+		return sendPost(url, body, user.getUserId(), acceptHeaderData);
+	}
+
+	public static RestResponse updateProperty(String resourceId, String propertyId, String body, User user)
+			throws Exception {
+		Config config = Config.instance();
+
+		String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId, propertyId);
+		return sendPut(url, body, user.getUserId(), acceptHeaderData);
+	}
+
+	public static RestResponse getProperty(String resourceId, String propertyId, User user) throws Exception {
+		Config config = Config.instance();
+		String url = String.format(Urls.GET_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId,
+				propertyId);
+		return sendGet(url, user.getUserId());
+	}
+
+	public static RestResponse deleteProperty(String resourceId, String propertyId, User user) throws Exception {
+		Config config = Config.instance();
+		String url = String.format(Urls.DELETE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId, propertyId);
+
+		return sendDelete(url, user.getUserId());
+	}
+
+	public static ComponentInstanceProperty getPropFromListByPropNameAndType(List<ComponentInstanceProperty> propList,
+			String propNameToUpdate, String propTypeToUpdate) {
+		for (ComponentInstanceProperty componentInstanceProperty : propList) {
+			if (componentInstanceProperty.getName().equals(propNameToUpdate)
+					&& componentInstanceProperty.getType().equals(propTypeToUpdate)) {
+				return componentInstanceProperty;
+			}
+		}
+		return null;
+	}
+
+	public static ComponentInstanceProperty getPropFromListByPropNameTypeAndPath(
+			List<ComponentInstanceProperty> propList, String propNameToUpdate, String propTypeToUpdate,
+			List<String> path) {
+		for (ComponentInstanceProperty componentInstanceProperty : propList) {
+			if (componentInstanceProperty.getPath() == null) {
+				return getPropFromListByPropNameAndType(propList, propNameToUpdate, propTypeToUpdate);
+			}
+			if (componentInstanceProperty.getName().equals(propNameToUpdate)
+					&& componentInstanceProperty.getType().equals(propTypeToUpdate)
+					&& path.containsAll(componentInstanceProperty.getPath())) {
+				return componentInstanceProperty;
+			}
+		}
+		return null;
+	}
+
+	public static ComponentInstanceProperty getPropFromListByPropIdAndPath(List<ComponentInstanceProperty> propList,
+			String propId, List<String> path) {
+
+		for (ComponentInstanceProperty componentInstanceProperty : propList) {
+			if (path != null) {
+				if (componentInstanceProperty.getUniqueId().equals(propId)
+						&& componentInstanceProperty.getPath().equals(path)) {
+					return componentInstanceProperty;
+				}
+			} else {
+				if (componentInstanceProperty.getUniqueId().equals(propId)) {
+					return componentInstanceProperty;
+				}
+			}
+		}
+		return null;
+	}
+
+	public static void comparePropertyLists(List<ComponentInstanceProperty> expectedList,
+			List<ComponentInstanceProperty> actualList, Boolean isUpdate) {
+
+		assertTrue(
+				"list size are not equals, expected size is: " + expectedList.size() + " ,actual: " + actualList.size(),
+				expectedList.size() == actualList.size());
+		Boolean flag = false;
+		for (ComponentInstanceProperty expectedcompInstProp : expectedList) {
+			for (ComponentInstanceProperty actualcompInstProp : actualList) {
+				flag = comparePropertyObjects(expectedcompInstProp, actualcompInstProp, isUpdate);
+				if (flag) {
+					break;
+				}
+			}
+		}
+		// System.out.println("expected: " + expectedList + ", actual: " +
+		// actualList);
+		logger.debug("expected: {}, actual: {}",expectedList,actualList);
+		assertTrue("actual lists does not contain all uniqeIds", flag);
+	}
+
+	public static Boolean comparePropertyObjects(ComponentInstanceProperty expectedCompInstProp,
+			ComponentInstanceProperty actualCompInstProp, Boolean isUpdate) {
+		String uniqueId = expectedCompInstProp.getUniqueId();
+		String type = expectedCompInstProp.getType();
+		String defaulValue = expectedCompInstProp.getDefaultValue();
+		if (actualCompInstProp.getUniqueId().equals(uniqueId)
+				&& actualCompInstProp.getPath().equals(expectedCompInstProp.getPath())) {
+			assertTrue("expected type is: " + type + " ,actual: " + actualCompInstProp.getType(),
+					actualCompInstProp.getType().equals(type));
+			if (defaulValue == null) {
+				assertTrue(
+						"expected defaulValue is: " + defaulValue + " ,actual: " + actualCompInstProp.getDefaultValue(),
+						actualCompInstProp.getDefaultValue() == defaulValue);
+			} else {
+				assertTrue(
+						"expected defaulValue is: " + defaulValue + " ,actual: " + actualCompInstProp.getDefaultValue(),
+						actualCompInstProp.getDefaultValue().equals(defaulValue));
+			}
+			if (isUpdate) {
+				assertTrue(
+						"actual [Value] parameter " + actualCompInstProp.getName()
+								+ "should equal to expected [Value]: " + actualCompInstProp.getValue() + " ,Value: "
+								+ actualCompInstProp.getValue(),
+						actualCompInstProp.getValue().equals(expectedCompInstProp.getValue()));
+				assertNotNull("valueId is null", actualCompInstProp.getValueUniqueUid());
+			} else {
+				if (defaulValue == null) {
+					assertTrue(
+							"actual [Value] parameter " + actualCompInstProp.getName()
+									+ "should equal to expected [defaultValue]: " + actualCompInstProp.getValue()
+									+ " ,defaultValue: " + actualCompInstProp.getDefaultValue(),
+							actualCompInstProp.getValue() == expectedCompInstProp.getDefaultValue());
+				} else {
+					assertTrue(
+							"actual [Value] parameter " + actualCompInstProp.getName()
+									+ "should equal to expected [defaultValue]: " + actualCompInstProp.getValue()
+									+ " ,defaultValue: " + actualCompInstProp.getDefaultValue(),
+							actualCompInstProp.getValue().equals(expectedCompInstProp.getDefaultValue()));
+				}
+				assertNull("valueId is not null", actualCompInstProp.getValueUniqueUid());
+			}
+			return true;
+		}
+		return false;
+	}
+
+	public static List<ComponentInstanceProperty> addResourcePropertiesToList(Resource resource,
+			List<ComponentInstanceProperty> listToFill) {
+		for (PropertyDefinition prop : resource.getProperties()) {
+			listToFill.add(new ComponentInstanceProperty(prop, null, null));
+		}
+		return listToFill;
+	}
+
+	public static List<ComponentInstanceProperty> addComponentInstPropertiesToList(Component component,
+			List<ComponentInstanceProperty> listToFill, String componentId) {
+
+		if (componentId != null) {
+			List<ComponentInstanceProperty> list = component.getComponentInstancesProperties().get(componentId);
+			for (ComponentInstanceProperty prop : list) {
+				ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(prop, null, null);
+				componentInstanceProperty.setPath(prop.getPath());
+				componentInstanceProperty.setValueUniqueUid(prop.getValueUniqueUid());
+				componentInstanceProperty.setValue(prop.getValue());
+				listToFill.add(componentInstanceProperty);
+			}
+		} else {
+			Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = component
+					.getComponentInstancesProperties();
+			for (Map.Entry<String, List<ComponentInstanceProperty>> componentInstanceProperties : componentInstancesProperties
+					.entrySet()) {
+				for (ComponentInstanceProperty prop : componentInstanceProperties.getValue()) {
+					ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(prop, null,
+							null);
+					componentInstanceProperty.setPath(prop.getPath());
+					componentInstanceProperty.setValueUniqueUid(prop.getValueUniqueUid());
+					componentInstanceProperty.setValue(prop.getValue());
+					listToFill.add(componentInstanceProperty);
+				}
+			}
+		}
+
+		if (component.getComponentType().getValue().equals("Resource")) {
+			for (PropertyDefinition prop : ((Resource) component).getProperties()) {
+				listToFill.add(new ComponentInstanceProperty(prop, null, null));
+			}
+		}
+		return listToFill;
+	}
+
+	public static ComponentInstanceProperty getCompPropInstListByInstIdAndPropName(Component component,
+			ComponentInstance componentInstanceDetails, String name, String type) {
+		List<ComponentInstanceProperty> propList = component.getComponentInstancesProperties()
+				.get(componentInstanceDetails.getUniqueId());
+		if (propList != null) {
+			return getPropFromListByPropNameAndType(propList, name, type);
+		}
+		return null;
+	}
+
+	private static void updatePropertyListWithPathParameter(Resource resource, List<String> path,
+			List<ComponentInstanceProperty> expectedPropertyList) {
+		List<PropertyDefinition> propertyList = resource.getProperties();
+		for (PropertyDefinition propertyDefinition : propertyList) {
+			ComponentInstanceProperty propDetailsToRemove = PropertyRestUtils.getPropFromListByPropNameAndType(
+					expectedPropertyList, propertyDefinition.getName(), propertyDefinition.getType());
+			ComponentInstanceProperty propDetailsToAdd = propDetailsToRemove;
+			propDetailsToAdd.setPath(path);
+			expectedPropertyList.remove(propDetailsToRemove);
+			expectedPropertyList.add(propDetailsToAdd);
+		}
+	}
+
+	private static void updatePropertyListWithPathParameterOnCompInst(Service service, List<String> path,
+			List<ComponentInstanceProperty> expectedPropertyList) {
+		List<ComponentInstanceProperty> servicePropertyList = new ArrayList<>();
+		servicePropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, servicePropertyList,
+				path.get(0));
+
+		for (ComponentInstanceProperty serviceCompInstProperty : servicePropertyList) {
+			ComponentInstanceProperty propDetailsToRemove = PropertyRestUtils.getPropFromListByPropNameTypeAndPath(
+					expectedPropertyList, serviceCompInstProperty.getName(), serviceCompInstProperty.getType(),
+					serviceCompInstProperty.getPath());
+			ComponentInstanceProperty propDetailsToAdd = propDetailsToRemove;
+			List<String> tempPathList = new ArrayList<String>();
+			for (String tempPath : path) {
+				tempPathList.add(tempPath);
+			}
+			// path parameter can not contain the same service unique ID twice
+			if (propDetailsToAdd.getPath() != null
+					&& !propDetailsToAdd.getPath().get(0).contains(service.getUniqueId())) {
+				if (!propDetailsToAdd.getPath().containsAll(tempPathList)) {
+					tempPathList.addAll(propDetailsToAdd.getPath());
+				}
+			}
+			propDetailsToAdd.setPath(tempPathList);
+			expectedPropertyList.remove(propDetailsToRemove);
+			expectedPropertyList.add(propDetailsToAdd);
+		}
+	}
+
+	public static void updatePropertyListWithPathOnResource(ComponentInstance componentInstDetails, Resource resource,
+			List<ComponentInstanceProperty> list, Component container) {
+		List<String> path = new ArrayList<>();
+		if (container != null) {
+			List<ComponentInstance> componentInstances = container.getComponentInstances();
+			for (ComponentInstance componentInstance : componentInstances) {
+				if (componentInstance.getNormalizedName().equals(componentInstDetails.getNormalizedName())) {
+					path.add(componentInstance.getUniqueId());
+					break;
+				}
+			}
+
+		} else {
+			path.add(componentInstDetails.getUniqueId());
+		}
+		updatePropertyListWithPathParameter(resource, path, list);
+	}
+
+	public static void updatePropertyListWithPathOnComponentInstance(ComponentInstance componentInstDetails,
+			Service service, List<ComponentInstanceProperty> list) {
+		List<String> path = new ArrayList<>();
+		path.add(componentInstDetails.getUniqueId());
+		updatePropertyListWithPathParameterOnCompInst(service, path, list);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java
new file mode 100644
index 0000000..e08ef65
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java
@@ -0,0 +1,679 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.client.ClientProtocolException;
+import org.json.JSONException;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.model.CapabilityDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.RequirementDefinition;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.RelationshipInstData;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.common.util.GeneralUtility;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResourceRestUtils extends BaseRestUtils {
+	private static Logger logger = LoggerFactory.getLogger(ResourceRestUtils.class.getName());
+
+	// ****** CREATE *******
+
+	public static RestResponse createResource(ResourceReqDetails resourceDetails, User sdncModifierDetails)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		String userId = sdncModifierDetails.getUserId();
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson);
+		headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(userBodyJson);
+		RestResponse createResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
+		if (createResourceResponse.getErrorCode() == STATUS_CODE_CREATED) {
+			resourceDetails.setUUID(ResponseParser.getUuidFromResponse(createResourceResponse));
+			resourceDetails.setVersion(ResponseParser.getVersionFromResponse(createResourceResponse));
+			resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(createResourceResponse));
+			String lastUpdaterUserId = ResponseParser.getValueFromJsonResponse(createResourceResponse.getResponse(),
+					"lastUpdaterUserId");
+			resourceDetails.setLastUpdaterUserId(lastUpdaterUserId);
+			String lastUpdaterFullName = ResponseParser.getValueFromJsonResponse(createResourceResponse.getResponse(),
+					"lastUpdaterFullName");
+			resourceDetails.setLastUpdaterFullName(lastUpdaterFullName);
+			// Creator details never change after component is created - Ella,
+			// 12/1/2016
+			resourceDetails.setCreatorUserId(userId);
+			resourceDetails.setCreatorFullName(sdncModifierDetails.getFullName());
+		}
+		return createResourceResponse;
+
+	}
+
+	public static RestResponse createImportResource(ImportReqDetails importReqDetails, User sdncModifierDetails,
+			Map<String, String> additionalHeaders) throws JSONException, IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+		String userId = sdncModifierDetails.getUserId();
+
+		Gson gson = new Gson();
+		String resourceImportBodyJson = gson.toJson(importReqDetails);
+		HttpRequest http = new HttpRequest();
+		// System.out.println(url);
+		// System.out.println(resourceImportBodyJson);
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+		if (additionalHeaders != null) {
+			headersMap.putAll(additionalHeaders);
+		} else {
+			headersMap.put(HttpHeaderEnum.Content_MD5.getValue(),
+					ArtifactRestUtils.calculateMD5(resourceImportBodyJson));
+		}
+
+		RestResponse createResourceResponse = http.httpSendPost(url, resourceImportBodyJson, headersMap);
+		if (createResourceResponse.getErrorCode() == STATUS_CODE_CREATED) {
+			importReqDetails.setVersion(ResponseParser.getVersionFromResponse(createResourceResponse));
+			importReqDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(createResourceResponse));
+			// Creator details never change after component is created - Ella,
+			// 12/1/2016
+			importReqDetails.setCreatorUserId(userId);
+			importReqDetails.setCreatorFullName(sdncModifierDetails.getFullName());
+			importReqDetails
+					.setToscaResourceName(ResponseParser.getToscaResourceNameFromResponse(createResourceResponse));
+			importReqDetails.setDerivedList(ResponseParser.getDerivedListFromJson(createResourceResponse));
+		}
+		return createResourceResponse;
+
+	}
+
+	// ***** DELETE ****
+	public static RestResponse deleteResource(ResourceReqDetails resourceDetails, User sdncModifierDetails,
+			String version) throws IOException {
+
+		if (resourceDetails.getUniqueId() != null) {
+			Config config = Utils.getConfig();
+			String url = String.format(Urls.DELETE_RESOURCE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+					config.getCatalogBePort(), resourceDetails.getName(), version);
+			return sendDelete(url, sdncModifierDetails.getUserId());
+		} else {
+			return null;
+		}
+
+	}
+
+	public static RestResponse markResourceToDelete(String resourceId, String userId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId);
+		RestResponse sendDelete = sendDelete(url, userId);
+
+		return sendDelete;
+
+	}
+
+	public static RestResponse deleteResource(String resourceId, String userId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId);
+		RestResponse sendDelete = sendDelete(url, userId);
+
+		deleteMarkedResources(userId);
+
+		return sendDelete;
+
+	}
+
+	public static void deleteMarkedResources(String userId) throws IOException {
+		String url;
+		Config config = Utils.getConfig();
+		url = String.format(Urls.DELETE_MARKED_RESOURCES, config.getCatalogBeHost(), config.getCatalogBePort());
+		sendDelete(url, userId);
+	}
+
+	public static RestResponse deleteResourceByNameAndVersion(User sdncModifierDetails, String resourceName,
+			String resourceVersion) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_RESOURCE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), resourceName, resourceVersion);
+		RestResponse sendDelete = sendDelete(url, sdncModifierDetails.getUserId());
+
+		deleteMarkedResources(sdncModifierDetails.getUserId());
+
+		return sendDelete;
+	}
+
+	public static Boolean deleteResourceByNameAndVersion(String resourceName, String resourceVersion)
+			throws IOException {
+		RestResponse deleteResponse = ResourceRestUtils.deleteResourceByNameAndVersion(
+				ElementFactory.getDefaultUser(UserRoleEnum.ADMIN), resourceName, resourceVersion);
+		return checkErrorCode(deleteResponse);
+	}
+
+	public static Boolean removeResource(String resourceId)
+			throws FileNotFoundException, IOException, ClientProtocolException {
+		RestResponse response = deleteResource(resourceId,
+				ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getUserId());
+		return checkErrorCode(response);
+	}
+
+	// ************** GET *************
+	public static RestResponse getResource(User sdncModifierDetails, String uniqueId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), uniqueId);
+		return sendGet(url, sdncModifierDetails.getUserId());
+	}
+
+	public static RestResponse getModule(User sdncModifierDetails, String componentId, String moduleId)
+			throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_MODULE_BY_ID, config.getCatalogBeHost(), config.getCatalogBePort(),
+				componentId, moduleId);
+		return sendGet(url, sdncModifierDetails.getUserId());
+	}
+
+	public static RestResponse getLatestResourceFromCsarUuid(User sdncModifierDetails, String csarUuid)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_RESOURCE_BY_CSAR_UUID, config.getCatalogBeHost(), config.getCatalogBePort(),
+				csarUuid);
+		return sendGet(url, sdncModifierDetails.getUserId());
+	}
+
+	public static RestResponse getResource(ResourceReqDetails resourceDetails, User sdncModifierDetails)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceDetails.getUniqueId());
+		return sendGet(url, sdncModifierDetails.getUserId());
+	}
+
+	public static RestResponse getResourceByNameAndVersion(String userId, String resourceName, String resourceVersion)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_RESOURCE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), resourceName, resourceVersion);
+
+		return sendGet(url, userId);
+	}
+
+	public static RestResponse getResourceList(User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		return sendGet(url, sdncModifierDetails.getUserId());
+
+	}
+	
+	public static RestResponse getResourceListFilterByCategory(User sdncModifierDetails, String componentType, String category) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, "category=" + category);
+		
+		Map<String, String> headersMap =  prepareHeadersMap(sdncModifierDetails.getUserId());
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		return sendGet(url, sdncModifierDetails.getUserId(), headersMap);
+
+	}
+	
+	public static RestResponse getResourceListFilterBySubCategory(User sdncModifierDetails, String componentType, String subcategory) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, "subCategory=" + subcategory);
+		
+		Map<String, String> headersMap =  prepareHeadersMap(sdncModifierDetails.getUserId());
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		return sendGet(url, sdncModifierDetails.getUserId(), headersMap);
+
+	}
+	
+	public static RestResponse getResourceListFilterByCriteria(User sdncModifierDetails, String componentType, String criteria, String value) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, criteria + "=" + value);
+		
+		Map<String, String> headersMap =  prepareHeadersMap(sdncModifierDetails.getUserId());
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+
+		return sendGet(url, sdncModifierDetails.getUserId(), headersMap);
+
+	}
+
+	public static RestResponse getResource(String resourceId) throws ClientProtocolException, IOException {
+		return getResource(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN), resourceId);
+	}
+
+	public static RestResponse getLatestResourceFromCsarUuid(String csarUuid)
+			throws ClientProtocolException, IOException {
+		return getLatestResourceFromCsarUuid(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN), csarUuid);
+	}
+
+	public static RestResponse getResourceLatestVersionList(User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_RESOURCE_lATEST_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		return sendGet(url, sdncModifierDetails.getUserId());
+
+	}
+
+	public static RestResponse putAllCategoriesTowardsCatalogFeWithUuidNotAllowed(String uuid) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
+				BaseRestUtils.RESOURCE_COMPONENT_TYPE);
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), uuid);
+		HttpRequest http = new HttpRequest();
+
+		logger.debug("Send PUT request to get all categories (should be 405): {}", url);
+		return http.httpSendByMethod(url, "PUT", null, headersMap);
+	}
+
+	public static RestResponse getAllTagsTowardsCatalogBe() throws IOException {
+
+		Config config = Utils.getConfig();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ALL_TAGS, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	public static RestResponse getAllPropertyScopesTowardsCatalogBe() throws IOException {
+
+		Config config = Utils.getConfig();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_PROPERTY_SCOPES_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
+
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	public static RestResponse getAllArtifactTypesTowardsCatalogBe() throws IOException {
+
+		Config config = Utils.getConfig();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ALL_ARTIFACTS, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
+
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	public static RestResponse getConfigurationTowardsCatalogBe() throws IOException {
+
+		Config config = Utils.getConfig();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_CONFIGURATION, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
+
+		return http.httpSendGet(url, headersMap);
+
+	}
+
+	public static RestResponse sendOptionsTowardsCatalogFeWithUuid() throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
+				BaseRestUtils.RESOURCE_COMPONENT_TYPE);
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
+		HttpRequest http = new HttpRequest();
+
+		logger.debug("Send OPTIONS request for categories: {}", url);
+		return http.httpSendByMethod(url, "OPTIONS", null, headersMap);
+	}
+
+	// ********** UPDATE *************
+	public static RestResponse updateResourceMetadata(ResourceReqDetails updatedResourceDetails,
+			User sdncModifierDetails, String uniqueId, String encoding) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				uniqueId);
+
+		String ContentTypeString = String.format("%s;%s", contentTypeHeaderData, encoding);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(updatedResourceDetails);
+		String userId = sdncModifierDetails.getUserId();
+
+		RestResponse updateResourceResponse = sendPut(url, userBodyJson, userId, ContentTypeString);
+
+		updatedResourceDetails.setVersion(ResponseParser.getVersionFromResponse(updateResourceResponse));
+		updatedResourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(updateResourceResponse));
+
+		return updateResourceResponse;
+	}
+
+	public static RestResponse updateResourceTEST(Resource resource, User sdncModifierDetails, String uniqueId,
+			String encoding) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				uniqueId);
+
+		String ContentTypeString = String.format("%s;%s", contentTypeHeaderData, encoding);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resource);
+		String userId = sdncModifierDetails.getUserId();
+
+		RestResponse updateResourceResponse = sendPut(url, userBodyJson, userId, ContentTypeString);
+
+		// String resourceUniqueId =
+		// ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
+		// "uniqueId");
+		// updatedResourceDetails.setUniqueId(resourceUniqueId);
+		// String resourceVersion =
+		// ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
+		// "version");
+		// updatedResourceDetails.setUniqueId(resourceVersion);
+
+		return updateResourceResponse;
+	}
+
+	public static RestResponse updateResourceMetadata(ResourceReqDetails updatedResourceDetails,
+			User sdncModifierDetails, String uniqueId) throws Exception {
+		return updateResourceMetadata(updatedResourceDetails, sdncModifierDetails, uniqueId, "");
+	}
+
+	public static RestResponse updateResourceMetadata(String json, User sdncModifierDetails, String resourceId)
+			throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId);
+		String userId = sdncModifierDetails.getUserId();
+
+		RestResponse updateResourceResponse = sendPut(url, json, userId, contentTypeHeaderData);
+
+		return updateResourceResponse;
+	}
+
+	public static RestResponse updateResource(ResourceReqDetails resourceDetails, User sdncModifierDetails,
+			String resourceId) throws IOException {
+
+		String userId = sdncModifierDetails.getUserId();
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId);
+
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson);
+		headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
+		HttpRequest http = new HttpRequest();
+		RestResponse updateResourceResponse = http.httpSendPut(url, userBodyJson, headersMap);
+		if (updateResourceResponse.getErrorCode() == STATUS_CODE_UPDATE_SUCCESS) {
+			resourceDetails.setUUID(ResponseParser.getUuidFromResponse(updateResourceResponse));
+			resourceDetails.setVersion(ResponseParser.getVersionFromResponse(updateResourceResponse));
+			resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(updateResourceResponse));
+			String lastUpdaterUserId = ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
+					"lastUpdaterUserId");
+			resourceDetails.setLastUpdaterUserId(lastUpdaterUserId);
+			String lastUpdaterFullName = ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
+					"lastUpdaterFullName");
+			resourceDetails.setLastUpdaterFullName(lastUpdaterFullName);
+			resourceDetails.setCreatorUserId(userId);
+			resourceDetails.setCreatorFullName(sdncModifierDetails.getFullName());
+		}
+		return updateResourceResponse;
+	}
+
+	public static RestResponse createResourceInstance(ResourceReqDetails resourceDetails, User modifier,
+			String vfResourceUniqueId) throws Exception {
+		ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
+				.getComponentResourceInstance(resourceDetails);
+		RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
+				resourceInstanceReqDetails, modifier, vfResourceUniqueId, ComponentTypeEnum.RESOURCE);
+		ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
+		return createResourceInstanceResponse;
+	}
+
+	public static RestResponse associateResourceInstances(JSONObject body, User sdncModifierDetails,
+			Component component) throws IOException {
+
+		Config config = Utils.getConfig();
+		Gson gson = new Gson();
+		String bodyJson = gson.toJson(body);
+		component.getComponentType();
+		String componentType = ComponentTypeEnum.findParamByType(component.getComponentType());
+		String url = String.format(Urls.ASSOCIATE__RESOURCE_INSTANCE, config.getCatalogBeHost(),
+				config.getCatalogBePort(), componentType, component.getUniqueId());
+		return sendPost(url, bodyJson, sdncModifierDetails.getUserId(), null);
+
+	}
+
+	public static RestResponse getFollowedList(User sdncModifierDetails) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
+		return sendGet(url, sdncModifierDetails.getUserId());
+	}
+
+	public static List<Resource> restResponseToResourceObjectList(String restResponse) {
+		JsonElement jelement = new JsonParser().parse(restResponse);
+		JsonArray jsonArray = jelement.getAsJsonArray();
+		List<Resource> restResponseArray = new ArrayList<>();
+		Resource resource = null;
+		for (int i = 0; i < jsonArray.size(); i++) {
+			String resourceString = (String) jsonArray.get(i).toString();
+			resource = ResponseParser.convertResourceResponseToJavaObject(resourceString);
+			restResponseArray.add(resource);
+		}
+
+		return restResponseArray;
+
+	}
+
+	public static Resource getResourceObjectFromResourceListByUid(List<Resource> resourceList, String uid) {
+		if (resourceList != null && resourceList.size() > 0) {
+			for (Resource resource : resourceList) {
+				if (resource.getUniqueId().equals(uid))
+					return resource;
+			}
+		} else
+			return null;
+		return null;
+	}
+
+	// =======================================resource
+	// associate==================================================
+	public static RestResponse associate2ResourceInstances(Component container, ComponentInstance fromNode,
+			ComponentInstance toNode, String assocType, User sdncUserDetails) throws IOException {
+		return associate2ResourceInstances(container, fromNode.getUniqueId(), toNode.getUniqueId(), assocType,
+				sdncUserDetails);
+	}
+
+	public static RestResponse associate2ResourceInstances(Component component, String fromNode, String toNode,
+			String assocType, User sdncUserDetails) throws IOException {
+
+		RelationshipInstData relationshipInstData = new RelationshipInstData();
+		Map<String, List<CapabilityDefinition>> capabilitiesMap = component.getCapabilities();
+		Map<String, List<RequirementDefinition>> requirementMap = component.getRequirements();
+		List<CapabilityDefinition> capabilitiesList = capabilitiesMap.get(assocType);
+		List<RequirementDefinition> requirementList = requirementMap.get(assocType);
+
+		RequirementDefinition requirementDefinitionFrom = getRequirementDefinitionByOwnerId(requirementList, fromNode);
+		CapabilityDefinition capabilityDefinitionTo = getCapabilityDefinitionByOwnerId(capabilitiesList, toNode);
+		relationshipInstData.setCapabilityOwnerId(capabilityDefinitionTo.getOwnerId());
+		relationshipInstData.setCapabiltyId(capabilityDefinitionTo.getUniqueId());
+		relationshipInstData.setRequirementOwnerId(requirementDefinitionFrom.getOwnerId());
+		relationshipInstData.setRequirementId(requirementDefinitionFrom.getUniqueId());
+
+		JSONObject assocBody = assocBuilder(relationshipInstData, capabilityDefinitionTo, requirementDefinitionFrom,
+				toNode, fromNode);
+		return ResourceRestUtils.associateResourceInstances(assocBody, sdncUserDetails, component);
+
+	}
+
+	private static JSONObject assocBuilder(RelationshipInstData relationshipInstData,
+			CapabilityDefinition capabilityDefinitionTo, RequirementDefinition requirementDefinitionFrom, String toNode,
+			String fromNode) {
+
+		String type = capabilityDefinitionTo.getType();
+		String requirement = requirementDefinitionFrom.getName();
+		String capability = requirementDefinitionFrom.getName();
+
+		JSONObject wrapper = new JSONObject();
+		JSONArray relationshipsArray = new JSONArray();
+		JSONObject relationship = new JSONObject();
+		JSONObject simpleObject = new JSONObject();
+
+		relationship.put("type", type);
+		simpleObject.put("relationship", relationship);
+		simpleObject.put("requirement", requirement);
+		simpleObject.put("capability", capability);
+		simpleObject.put("capabilityUid", relationshipInstData.getCapabiltyId());
+		simpleObject.put("capabilityOwnerId", relationshipInstData.getCapabilityOwnerId());
+		simpleObject.put("requirementOwnerId", relationshipInstData.getRequirementOwnerId());
+		simpleObject.put("requirementUid", relationshipInstData.getRequirementId());
+		relationshipsArray.add(simpleObject);
+
+		ArrayList<Object> relationships = new ArrayList<Object>(relationshipsArray);
+		wrapper.put("fromNode", fromNode);
+		wrapper.put("toNode", toNode);
+		wrapper.put("relationships", relationships);
+		return wrapper;
+
+	}
+
+	private static CapabilityDefinition getCapabilityDefinitionByOwnerId(
+			List<CapabilityDefinition> capabilityDefinitionList, String ownerId) {
+
+		for (CapabilityDefinition capabilityDefinition : capabilityDefinitionList) {
+			if (capabilityDefinition.getOwnerId().equals(ownerId)) {
+				return capabilityDefinition;
+			}
+		}
+		return null;
+	}
+
+	private static RequirementDefinition getRequirementDefinitionByOwnerId(
+			List<RequirementDefinition> requirementDefinitionList, String ownerId) {
+
+		for (RequirementDefinition requirementDefinition : requirementDefinitionList) {
+			if (requirementDefinition.getOwnerId().equals(ownerId)) {
+				return requirementDefinition;
+			}
+		}
+		return null;
+	}
+
+	public static String getRiUniqueIdByRiName(Component component, String resourceInstanceName) {
+
+		List<ComponentInstance> componentInstances = component.getComponentInstances();
+		String name = null;
+		for (ComponentInstance componentInstance : componentInstances) {
+			if (componentInstance.getName().equals(resourceInstanceName)) {
+				name = componentInstance.getUniqueId();
+				break;
+			}
+		}
+		return name;
+	}
+
+	public static Resource convertResourceGetResponseToJavaObject(ResourceReqDetails resourceDetails)
+			throws IOException {
+		RestResponse response = ResourceRestUtils.getResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		assertEquals("Check response code after get resource", 200, response.getErrorCode().intValue());
+		return ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
+	}
+
+	public static RestResponse changeResourceInstanceVersion(String containerUniqueId, String instanceToReplaceUniqueId,
+			String newResourceUniqueId, User sdncModifierDetails, ComponentTypeEnum componentType) throws IOException {
+		return ProductRestUtils.changeServiceInstanceVersion(containerUniqueId, instanceToReplaceUniqueId,
+				newResourceUniqueId, sdncModifierDetails, componentType);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java
new file mode 100644
index 0000000..10f573c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.util.Map;
+
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.common.util.GeneralUtility;
+
+import com.google.gson.Gson;
+
+public class ResourceRestUtilsExternalAPI extends BaseRestUtils {
+	
+	public static RestResponse createResource(ResourceExternalReqDetails resourceDetails, User sdncModifierDetails)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.POST_EXTERNAL_API_CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		String userId = sdncModifierDetails.getUserId();
+		Map<String, String> headersMap = prepareHeadersMap(userId);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(resourceDetails);
+		String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson);
+		headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
+		headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
+		headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		
+		HttpRequest http = new HttpRequest();
+		RestResponse createResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
+		
+		return createResourceResponse;
+	}
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
new file mode 100644
index 0000000..ad9f482
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
@@ -0,0 +1,605 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.Version;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.JsonDeserializer;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.module.SimpleModule;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.PropertyConstraint;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintJacksonDeserialiser;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceDistributionStatus;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public class ResponseParser {
+
+	// comment by Andrey, for test only
+	// public static void main(String[] args) {
+	// String response =
+	// "{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"resourceName\":\"importResource4test\",\"resourceVersion\":\"0.1\",\"creatorUserId\":\"jh0003\",\"creatorFullName\":\"Jimmy
+	// Hendrix\",\"lastUpdaterUserId\":\"jh0003\",\"lastUpdaterFullName\":\"Jimmy
+	// Hendrix\",\"creationDate\":1446742241514,\"lastUpdateDate\":1446742241514,\"description\":\"Represents
+	// a generic software component that can be managed and run by a Compute
+	// Node
+	// Type.\",\"icon\":\"defaulticon\",\"tags\":[\"importResource4test\"],\"category\":\"Generic/Infrastructure\",\"lifecycleState\":\"NOT_CERTIFIED_CHECKOUT\",\"derivedFrom\":[\"tosca.nodes.Root\"],\"artifacts\":{},\"deploymentArtifacts\":{},\"properties\":[{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.port\",\"type\":\"integer\",\"required\":false,\"description\":\"the
+	// port the DBMS service will listen to for data and
+	// requests\",\"password\":false,\"name\":\"port\",\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"definition\":true},{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.root_password\",\"type\":\"string\",\"required\":false,\"description\":\"the
+	// optional root password for the DBMS
+	// service\",\"password\":false,\"name\":\"root_password\",\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"definition\":true}],\"interfaces\":{\"standard\":{\"type\":\"tosca.interfaces.node.lifecycle.Standard\",\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard\",\"operations\":{\"stop\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.stop\",\"description\":\"Standard
+	// lifecycle stop
+	// operation.\",\"definition\":false},\"start\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.start\",\"description\":\"Standard
+	// lifecycle start
+	// operation.\",\"definition\":false},\"delete\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.delete\",\"description\":\"Standard
+	// lifecycle delete
+	// operation.\",\"definition\":false},\"create\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.create\",\"description\":\"Standard
+	// lifecycle create
+	// operation.\",\"definition\":false},\"configure\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.configure\",\"description\":\"Standard
+	// lifecycle configure
+	// operation.\",\"definition\":false}},\"definition\":false}},\"capabilities\":{\"feature\":{\"uniqueId\":\"capability.8313348e-3623-4f4a-9b8f-d2fbadaf9a31.feature\",\"type\":\"tosca.capabilities.Node\"},\"feature2\":{\"uniqueId\":\"capability.52eb0139-a855-47b9-a0e6-c90f0a90b1d2.feature2\",\"type\":\"tosca.capabilities.Node\"}},\"requirements\":{\"dependency\":{\"uniqueId\":\"8313348e-3623-4f4a-9b8f-d2fbadaf9a31.dependency\",\"capability\":\"tosca.capabilities.Node\",\"node\":\"tosca.nodes.Root\",\"relationship\":\"tosca.relationships.DependsOn\"},\"dependency2\":{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.dependency2\",\"capability\":\"tosca.capabilities.Node\",\"node\":\"tosca.nodes.importResource4test\",\"relationship\":\"tosca.relationships.DependsOn\"}},\"vendorName\":\"ATT
+	// (Tosca)\",\"vendorRelease\":\"1.0.0.wd03\",\"contactId\":\"jh0003\",\"systemName\":\"Importresource4test\",\"additionalInformation\":[{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.additionalinformation\",\"lastCreatedCounter\":0,\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"parameters\":[]}],\"allVersions\":{\"0.1\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\"},\"abstract\":false,\"highestVersion\":true,\"uuid\":\"2e91a2df-b066-49bb-abde-4c1c01e409db\"}";
+	// convertResourceResponseToJavaObject(response);
+	// }
+
+	private static final String INVARIANT_UUID = "invariantUUID";
+	public static final String UNIQUE_ID = "uniqueId";
+	public static final String VERSION = "version";
+	public static final String UUID = "uuid";
+	public static final String NAME = "name";
+	public static final String ORIGIN_TYPE = "originType";
+	public static final String TOSCA_RESOURCE_NAME = "toscaResourceName";
+
+	static Logger logger = Logger.getLogger(ResponseParser.class.getName());
+
+	public static String getValueFromJsonResponse(String response, String fieldName) {
+		try {
+			JSONObject jsonResp = (JSONObject) JSONValue.parse(response);
+			Object fieldValue = jsonResp.get(fieldName);
+			return fieldValue.toString();
+
+		} catch (Exception e) {
+			return null;
+		}
+
+	}
+
+	public static String getUniqueIdFromResponse(RestResponse response) {
+		return getValueFromJsonResponse(response.getResponse(), UNIQUE_ID);
+	}
+
+	public static String getInvariantUuid(RestResponse response) {
+		return getValueFromJsonResponse(response.getResponse(), INVARIANT_UUID);
+	}
+
+	public static String getUuidFromResponse(RestResponse response) {
+		return getValueFromJsonResponse(response.getResponse(), UUID);
+	}
+
+	public static String getNameFromResponse(RestResponse response) {
+		return getValueFromJsonResponse(response.getResponse(), NAME);
+	}
+
+	public static String getVersionFromResponse(RestResponse response) {
+		return ResponseParser.getValueFromJsonResponse(response.getResponse(), VERSION);
+	}
+
+	public static String getComponentTypeFromResponse(RestResponse response) {
+		return ResponseParser.getValueFromJsonResponse(response.getResponse(), ORIGIN_TYPE);
+	}
+
+	public static String getToscaResourceNameFromResponse(RestResponse response) {
+		return getValueFromJsonResponse(response.getResponse(), TOSCA_RESOURCE_NAME);
+	}
+
+	@SuppressWarnings("unchecked")
+	public static ResourceRespJavaObject parseJsonListReturnResourceDetailsObj(RestResponse restResponse,
+			String resourceType, String searchPattern, String expectedResult) throws Exception {
+
+		// Gson gson = new Gson;
+
+		JsonElement jElement = new JsonParser().parse(restResponse.getResponse());
+		JsonObject jObject = jElement.getAsJsonObject();
+		JsonArray arrayOfObjects = (JsonArray) jObject.get(resourceType);
+		Gson gson = new Gson();
+		Map<String, Object> map = new HashMap<String, Object>();
+		ResourceRespJavaObject jsonToJavaObject = new ResourceRespJavaObject();
+
+		for (int counter = 0; counter < arrayOfObjects.size(); counter++) {
+			JsonObject jHitObject = (JsonObject) arrayOfObjects.get(counter);
+
+			map = (Map<String, Object>) gson.fromJson(jHitObject.toString(), map.getClass());
+			if (map.get(searchPattern).toString().contains(expectedResult)) {
+
+				jsonToJavaObject = gson.fromJson(jObject, ResourceRespJavaObject.class);
+				break;
+			}
+		}
+		return jsonToJavaObject;
+
+	}
+
+	public static Resource convertResourceResponseToJavaObject(String response) {
+
+		ObjectMapper mapper = new ObjectMapper();
+		final SimpleModule module = new SimpleModule("customerSerializationModule",
+				new Version(1, 0, 0, "static version"));
+		JsonDeserializer<PropertyConstraint> deserializer = new PropertyConstraintJacksonDeserialiser();
+		addDeserializer(module, PropertyConstraint.class, deserializer);
+
+		mapper.registerModule(module);
+		Resource resource = null;
+		try {
+//			TODO Andrey L. uncomment line below in case to ignore on unknown properties, not recommended  
+//			mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+			resource = mapper.readValue(response, Resource.class);
+			
+			logger.debug(resource.toString());
+		} catch (IOException e) {
+			try {
+				List<Resource> resources = Arrays.asList(mapper.readValue(response.toString(), Resource[].class));
+				resource = resources.get(0);
+			} catch (Exception e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+		}
+
+		return resource;
+	}
+
+	public static ComponentInstanceProperty convertPropertyResponseToJavaObject(String response) {
+
+		ObjectMapper mapper = new ObjectMapper();
+		final SimpleModule module = new SimpleModule("customerSerializationModule",
+				new Version(1, 0, 0, "static version"));
+		JsonDeserializer<PropertyConstraint> desrializer = new PropertyConstraintJacksonDeserialiser();
+		addDeserializer(module, PropertyConstraint.class, desrializer);
+
+		mapper.registerModule(module);
+		ComponentInstanceProperty propertyDefinition = null;
+		try {
+			propertyDefinition = mapper.readValue(response, ComponentInstanceProperty.class);
+			logger.debug(propertyDefinition.toString());
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return propertyDefinition;
+	}
+
+	public static String toJson(Object object) {
+		Gson gson = new Gson();
+		return gson.toJson(object);
+	}
+
+	public static ArtifactDefinition convertArtifactDefinitionResponseToJavaObject(String response) {
+		ObjectMapper mapper = new ObjectMapper();
+		ArtifactDefinition artifactDefinition = null;
+		try {
+
+			artifactDefinition = mapper.readValue(response, ArtifactDefinition.class);
+			logger.debug(artifactDefinition.toString());
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		return artifactDefinition;
+
+	}
+
+	public static ArtifactReqDetails convertArtifactReqDetailsToJavaObject(String response) {
+
+		ArtifactReqDetails artifactReqDetails = null;
+		Gson gson = new Gson();
+		artifactReqDetails = gson.fromJson(response, ArtifactReqDetails.class);
+		return artifactReqDetails;
+	}
+
+	public static <T> T parseToObject(String json, Class<T> clazz) {
+		Gson gson = new Gson();
+		T object;
+		try {
+			object = gson.fromJson(json, clazz);
+		} catch (Exception e) {
+			object = parseToObjectUsingMapper(json, clazz);
+		}
+		return object;
+	}
+
+	public static <T> T parseToObjectUsingMapper(String json, Class<T> clazz) {
+		// Generic convert
+		ObjectMapper mapper = new ObjectMapper();
+		T object = null;
+		final SimpleModule module = new SimpleModule("customerSerializationModule",
+				new Version(1, 0, 0, "static version"));
+		JsonDeserializer<PropertyConstraint> desrializer = new PropertyConstraintJacksonDeserialiser();
+		addDeserializer(module, PropertyConstraint.class, desrializer);
+		mapper.registerModule(module);
+		try {
+			object = mapper.readValue(json, clazz);
+			// System.out.println("Class: "+clazz.getSimpleName()+", json:
+			// "+json);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		return object;
+	}
+
+	public static ArtifactReqDetails convertArtifactDefinitionToArtifactReqDetailsObject(
+			ArtifactDefinition artifactDefinition) {
+
+		ArtifactReqDetails artifactReqDetails = null;
+		Gson gson = new Gson();
+		String artDef = gson.toJson(artifactDefinition);
+		artifactReqDetails = gson.fromJson(artDef, ArtifactReqDetails.class);
+		return artifactReqDetails;
+	}
+
+	public static <T> void addDeserializer(SimpleModule module, Class<T> clazz,
+			final JsonDeserializer<T> deserializer) {
+		module.addDeserializer(clazz, deserializer);
+	}
+
+	public static Service convertServiceResponseToJavaObject(String response) {
+
+		ObjectMapper mapper = new ObjectMapper();
+		final SimpleModule module = new SimpleModule("customerSerializationModule",
+				new Version(1, 0, 0, "static version"));
+		JsonDeserializer<PropertyConstraint> deserializer = new PropertyConstraintJacksonDeserialiser();
+		addDeserializer(module, PropertyConstraint.class, deserializer);
+
+		mapper.registerModule(module);
+		Service service = null;
+		try {
+			service = mapper.readValue(response, Service.class);
+			logger.debug(service.toString());
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		return service;
+	}
+
+	public static Product convertProductResponseToJavaObject(String response) {
+
+		ObjectMapper mapper = new ObjectMapper();
+		
+		final SimpleModule module = new SimpleModule("customerSerializationModule",
+				new Version(1, 0, 0, "static version"));
+		JsonDeserializer<PropertyConstraint> desrializer = new PropertyConstraintJacksonDeserialiser();
+		addDeserializer(module, PropertyConstraint.class, desrializer);
+
+		mapper.registerModule(module);
+		
+		Product product = null;
+		try {
+			product = mapper.readValue(response, Product.class);
+			logger.debug(product.toString());
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		return product;
+	}
+
+	public static ComponentInstance convertComponentInstanceResponseToJavaObject(String response) {
+
+		ObjectMapper mapper = new ObjectMapper();
+		final SimpleModule module = new SimpleModule("customerSerializationModule",
+				new Version(1, 0, 0, "static version"));
+		JsonDeserializer<PropertyConstraint> desrializer = new PropertyConstraintJacksonDeserialiser();
+		addDeserializer(module, PropertyConstraint.class, desrializer);
+
+		mapper.registerModule(module);
+		ComponentInstance componentInstance = null;
+		try {
+			componentInstance = mapper.readValue(response, ComponentInstance.class);
+			logger.debug(componentInstance.toString());
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+		return componentInstance;
+	}
+
+	public static List<String> getValuesFromJsonArray(RestResponse message) throws Exception {
+		List<String> artifactTypesArrayFromApi = new ArrayList<String>();
+
+		org.json.JSONObject responseObject = new org.json.JSONObject(message.getResponse());
+		JSONArray jArr = responseObject.getJSONArray("artifactTypes");
+
+		for (int i = 0; i < jArr.length(); i++) {
+			org.json.JSONObject jObj = jArr.getJSONObject(i);
+			String value = jObj.get("name").toString();
+
+			artifactTypesArrayFromApi.add(value);
+		}
+		return artifactTypesArrayFromApi;
+	}
+
+	public static String calculateMD5Header(ArtifactReqDetails artifactDetails) {
+		Gson gson = new Gson();
+		String jsonBody = gson.toJson(artifactDetails);
+		// calculate MD5 for json body
+		return calculateMD5(jsonBody);
+
+	}
+
+	public static String calculateMD5(String data) {
+		String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data);
+		// encode base-64 result
+		byte[] encodeBase64 = Base64.encodeBase64(calculatedMd5.getBytes());
+		String encodeBase64Str = new String(encodeBase64);
+		return encodeBase64Str;
+
+	}
+
+	public static List<Map<String, Object>> getAuditFromMessage(Map auditingMessage) {
+		List<Map<String, Object>> auditList = new ArrayList<Map<String, Object>>();
+		// JsonElement jElement = new JsonParser().parse(auditingMessage);
+		// JsonObject jObject = jElement.getAsJsonObject();
+		// JsonObject hitsObject = (JsonObject) jObject.get("hits");
+		// JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
+		//
+		// Iterator<JsonElement> hitsIterator = hitsArray.iterator();
+		// while(hitsIterator.hasNext())
+		// {
+		// JsonElement nextHit = hitsIterator.next();
+		// JsonObject jHitObject = nextHit.getAsJsonObject();
+		// JsonObject jSourceObject = (JsonObject) jHitObject.get("_source");
+		//
+		// Gson gson=new Gson();
+		// String auditUnparsed = jSourceObject.toString();
+		//
+		// Map<String,Object> map = new HashMap<String,Object>();
+		// map = (Map<String,Object>) gson.fromJson(auditUnparsed,
+		// map.getClass());
+
+		auditList.add(auditingMessage);
+		// }
+		return auditList;
+	}
+
+	public static List<CategoryDefinition> parseCategories(RestResponse getAllCategoriesRest) {
+
+		List<CategoryDefinition> categories = new ArrayList<>();
+		try {
+			JsonElement jElement = new JsonParser().parse(getAllCategoriesRest.getResponse());
+			JsonArray cagegories = jElement.getAsJsonArray();
+			Iterator<JsonElement> iter = cagegories.iterator();
+			while (iter.hasNext()) {
+				JsonElement next = iter.next();
+				CategoryDefinition category = ResponseParser.parseToObject(next.toString(), CategoryDefinition.class);
+				categories.add(category);
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		return categories;
+	}
+
+	public static JSONArray getListFromJson(RestResponse res, String field) throws JSONException {
+		String valueFromJsonResponse = getValueFromJsonResponse(res.getResponse(), field);
+		JSONArray jArr = new JSONArray(valueFromJsonResponse);
+
+		return jArr;
+	}
+
+	public static List<String> getDerivedListFromJson(RestResponse res) throws JSONException {
+		JSONArray listFromJson = getListFromJson(res, "derivedList");
+		List<String> lst = new ArrayList<String>();
+		for (int i = 0; i < listFromJson.length(); i++) {
+			lst.add(listFromJson.getString(i));
+		}
+
+		return lst;
+	}
+
+	public static Map<String, Object> convertStringToMap(String obj) {
+		Map<String, Object> object = (Map<String, Object>) JSONValue.parse(obj);
+		return object;
+	}
+
+	public static List<Map<String, Object>> getListOfMapsFromJson(RestResponse res, String field) throws Exception {
+		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+		JSONArray listFromJson = getListFromJson(res, field);
+		for (int i = 0; i < listFromJson.length(); i++) {
+			Map<String, Object> convertStringToMap = convertStringToMap(listFromJson.getString(i));
+			list.add(convertStringToMap);
+		}
+		return list;
+
+	}
+
+	public static Map<String, Object> getJsonValueAsMap(RestResponse response, String key) {
+		String valueField = getValueFromJsonResponse(response.getResponse(), key);
+		Map<String, Object> convertToMap = convertStringToMap(valueField);
+		return convertToMap;
+	}
+
+	public static String getJsonObjectValueByKey(String metadata, String key) {
+		JsonElement jelement = new JsonParser().parse(metadata);
+
+		JsonObject jobject = jelement.getAsJsonObject();
+		Object obj = jobject.get(key);
+		if (obj == null) {
+			return null;
+		} else {
+			return obj.toString();
+		}
+	}
+
+	public static Map<String, List<Component>> convertCatalogResponseToJavaObject(String response) {
+
+		// Map<String, ArrayList<Component>> map = new HashMap<String,
+		// ArrayList<Component>>();
+		Map<String, List<Component>> map = new HashMap<String, List<Component>>();
+
+		JsonElement jElement = new JsonParser().parse(response);
+		JsonObject jObject = jElement.getAsJsonObject();
+		JsonArray jArrReousrces = jObject.getAsJsonArray("resources");
+		JsonArray jArrServices = jObject.getAsJsonArray("services");
+		JsonArray jArrProducts = jObject.getAsJsonArray("products");
+		
+		if (jArrReousrces != null && jArrServices != null && jArrProducts != null){
+			
+		
+		//////// RESOURCE/////////////////////////////
+		ArrayList<Component> restResponseArray = new ArrayList<>();
+		Component component = null;
+		for (int i = 0; i < jArrReousrces.size(); i++) {
+			String resourceString = (String) jArrReousrces.get(i).toString();
+			component = ResponseParser.convertResourceResponseToJavaObject(resourceString);
+			restResponseArray.add(component);
+		}
+
+		map.put("resources", restResponseArray);
+
+		///////// SERVICE/////////////////////////////
+
+		restResponseArray = new ArrayList<>();
+		component = null;
+		for (int i = 0; i < jArrServices.size(); i++) {
+			String resourceString = (String) jArrServices.get(i).toString();
+			component = ResponseParser.convertServiceResponseToJavaObject(resourceString);
+			restResponseArray.add(component);
+		}
+
+		map.put("services", restResponseArray);
+
+		///////// PRODUCT/////////////////////////////
+		restResponseArray = new ArrayList<>();
+		component = null;
+		for (int i = 0; i < jArrProducts.size(); i++) {
+			String resourceString = (String) jArrProducts.get(i).toString();
+			component = ResponseParser.convertProductResponseToJavaObject(resourceString);
+			restResponseArray.add(component);
+		}
+
+		map.put("products", restResponseArray);
+		
+    	}
+		else {
+			map.put("resources", new ArrayList<>());
+			map.put("services", new ArrayList<>());
+			map.put("products", new ArrayList<>());
+		}
+
+		return map;
+
+	}
+	
+	
+	public static Map<Long, ServiceDistributionStatus> convertServiceDistributionStatusToObject(String response) throws ParseException {
+
+		Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap = new HashMap<Long, ServiceDistributionStatus>();
+		ServiceDistributionStatus serviceDistributionStatusObject = null;
+		
+		JsonElement jElement = new JsonParser().parse(response);
+		JsonObject jObject = jElement.getAsJsonObject();
+		JsonArray jDistrStatusArray = jObject.getAsJsonArray("distributionStatusOfServiceList");
+		
+		for (int i = 0; i < jDistrStatusArray.size(); i++){
+			Gson gson = new Gson();
+			String servDistrStatus = gson.toJson(jDistrStatusArray.get(i));
+			serviceDistributionStatusObject = gson.fromJson(servDistrStatus, ServiceDistributionStatus.class);
+			serviceDistributionStatusMap.put(Utils.getEpochTimeFromUTC(serviceDistributionStatusObject.getTimestamp()), serviceDistributionStatusObject);
+		}
+
+		return serviceDistributionStatusMap;
+		
+	}
+	
+	public static Map<String, String> getPropertiesNameType(RestResponse restResponse)
+			throws JSONException {
+		Map<String, String> propertiesMap = new HashMap<String, String>();
+		JSONArray propertiesList = getListFromJson(restResponse, "properties");
+		for (int i = 0; i < propertiesList.length() ; i ++){
+			JSONObject  prop = (JSONObject) JSONValue.parse(propertiesList.get(i).toString());
+			String propName = prop.get("name").toString();
+			String propType = prop.get("type").toString();
+			propertiesMap.put(propName, propType);
+		}
+		
+		return propertiesMap;
+	}
+	
+	public static ResourceAssetStructure getDataOutOfSearchExternalAPIResponseForResourceName(String response, String resourceName) {
+		Gson gson = new Gson();
+		JsonElement jsonElement = new JsonParser().parse(response);
+		JsonArray jsonArray = jsonElement.getAsJsonArray();
+		for(JsonElement jElement: jsonArray) {
+			ResourceAssetStructure parsedResponse = gson.fromJson(jElement, ResourceAssetStructure.class);
+			
+			if(resourceName.contains(parsedResponse.getName()) && parsedResponse.getName().contains(resourceName)) {
+				return parsedResponse;
+			}
+		}
+		
+		return null;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java
new file mode 100644
index 0000000..a93587d
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java
@@ -0,0 +1,296 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+
+public class ServiceRestUtils extends BaseRestUtils {
+	private static Logger logger = LoggerFactory.getLogger(ServiceRestUtils.class.getName());
+	private final static String cacheControl = "no-cache";
+	private final static String contentTypeHeaderData = "application/json";
+	private final static String acceptHeaderDate = "application/json";
+	// ****** CREATE *******
+
+	private static Gson gson = new Gson();
+
+	public static RestResponse deleteService(String serviceName, String version, User sdncModifierDetails)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_SERVICE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), serviceName, version);
+
+		String userId = sdncModifierDetails.getUserId();
+		RestResponse sendDelete = sendDelete(url, userId);
+		deleteMarkedServices(userId);
+		return sendDelete;
+	}
+	
+	public static RestResponse markServiceToDelete(String resourceId, String userId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				resourceId);
+		RestResponse sendDelete = sendDelete(url, userId);
+
+		return sendDelete;
+
+	}
+
+	public static RestResponse deleteServiceById(String serviceId, String userId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DELETE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				serviceId);
+		RestResponse sendDelete = sendDelete(url, userId);
+		deleteMarkedServices(userId);
+		return sendDelete;
+	}
+
+	public static void deleteMarkedServices(String userId) throws IOException {
+		String url;
+		Config config = Utils.getConfig();
+		url = String.format(Urls.DELETE_MARKED_SERVICES, config.getCatalogBeHost(), config.getCatalogBePort());
+		sendDelete(url, userId);
+	}
+
+	public static RestResponse createService(ServiceReqDetails service, User user) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.CREATE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort());
+		String serviceBodyJson = gson.toJson(service);
+
+		logger.debug("Send POST request to create service: {}", url);
+		logger.debug("Service body: {}", serviceBodyJson);
+
+		RestResponse res = sendPost(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
+		if (res.getErrorCode() == STATUS_CODE_CREATED) {
+			service.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+			service.setVersion(ResponseParser.getVersionFromResponse(res));
+			service.setUUID(ResponseParser.getUuidFromResponse(res));
+			// Creator details never change after component is created - Ella,
+			// 12/1/2016
+			service.setCreatorUserId(user.getUserId());
+			service.setCreatorFullName(user.getFullName());
+		}
+
+		return res;
+	}
+
+	public static RestResponse updateService(ServiceReqDetails service, User user) throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.UPDATE_SERVICE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
+				service.getUniqueId());
+		String serviceBodyJson = gson.toJson(service);
+
+		logger.debug("Send PUT request to create service: {}", url);
+		logger.debug("Service body: {}", serviceBodyJson);
+
+		RestResponse res = sendPut(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
+		if (res.getErrorCode() == STATUS_CODE_CREATED) {
+			service.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
+			service.setVersion(ResponseParser.getVersionFromResponse(res));
+		}
+
+		return res;
+	}
+
+	public static RestResponse getService(String serviceId) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
+		return getServiceFromUrl(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), false);
+	}
+
+	public static RestResponse getService(ServiceReqDetails serviceReqDetails, User sdncModifierDetails)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				serviceReqDetails.getUniqueId());
+		return getServiceFromUrl(url, sdncModifierDetails, false);
+	}
+
+	public static RestResponse getService(String serviceId, User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
+		return getServiceFromUrl(url, sdncModifierDetails, false);
+	}
+
+	public static RestResponse getServiceByNameAndVersion(User sdncModifierDetails, String serviceName,
+			String serviceVersion) throws IOException {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SERVICE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), serviceName, serviceVersion);
+		return getServiceFromUrl(url, sdncModifierDetails, false);
+	}
+
+	public static RestResponse getServiceFromUrl(String url, User sdncModifierDetails, boolean isCached)
+			throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails, isCached);
+		HttpRequest http = new HttpRequest();
+		logger.debug("Send GET request to create service: {}", url);
+		logger.debug("Service headers: {}", headersMap);
+		RestResponse sendGetServerRequest = http.httpSendGet(url, headersMap);
+
+		return sendGetServerRequest;
+	}
+
+	public static Map<String, String> prepareHeadersMap(User sdncModifierDetails, boolean isCached) {
+		Map<String, String> headersMap = new HashMap<String, String>();
+		if (isCached)
+			headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), cacheControl);
+
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		return headersMap;
+	}
+
+	public static RestResponse approveServiceDistribution(String serviceId, String userId) throws Exception {
+		return changeServiceDistributionState(serviceId, userId, Urls.APPROVE_DISTRIBUTION);
+	}
+
+	public static RestResponse rejectServiceDistribution(String serviceId, String userId) throws Exception {
+		return changeServiceDistributionState(serviceId, userId, Urls.REJECT_DISTRIBUTION);
+	}
+
+	// Benny
+	public static RestResponse rejectServiceDistribution(String serviceId, String userId, String comment)
+			throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.REJECT_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
+				serviceId);
+		String userBodyJson = gson.toJson(comment);
+		return sendPost(url, userBodyJson, userId, acceptHeaderData);
+
+	}
+
+	private static RestResponse changeServiceDistributionState(String serviceId, String userId, String distributionUrl)
+			throws Exception {
+		Config config = Utils.getConfig();
+		String url = String.format(distributionUrl, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
+		String defComment = "{ userRemarks : \"this is an test\" }";
+		String userBodyJson = gson.toJson(defComment);
+		return sendPost(url, userBodyJson, userId, acceptHeaderData);
+
+	}
+
+	public static RestResponse getServiceLatestVersionList(User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.GET_SERVICE_lATEST_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort());
+
+		return sendGet(url, sdncModifierDetails.getUserId());
+
+	}
+
+	public static RestResponse createServiceByHttpMethod(ServiceReqDetails serviceDetails, User sdncModifierDetails,
+			String method, String urls) throws IOException {
+		Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails, true);
+
+		Config config = Utils.getConfig();
+		String serviceBodyJson = gson.toJson(serviceDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(urls, config.getCatalogBeHost(), config.getCatalogBePort());
+		// TODO: ADD AUTHENTICATION IN REQUEST
+		logger.debug(url);
+		logger.debug("Send {} request to create user: {}",method,url);
+		logger.debug("User body: {}", serviceBodyJson);
+		logger.debug("User headers: {}", headersMap);
+		RestResponse sendCreateUserRequest = http.httpSendByMethod(url, method, serviceBodyJson, headersMap);
+
+		return sendCreateUserRequest;
+
+	}
+
+	public static RestResponse deleteServiceByNameAndVersion(User sdncModifierDetails, String serviceName,
+			String serviceVersion) throws IOException {
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails, true);
+
+		HttpRequest http = new HttpRequest();
+
+		String url = String.format(Urls.DELETE_SERVICE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
+				config.getCatalogBePort(), serviceName, serviceVersion);
+		RestResponse deleteResponse = http.httpSendDelete(url, headersMap);
+
+		return deleteResponse;
+	}
+
+	public static RestResponse getFollowed(User user) throws Exception {
+		Config config = Utils.getConfig();
+
+		HttpRequest httpRequest = new HttpRequest();
+
+		String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
+
+		RestResponse getResourceNotAbstarctResponse = httpRequest.httpSendGet(url, headersMap);
+
+		return getResourceNotAbstarctResponse;
+	}
+
+	public static JSONArray getListArrayFromRestResponse(RestResponse restResponse) {
+		String json = restResponse.getResponse();
+		JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
+		JSONArray servicesArray = (JSONArray) jsonResp.get("services");
+
+		logger.debug("services= {}", servicesArray);
+
+		return servicesArray;
+	}
+	
+	public static RestResponse getDistributionServiceList(Service service, User user) throws IOException {
+
+		Config config = Utils.getConfig();
+		String url = String.format(Urls.DISTRIBUTION_SERVICE_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), service.getUUID());
+		return getServiceFromUrl(url, user, false);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java
new file mode 100644
index 0000000..881e946
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java
@@ -0,0 +1,299 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.rest;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.run.StartTest;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.Gson;
+
+public class UserRestUtils extends BaseRestUtils {
+
+	static Gson gson = new Gson();
+
+	static Logger logger = LoggerFactory.getLogger(UserRestUtils.class.getName());
+	static String contentTypeHeaderData = "application/json";
+	static String acceptHeaderDate = "application/json";
+
+	public UserRestUtils() {
+		super();
+
+		StartTest.enableLogger();
+	}
+
+	public static RestResponse createUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		String userBodyJson = gson.toJson(sdncUserDetails);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.CREATE_USER, config.getCatalogBeHost(), config.getCatalogBePort());
+
+		logger.debug("Send POST request to create user: {}", url);
+		logger.debug("User body: {}", userBodyJson);
+		logger.debug("User headers: {}", headersMap);
+		RestResponse sendCreateUserRequest = http.httpSendPost(url, userBodyJson, headersMap);
+
+		return sendCreateUserRequest;
+
+	}
+
+	public static RestResponse deactivateUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
+		return deleteUser(sdncUserDetails, sdncModifierDetails, true);
+	}
+
+	public static RestResponse deActivateUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
+		return deleteUser(sdncUserDetails, sdncModifierDetails, false);
+	}
+
+	public static RestResponse deleteUser(User sdncUserDetails, User sdncModifierDetails, boolean isForceDelete)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		if (isForceDelete) {
+			headersMap.put(User.FORCE_DELETE_HEADER_FLAG, User.FORCE_DELETE_HEADER_FLAG);
+		}
+
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.DELETE_USER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				sdncUserDetails.getUserId());
+		RestResponse sendDeleteUserRequest = http.httpSendDelete(url, headersMap);
+		return sendDeleteUserRequest;
+
+	}
+
+	public static RestResponse updateUser(User sdncUserDetails, User sdncModifierDetails)
+			throws IOException, CloneNotSupportedException {
+
+		Config config = Utils.getConfig();
+		User user = new User(sdncModifierDetails);
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		user.setUserId(StringUtils.EMPTY);
+		user.setRole(StringUtils.EMPTY);
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(user);
+		logger.debug("userBodyJson: {}", userBodyJson);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_USER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				sdncModifierDetails.getUserId());
+		RestResponse sendUpdateUserRequest = http.httpSendPost(url, userBodyJson, headersMap);
+
+		return sendUpdateUserRequest;
+	}
+
+	/// Benny
+	public static RestResponse updateUserRole(User sdncUserDetails, User sdncModifierDetails, String userIdToUpdate)
+			throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		Gson gson = new Gson();
+		String userBodyJson = gson.toJson(sdncUserDetails);
+		logger.debug("userBodyJson: {}", userBodyJson);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.UPDATE_USER_ROLE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				userIdToUpdate);
+		RestResponse sendUpdateUserRequest = http.httpSendPost(url, userBodyJson, headersMap);
+
+		return sendUpdateUserRequest;
+
+	}
+
+	public static RestResponse getUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_USER, config.getCatalogBeHost(), config.getCatalogBePort(),
+				sdncUserDetails.getUserId());
+		RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
+		return sendGetUserRequest;
+
+	}
+	
+	public static RestResponse getUserRole(User sdncUserDetails, User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_USER_ROLE, config.getCatalogBeHost(), config.getCatalogBePort(),
+				sdncUserDetails.getUserId());
+		RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
+		return sendGetUserRequest;
+
+	}
+	
+	
+
+	public static RestResponse getAllAdminUsers(User sdncModifierDetails) throws IOException {
+
+		Config config = Utils.getConfig();
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+
+		// Gson gson = new Gson();
+		// String userBodyJson = gson.toJson(sdncModifierDetails);
+		// System.out.println(userBodyJson);
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_ALL_ADMIN_USERS, config.getCatalogBeHost(), config.getCatalogBePort());
+		logger.debug("Send following url: {} and headers: {}",url, headersMap.toString());
+		RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
+
+		return sendGetUserRequest;
+
+	}
+
+	// US571255
+	public static RestResponse getUsersByRoles(User sdncModifierDetails, String roles) throws IOException {
+
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		HttpRequest http = new HttpRequest();
+		String url;
+		if (roles == "/") {
+			url = String.format(Urls.GET_ALL_USERS, config.getCatalogBeHost(), config.getCatalogBePort());
+		} else {
+			url = String.format(Urls.GET_USERS_BY_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(), roles);
+
+		}
+		logger.debug("Send following url: {} and headers: {}",url, headersMap.toString());
+		RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
+		return sendGetUserRequest;
+	}
+
+	public static RestResponse getUsersByRolesHttpCspAtuUidIsMissing(User sdncModifierDetails, String roles)
+			throws Exception {
+
+		Config config = Utils.getConfig();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
+		headersMap.remove("USER_ID");
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.GET_USERS_BY_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(),
+				roles);
+		logger.debug(
+				"Send following url without USER_ID header : " + url + "  headers: " + headersMap.toString());
+
+		RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
+		return sendGetUserRequest;
+	}
+
+	public static RestResponse authorizedUserTowardsCatalogBe(User sdncUserDetails) throws IOException {
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		if (sdncUserDetails.getFirstName() != null) {
+			headersMap.put(HttpHeaderEnum.HTTP_CSP_FIRSTNAME.getValue(), sdncUserDetails.getFirstName());
+		}
+		if (sdncUserDetails.getLastName() != null) {
+			headersMap.put(HttpHeaderEnum.HTTP_CSP_LASTNAME.getValue(), sdncUserDetails.getLastName());
+		}
+		if (sdncUserDetails.getEmail() != null) {
+			headersMap.put(HttpHeaderEnum.HTTP_CSP_EMAIL.getValue(), sdncUserDetails.getEmail());
+		}
+
+		logger.debug("headersMap: {}", headersMap.toString());
+
+		Config config = Utils.getConfig();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.AUTHORIZE_USER, config.getCatalogBeHost(), config.getCatalogBePort());
+		logger.debug("Send GET request to login as seal user : {}", url);
+		return http.httpSendGet(url, headersMap);
+	}
+
+	public static RestResponse authorizedUserTowardsCatalogBeQA(User sdncUserDetails) throws IOException {
+
+		Map<String, String> headersMap = new HashMap<String, String>();
+		headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
+		headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		if (sdncUserDetails.getFirstName() != null) {
+			headersMap.put(HttpHeaderEnum.HTTP_CSP_FIRSTNAME.getValue(), sdncUserDetails.getFirstName());
+		}
+		if (sdncUserDetails.getLastName() != null) {
+			headersMap.put(HttpHeaderEnum.HTTP_CSP_LASTNAME.getValue(), sdncUserDetails.getLastName());
+		}
+		if (sdncUserDetails.getEmail() != null) {
+			headersMap.put(HttpHeaderEnum.HTTP_CSP_EMAIL.getValue(), sdncUserDetails.getEmail());
+		}
+
+		logger.debug("headersMap: {}", headersMap.toString());
+
+		Config config = Utils.getConfig();
+		HttpRequest http = new HttpRequest();
+		String url = String.format(Urls.AUTHORIZE_USER, config.getCatalogBeHost(), config.getCatalogBePort());
+		logger.debug("Send GET request to login as seal user : {}", url);
+		return http.httpSendGet(url, headersMap);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java
new file mode 100644
index 0000000..b211cb7
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java
@@ -0,0 +1,226 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.resources.data.ESArtifactData;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Decoder;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public class ArtifactValidationUtils {
+
+	private static String desc = "description";
+	private static String artifactType = "artifactType";
+	private static String artifactName = "artifactName";
+	private static String artifactChecksum = "artifactChecksum";
+	private static String uniqueId = "uniqueId";
+	protected Utils utils;
+
+	public static void validateInformationalArtifact(ArtifactReqDetails expectedArtifact,
+			Map<String, Object> actualArtifact) {
+		assertTrue("description is not as expected",
+				expectedArtifact.getDescription().equals(actualArtifact.get(desc).toString()));
+		assertTrue("artifactType is not as expected",
+				expectedArtifact.getArtifactType().toUpperCase().equals(actualArtifact.get(artifactType).toString()));
+		assertTrue("artifactName is not as expected",
+				expectedArtifact.getArtifactName().equals(actualArtifact.get(artifactName).toString()));
+		assertTrue("uniqueId is not as expected",
+				expectedArtifact.getUniqueId().equals(actualArtifact.get(uniqueId).toString()));
+		assertTrue("description is not as expected", expectedArtifact.getArtifactLabel().toLowerCase()
+				.equals(actualArtifact.get("artifactLabel").toString()));
+	}
+
+	public static void validateArtifactsNumberInComponent(Component component, ArtifactGroupTypeEnum artifactGroupType,
+			ArtifactTypeEnum artifactType, int expectedNumber) {
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		int counter = 0;
+		if (artifactGroupType == ArtifactGroupTypeEnum.DEPLOYMENT) {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getArtifacts();
+		}
+		if (deploymentArtifacts != null) {
+			for (ArtifactDefinition artifactDefinition : deploymentArtifacts.values()) {
+				if (artifactDefinition.getArtifactType().equals(artifactType.getType())) {
+					counter++;
+				}
+			}
+		}
+		assertEquals("Unexpected number of " + artifactGroupType.getType() + " artifacts in component", expectedNumber,
+				counter);
+	}
+
+	// Benny
+	public static void validateArtifactsNumberInComponentInstance(ComponentInstance componentInstance,
+			ArtifactGroupTypeEnum artifactGroupType, ArtifactTypeEnum artifactType, int expectedNumber) {
+		Map<String, ArtifactDefinition> deploymentArtifacts = null;
+		int counter = 0;
+		if (artifactGroupType == ArtifactGroupTypeEnum.DEPLOYMENT) {
+			deploymentArtifacts = componentInstance.getDeploymentArtifacts();
+		}
+		if (deploymentArtifacts != null) {
+			for (ArtifactDefinition artifactDefinition : deploymentArtifacts.values()) {
+				if (artifactDefinition.getArtifactType().equals(artifactType.getType())) {
+					counter++;
+				}
+			}
+		}
+		assertEquals("Unexpected number of " + artifactGroupType.getType() + " artifacts in component", expectedNumber,
+				counter);
+	}
+
+	public static ESArtifactData parseArtifactRespFromES(RestResponse resResponse)
+			throws JsonParseException, JsonProcessingException, Exception {
+		String bodyToParse = resResponse.getResponse();
+		JsonElement jElement = new JsonParser().parse(bodyToParse);
+		JsonElement jsourceElement = jElement.getAsJsonObject().get("_source");
+
+		ObjectMapper mapper = new ObjectMapper();
+		ESArtifactData esArtifactObject = mapper.readValue(jsourceElement.toString(), ESArtifactData.class);
+
+		return esArtifactObject;
+
+	}
+
+	public static void validateArtifactReqVsResp(ArtifactReqDetails expectedArtifactDetails,
+			ArtifactDefinition actualArtifactJavaObject) {
+		String expected;
+
+		expected = expectedArtifactDetails.getArtifactName();
+		if (expected == null)
+			expected = "";
+		assertEquals("artifact name is not correct ", expected, actualArtifactJavaObject.getArtifactName());
+
+		expected = expectedArtifactDetails.getArtifactType();
+		if (expected == null)
+			expected = "";
+		assertEquals("artifact type is not correct ", expected, actualArtifactJavaObject.getArtifactType());
+
+		expected = expectedArtifactDetails.getDescription();
+		if (expected == null)
+			expected = "";
+		assertEquals("artifact description is not correct ", expected, actualArtifactJavaObject.getDescription());
+
+		expected = expectedArtifactDetails.getArtifactLabel();
+		if (expected == null || expected == "") {
+			expected = expectedArtifactDetails.getArtifactName().toLowerCase().substring(0,
+					expectedArtifactDetails.getArtifactName().lastIndexOf("."));
+			// expected = tmp.substring(0,
+			// artifactInfo.getArtifactName().lastIndexOf("."));
+		}
+		assertEquals("artifact label is not correct ", expected, actualArtifactJavaObject.getArtifactLabel());
+
+		expected = expectedArtifactDetails.getUrl();
+		if (expected != "") {
+			assertEquals(expected, actualArtifactJavaObject.getApiUrl());
+			assertEquals(expectedArtifactDetails.getArtifactDisplayName(),
+					actualArtifactJavaObject.getArtifactDisplayName());
+		}
+
+		// assertEquals(validChecksum,
+		// actualArtifactJavaObject.getArtifactChecksum());
+
+		// expected = expectedArtifactDetails.getArtifactDisplayName();
+		// if (expected != "")
+		// {
+		// assertEquals(expected,
+		// actualArtifactJavaObject.getArtifactDisplayName());
+		// }
+
+		boolean actual = actualArtifactJavaObject.getMandatory();
+		assertEquals(expectedArtifactDetails.isMandatory(), actual);
+
+		if (actualArtifactJavaObject.getServiceApi()) {
+
+			boolean actual2 = actualArtifactJavaObject.getServiceApi();
+			assertEquals(expectedArtifactDetails.isServiceApi(), actual2);
+		}
+
+	}
+
+	public static void validateEsArtifactReqVsResp(ArtifactReqDetails expectedArtifactInfo,
+			ESArtifactData esArtifactData) throws Exception {
+		String expectedArtifactUid = expectedArtifactInfo.getUniqueId();
+		if (expectedArtifactUid == null)
+			expectedArtifactUid = "";
+		assertEquals("artifact name is not correct ", expectedArtifactUid, esArtifactData.getId());
+
+		String actualPayload = Decoder.encode(esArtifactData.getData().array());
+		assertEquals("artifact payloadData is not correct ", expectedArtifactInfo.getPayload(), actualPayload);
+	}
+
+	public static List<String> getListOfArtifactFromFolder(String folderName) throws IOException, Exception {
+		Config config = Utils.getConfig();
+		String sourceDir = config.getResourceConfigDir();
+		String testResourcesPath = sourceDir + File.separator + folderName;
+		List<String> listofFiles = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		return listofFiles;
+	}
+
+	public static ArtifactReqDetails replaceDefaultArtWithArtFromList_(ArtifactReqDetails heatArtifactDetails,
+			String heatExtension, String folderName, int positionInlist) throws IOException, Exception {
+
+		Config config = Utils.getConfig();
+		String ext = heatExtension;
+		String sourceDir = config.getResourceConfigDir();
+		String testResourcesPath = sourceDir + File.separator + folderName;
+		List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
+		String payload = FileUtils.loadPayloadFile(listFileName, ext, true);
+		heatArtifactDetails.setPayload(payload);
+		heatArtifactDetails.setArtifactName(listFileName.get(positionInlist) + "." + ext);
+		return heatArtifactDetails;
+	}
+
+	public static ArtifactReqDetails replaceDefaultArtWithArtFromList(ArtifactReqDetails heatArtifactDetails,
+			String heatExtension, String folderName, int positionInlist) throws IOException, Exception {
+		List<String> listOfArtifactFromFolder = getListOfArtifactFromFolder(folderName);
+		String payload = FileUtils.loadPayloadFileFromListUsingPosition(listOfArtifactFromFolder, heatExtension, true,
+				positionInlist);
+		heatArtifactDetails.setPayload(payload);
+		heatArtifactDetails.setArtifactName(heatArtifactDetails.getArtifactType()
+				+ listOfArtifactFromFolder.get(positionInlist) + "." + heatExtension);
+		return heatArtifactDetails;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
new file mode 100644
index 0000000..7a5b7bb
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
@@ -0,0 +1,1418 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.javatuples.Pair;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.AuditEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.AuditJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ComponentType;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedAuthenticationAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedDistDownloadAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedEcomConsumerAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedGetUserListAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedUserCRUDAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.run.StartTest;
+import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils.CategoryAuditJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils.EcompConsumerAuditJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+
+import com.datastax.driver.core.ColumnDefinitions;
+import com.datastax.driver.core.Row;
+
+public class AuditValidationUtils {
+	protected static Logger logger = Logger.getLogger(AuditValidationUtils.class.getName());
+	private static final String auditKeySpaceName = "sdcaudit";
+
+	public AuditValidationUtils() {
+		super();
+
+		StartTest.enableLogger();
+		logger = Logger.getLogger(AuditValidationUtils.class.getName());
+
+	}
+
+	public static String buildAuditDescription(ErrorInfo errorInfo, List<String> variables) {
+
+		String auditDesc = errorInfo.getMessageId() + ": " + errorInfo.getMessage();
+		if(! variables.isEmpty() && variables.get(0) != null && ! variables.get(0).isEmpty()){
+			for (int i = 0; i < variables.size(); i++) {
+				if (auditDesc.contains("%" + (i + 1))) {
+					auditDesc = auditDesc.replace("%" + (i + 1), variables.get(i));
+				}
+			}
+		}
+		return auditDesc;
+	}
+
+	public static String getModifierString(String userName, String uid) {
+
+		if (userName.isEmpty() && uid.isEmpty())
+			return "(UNKNOWN)";
+
+		StringBuilder sb = new StringBuilder();
+		sb.append(userName).append("(").append(uid).append(")");
+		return sb.toString();
+
+	}
+
+	public static void validateAuditDownloadExternalAPI(ExpectedResourceAuditJavaObject resourceAuditJavaObject,
+			String action, String body, boolean checkAllFields) throws Exception {
+		Map<String, Object> actualAuditRecords = new HashMap<String, Object>();
+		// Andrey's comment
+		// actualAuditRecords = parseAuditResourceByAction(action, body);
+		actualAuditRecords = parseAuditResourceByAction(action, null);
+
+		// List<Map<String, Object>> actualAuditRecords = new
+		// ArrayList<Map<String, Object>>();
+		// actualAuditRecords = parseAuditResourceByActionToList(action, body);
+
+		validateField(actualAuditRecords, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+
+		validateField(actualAuditRecords, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getStatus());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getDesc());
+
+		// validateField(actualAuditRecords,
+		// AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(),
+		// resourceAuditJavaObject.getCONSUMER_ID());
+		// validateField(actualAuditRecords,
+		// AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(),
+		// resourceAuditJavaObject.getRESOURCE_URL());
+
+	}
+
+	public static void validateAudit(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action,
+			String body, boolean checkAllFields) throws Exception {
+		Map<String, Object> actualAuditRecords = new HashMap<String, Object>();
+		// Andrey's comment
+		// actualAuditRecords = parseAuditResourceByAction(action, body);
+		actualAuditRecords = parseAuditResourceByAction(action, null);
+
+		if ((resourceAuditJavaObject.getModifierName() != null) && (resourceAuditJavaObject.getModifierUid() != null)) {
+			resourceAuditJavaObject.setModifierUid(getModifierString(resourceAuditJavaObject.getModifierName(),
+					resourceAuditJavaObject.getModifierUid()));
+		}
+
+		validateField(actualAuditRecords, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getPrevVersion());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+
+		validateField(actualAuditRecords, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getModifierUid());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getPrevState());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrState());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getStatus());
+		// validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+		// Double.parseDouble(resourceAuditJavaObject.getStatus()));
+		validateField(actualAuditRecords, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getDesc());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getComment());
+		// validateField(map2,
+		// AuditJsonKeysEnum.ARTIFACT_DATA.getAuditJsonKeyName(),
+		// resourceAuditJavaObject.getArtifactData());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.TOSCA_NODE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getToscaNodeType());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.CURR_ARTIFACT_UUID.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrArtifactUuid());
+		validateField(actualAuditRecords, AuditJsonKeysEnum.PREV_ARTIFACT_UUID.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getPrevArtifactUuid());
+
+		validateAtifactDataField(actualAuditRecords, AuditJsonKeysEnum.ARTIFACT_DATA.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getArtifactData(), checkAllFields);
+	}
+
+	public static void validateExternalAudit(ExpectedExternalAudit externalAuditObject, String action,
+			Map<AuditingFieldsKeysEnum, String> body) throws Exception {
+
+		Map<String, Object> actualAuditRecord = new HashMap<String, Object>();
+		actualAuditRecord = parseAuditResourceByAction(action, body);
+
+		validateField(actualAuditRecord, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(actualAuditRecord, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(),
+				externalAuditObject.getCONSUMER_ID());
+		// TODO
+		validateField(actualAuditRecord, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(),
+				externalAuditObject.getRESOURCE_URL());
+		//TODO
+		validateField(actualAuditRecord, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				externalAuditObject.getRESOURCE_NAME());
+		validateField(actualAuditRecord, AuditJsonKeysEnum.SERVICE_INSTANCE_ID.getAuditJsonKeyName(),
+				externalAuditObject.getSERVICE_INSTANCE_ID());
+		//TODO
+		validateField(actualAuditRecord, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				externalAuditObject.getRESOURCE_TYPE());
+		validateField(actualAuditRecord, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				externalAuditObject.getSTATUS());
+		validateField(actualAuditRecord, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(),
+				externalAuditObject.getDESC());
+		//TODO
+//		validateField(actualAuditRecord, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+//				externalAuditObject.getMODIFIER());
+		validateField(actualAuditRecord, AuditJsonKeysEnum.PREV_ARTIFACT_UUID.getAuditJsonKeyName(),
+				externalAuditObject.getPREV_ARTIFACT_UUID());
+		validateField(actualAuditRecord, AuditJsonKeysEnum.CURR_ARTIFACT_UUID.getAuditJsonKeyName(),
+				externalAuditObject.getCURR_ARTIFACT_UUID());
+		//TODO
+		validateField(actualAuditRecord, AuditJsonKeysEnum.ARTIFACT_DATA.getAuditJsonKeyName(),
+				externalAuditObject.getARTIFACT_DATA());
+
+	}
+
+	public enum ArtifactDataFieldEnum {
+		attGroup, artLable, artType, artName, artTimeout, artPayloadUUID, artVersion, artUUID
+	}
+
+	private static void validateAtifactDataField(Map<String, Object> map, String auditJsonKeyName,
+			String expectedArtifactData, boolean checkAllFields) {
+		Map<ArtifactDataFieldEnum, String> expectedArtifactDataFileds = new HashMap<ArtifactDataFieldEnum, String>();
+		Map<ArtifactDataFieldEnum, String> actualAtifactDataFileds = new HashMap<ArtifactDataFieldEnum, String>();
+		if (expectedArtifactData != null) {
+			String[] expected = expectedArtifactData.split(",");
+
+			assertTrue("Audit field " + auditJsonKeyName + " not found", map.containsKey(auditJsonKeyName));
+			String actualValue = (String) map.get(auditJsonKeyName);
+			String[] actual = actualValue.split(",");
+
+			if (expected.length == 1 && actual.length == 1) {
+				assertEquals(expectedArtifactData, actualValue);
+				return;
+			}
+
+			assertEquals(ArtifactDataFieldEnum.values().length, expected.length);
+			assertEquals(ArtifactDataFieldEnum.values().length, actual.length);
+
+			for (ArtifactDataFieldEnum field : ArtifactDataFieldEnum.values()) {
+
+				expectedArtifactDataFileds.put(field, expected[field.ordinal()]);
+				actualAtifactDataFileds.put(field, actual[field.ordinal()]);
+			}
+			for (Map.Entry<ArtifactDataFieldEnum, String> entry : expectedArtifactDataFileds.entrySet()) {
+				ArtifactDataFieldEnum field = entry.getKey();
+				if (checkAllFields || (!field.equals(ArtifactDataFieldEnum.artVersion)
+						&& !field.equals(ArtifactDataFieldEnum.artUUID))) {
+					assertTrue("Audit field ArtifactData dosn't containt " + field,
+							actualAtifactDataFileds.containsKey(field));
+					assertEquals("Audit field ArtifactData dosn't equal " + field,
+							expectedArtifactDataFileds.get(field), actualAtifactDataFileds.get(field));
+				}
+
+			}
+		}
+	}
+
+	// //Benny
+	public static void validateEcompConsumerAudit(ExpectedEcomConsumerAudit ecompConsumerAuditJavaObject, String action)
+			throws Exception {
+
+		String fixedAction = BaseRestUtils.encodeUrlForDownload(action);
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(fixedAction, null);
+
+		validateField(map2, EcompConsumerAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+				ecompConsumerAuditJavaObject.getModifier());
+		validateField(map2, EcompConsumerAuditJsonKeysEnum.ECOMP_USER.getAuditJsonKeyName(),
+				ecompConsumerAuditJavaObject.getEcomUser());
+		validateField(map2, EcompConsumerAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				ecompConsumerAuditJavaObject.getStatus());
+		validateField(map2, EcompConsumerAuditJsonKeysEnum.DESC.getAuditJsonKeyName(),
+				ecompConsumerAuditJavaObject.getDesc());
+		validateField(map2, EcompConsumerAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+	}
+
+	public static void ecompConsumerAuditSuccess(String action, ConsumerDataDefinition consumerDataDefinition,
+			User user, int status) throws Exception {
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(action);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(
+				consumerDataDefinition.getConsumerName() + "," + consumerDataDefinition.getConsumerSalt().toLowerCase()
+						+ "," + consumerDataDefinition.getConsumerPassword().toLowerCase());
+		expectedEcomConsumerAuditJavaObject.setStatus(String.valueOf(status));
+		expectedEcomConsumerAuditJavaObject.setDesc("OK");
+		expectedEcomConsumerAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject, action);
+	}
+
+	public static void createEcompConsumerAuditFailure(String action, ConsumerDataDefinition consumerDataDefinition,
+			User user, ActionStatus errorMessage, Object... variables) throws Exception {
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		expectedEcomConsumerAuditJavaObject.setAction(action);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(
+				consumerDataDefinition.getConsumerName() + "," + consumerDataDefinition.getConsumerSalt().toLowerCase()
+						+ "," + consumerDataDefinition.getConsumerPassword().toLowerCase());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		expectedEcomConsumerAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject, action);
+	}
+
+	public static void deleteEcompConsumerAuditFailure(String action, ConsumerDataDefinition consumerDataDefinition,
+			User user, ActionStatus errorMessage, Object... variables) throws Exception {
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
+		ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
+		// String auditAction = ADD_ECOMP_USER_CREDENTIALS_AUDIT_ACTION;
+		expectedEcomConsumerAuditJavaObject.setAction(action);
+		expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName());
+		expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		expectedEcomConsumerAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject, action);
+	}
+
+	////////////////////// US571255
+	public static void GetListOfUsersByRolesAuditFailure(String action, String roles, int status, User userModifier,
+			ActionStatus errorMessage, Object... variables) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
+		ExpectedGetUserListAudit expectedGetListOfUsersAuditJavaObject = new ExpectedGetUserListAudit(); // String
+																											// auditAction
+																											// =
+																											// ADD_ECOMP_USER_CREDENTIALS_AUDIT_ACTION;
+		expectedGetListOfUsersAuditJavaObject.setAction(action);
+		expectedGetListOfUsersAuditJavaObject.setStatus(String.valueOf(status));
+		expectedGetListOfUsersAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+
+		expectedGetListOfUsersAuditJavaObject.setDetails(roles);
+		if (errorMessage == ActionStatus.USER_INACTIVE || errorMessage == ActionStatus.MISSING_INFORMATION) {
+			expectedGetListOfUsersAuditJavaObject.setModifier("(UNKNOWN)");
+		} else {
+			expectedGetListOfUsersAuditJavaObject
+					.setModifier(userModifier.getFullName() + "(" + userModifier.getUserId() + ")");
+		}
+		AuditValidationUtils.validateAuditGetListOfUsersByRoles(expectedGetListOfUsersAuditJavaObject, action);
+	}
+
+	public static void GetListOfUsersByRolesAuditSuccess(String action, String roles, User user, int status)
+			throws Exception {
+		ExpectedGetUserListAudit expectedGetListOfUsersAuditJavaObject = new ExpectedGetUserListAudit();
+		expectedGetListOfUsersAuditJavaObject.setAction(action);
+		expectedGetListOfUsersAuditJavaObject.setStatus(String.valueOf(status));
+		expectedGetListOfUsersAuditJavaObject.setDesc("OK");
+		expectedGetListOfUsersAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		expectedGetListOfUsersAuditJavaObject.setDetails(roles);
+		validateAuditGetListOfUsersByRoles(expectedGetListOfUsersAuditJavaObject, action);
+	}
+
+	public static void validateAuditGetListOfUsersByRoles(ExpectedGetUserListAudit GetListOfUsersAuditJavaObject,
+			String action) throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), GetListOfUsersAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+				GetListOfUsersAuditJavaObject.getModifier());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(),
+				GetListOfUsersAuditJavaObject.getDesc());
+		validateField(map2, AuditJsonKeysEnum.DETAILS.getAuditJsonKeyName(),
+				GetListOfUsersAuditJavaObject.getDetails());
+	}
+
+	public static void validateAuditImport(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action)
+			throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+
+		resourceAuditJavaObject.setModifierUid(
+				getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getPrevVersion());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
+		validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevState());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
+
+	}
+
+	public static void validateAuditDistribution(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action)
+			throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+
+		resourceAuditJavaObject.setModifierUid(
+				getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
+		validateField(map2, AuditJsonKeysEnum.DPREV_STATUS.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getDprevStatus());
+		validateField(map2, AuditJsonKeysEnum.DCURR_STATUS.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getDcurrStatus());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
+		validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
+		validateField(map2, AuditJsonKeysEnum.DID.getAuditJsonKeyName(), resourceAuditJavaObject.getDistributionId());
+
+	}
+
+	// Benny
+	public static void validateAudit_Distribution(ExpectedResourceAuditJavaObject resourceAuditJavaObject,
+			String action) throws Exception {
+
+		List<Map<String, Object>> actionToList = getAuditListByAction(resourceAuditJavaObject.getAction(), 1);
+		Map<String, Object> map2 = actionToList.get(0);
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getMODIFIER());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
+		validateField(map2, AuditJsonKeysEnum.DPREV_STATUS.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getDprevStatus());
+		validateField(map2, AuditJsonKeysEnum.DCURR_STATUS.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getDcurrStatus());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
+		validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
+
+	}
+
+	public void validateAuditNotification(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action)
+			throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+
+		resourceAuditJavaObject.setModifierUid(
+				getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
+		validateField(map2, AuditJsonKeysEnum.DID.getAuditJsonKeyName(), resourceAuditJavaObject.getDistributionId());
+		validateField(map2, AuditJsonKeysEnum.TOPIC_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getTopicName());
+
+	}
+
+	public static void validateAudit(ExpectedDistDownloadAudit expectedDistDownloadAudit, String action)
+			throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedDistDownloadAudit.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedDistDownloadAudit.getDesc());
+		validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(),
+				expectedDistDownloadAudit.getConsumerId());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(),
+				expectedDistDownloadAudit.getResourceUrl());
+	}
+	
+	public static void validateAuditExternalSearchAPI(ExpectedExternalAudit expectedDistDownloadAudit, String action, Map<AuditingFieldsKeysEnum, String> body)
+			throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, body);
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedDistDownloadAudit.getSTATUS());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedDistDownloadAudit.getDESC());
+		validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(),
+				expectedDistDownloadAudit.getCONSUMER_ID());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(),
+				expectedDistDownloadAudit.getRESOURCE_URL());
+	}
+	
+	public static void validateAuditExternalCreateResource(ExpectedResourceAuditJavaObject expectedExternalAudit, String action, Map<AuditingFieldsKeysEnum, String> body) throws Exception {
+	Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, body);
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), expectedExternalAudit.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), expectedExternalAudit.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), expectedExternalAudit.getCONSUMER_ID());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), expectedExternalAudit.getRESOURCE_URL());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedExternalAudit.getMODIFIER());
+		
+		validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getPrevVersion());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), expectedExternalAudit.getPrevState());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), expectedExternalAudit.getCurrState());
+		
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedExternalAudit.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedExternalAudit.getDesc());
+	}
+	
+	public static void validateAuditExternalChangeAssetLifeCycle(ExpectedResourceAuditJavaObject expectedExternalAudit, String action, Map<AuditingFieldsKeysEnum, String> body) throws Exception {
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, body);
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedExternalAudit.getDesc());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedExternalAudit.getStatus());
+
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), expectedExternalAudit.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), expectedExternalAudit.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), expectedExternalAudit.getCONSUMER_ID());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), expectedExternalAudit.getRESOURCE_URL());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedExternalAudit.getMODIFIER());
+		
+		validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getPrevVersion());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), expectedExternalAudit.getPrevState());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), expectedExternalAudit.getCurrState());
+		
+		
+		// TODO: Remove comment
+//		validateField(map2, AuditJsonKeysEnum.INVARIANT_UUID.getAuditJsonKeyName(), expectedExternalAudit.getINVARIANT_UUID());
+	}
+
+	public void validateAuditDeploy(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action)
+			throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+
+		resourceAuditJavaObject.setModifierUid(
+				getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
+		validateField(map2, AuditJsonKeysEnum.DID.getAuditJsonKeyName(), resourceAuditJavaObject.getDistributionId());
+
+	}
+
+	public static void validateAuditProduct(ExpectedProductAudit productExpectedAudit, String action,
+			AuditJsonKeysEnum... additionalFields) throws Exception {
+
+		Map<String, Object> map2 = new HashMap<String, Object>();
+		map2 = parseAuditResourceByAction(action, null);
+
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				productExpectedAudit.getRESOURCE_NAME());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				productExpectedAudit.getRESOURCE_TYPE());
+		validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(),
+				productExpectedAudit.getPREV_VERSION());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				productExpectedAudit.getCURR_VERSION());
+		validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), productExpectedAudit.getPREV_STATE());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), productExpectedAudit.getCURR_STATE());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), productExpectedAudit.getMODIFIER());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), productExpectedAudit.getSTATUS());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), productExpectedAudit.getDESC());
+		validateField(map2, AuditJsonKeysEnum.SERVICE_INSTANCE_ID.getAuditJsonKeyName(),
+				productExpectedAudit.getSERVICE_INSTANCE_ID());
+		if (additionalFields != null) {
+			List<AuditJsonKeysEnum> fieldsList = Arrays.asList(additionalFields);
+			if (fieldsList.contains(AuditJsonKeysEnum.COMMENT)) {
+				validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), productExpectedAudit.getCOMMENT());
+			}
+		}
+	}
+
+	private static List<Map<String, Object>> getAuditListByAction(String action, int expectedNumOfAudit)
+			throws Exception {
+		List<Map<String, Object>> actionToList = parseAuditResourceByActionToList(action, null);
+		assertEquals("recieved different audits number than expected", expectedNumOfAudit, actionToList.size());
+		return actionToList;
+	}
+
+	public static void validateAuthenticationAudit(ExpectedAuthenticationAudit expectedAudit) throws Exception {
+		List<Map<String, Object>> actionToList = getAuditListByAction(expectedAudit.getAction(), 1);
+		assertEquals("expected number of ES action is 1", 1, actionToList.size());
+
+		Map<String, Object> map = actionToList.get(0);
+		validateField(map, AuditEnum.ACTION.getValue(), expectedAudit.getAction());
+		validateField(map, AuditEnum.URL.getValue(), expectedAudit.getUrl());
+		validateField(map, AuditEnum.USER.getValue(), expectedAudit.getUser());
+		validateField(map, AuditEnum.AUTH_STATUS.getValue(), expectedAudit.getAuthStatus());
+		validateField(map, AuditEnum.REALM.getValue(), expectedAudit.getRealm());
+
+	}
+
+	private static void validateField(Map<String, Object> actualAuditRecord, String jsonField, Object expectedValue) {
+		if (expectedValue == null) {
+			// || changed to &&
+			if (actualAuditRecord.containsKey(jsonField)) {
+				assertTrue("Audit field " + jsonField + ": expected null, actual " + actualAuditRecord.get(jsonField),
+						actualAuditRecord.get(jsonField).toString().equals("null")
+								|| actualAuditRecord.get(jsonField).toString().equals(Constants.EMPTY_STRING));
+			}
+
+		} else {
+			assertTrue("Audit field " + jsonField + " not found in actual", actualAuditRecord.containsKey(jsonField));
+			Object foundValue = actualAuditRecord.get(jsonField);
+			compareElements(expectedValue, foundValue);
+		}
+	}
+
+	public static void compareElements(Object expectedValue, Object foundValue) {
+		if (expectedValue instanceof String) {
+			assertTrue("Actual value " + foundValue + " is not string", foundValue instanceof String);
+			assertTrue("Expected " + expectedValue + " not equal to actual " + foundValue,
+					foundValue.equals(expectedValue));
+		}
+		/*
+		 * else if( expectedValue instanceof Number){ assertTrue(foundValue
+		 * instanceof Number); assertTrue(foundValue == expectedValue); }
+		 */
+		else if (expectedValue instanceof Boolean) {
+			assertTrue(foundValue instanceof Boolean);
+			assertTrue(foundValue == expectedValue);
+		} else if (expectedValue instanceof Map) {
+			assertTrue(foundValue instanceof Map);
+			Map<String, Object> foundMap = (Map<String, Object>) foundValue;
+			Map<String, Object> excpectedMap = (Map<String, Object>) expectedValue;
+			assertTrue("size of maps is not equel", foundMap.size() == excpectedMap.size());
+			Iterator<String> foundkeyItr = foundMap.keySet().iterator();
+			while (foundkeyItr.hasNext()) {
+				String foundKey = foundkeyItr.next();
+				assertTrue(excpectedMap.containsKey(foundKey));
+				compareElements(excpectedMap.get(foundKey), foundMap.get(foundKey));
+			}
+
+		} else if (expectedValue instanceof List) {
+			assertTrue(foundValue instanceof List);
+			List<Object> foundList = (List<Object>) foundValue;
+			List<Object> excpectedList = (List<Object>) expectedValue;
+			assertTrue("size of maps is not equel", foundList.size() == excpectedList.size());
+            if( foundList.size() > 0 ){
+                final Object elementInList = foundList.get(0);
+                if( !(elementInList instanceof List || elementInList instanceof Map) ){
+                       List<Object> tempList = new ArrayList<>();
+                       tempList.addAll(foundList);
+                       for(Object expectedObj : excpectedList){
+                              if( tempList.contains(expectedObj)){
+                                     tempList.remove(expectedObj);
+                              }
+                              else{
+                            	  assertTrue(false);
+                              }
+                       }
+                       assertTrue("Lists are not equel", tempList.isEmpty());
+                }
+            }
+
+		} else {
+			assertTrue(foundValue.equals(expectedValue));
+		}
+	}
+
+	// public static Map<String, Object> parseAuditResourceByAction(String
+	// action, String body) throws Exception {
+	//
+	// Map auditingMessage = null;
+	// auditingMessage = retrieveAuditMessagesByPattern(action, null);
+	//
+	// return auditingMessage;
+	//
+	// }
+
+	public static Map<String, Object> parseAuditResourceByAction(String action, Map<AuditingFieldsKeysEnum, String> body) throws Exception {
+
+		Map auditingMessage = null;
+		auditingMessage = retrieveAuditMessagesByPattern(action, body, false);
+
+		return auditingMessage;
+
+	}
+
+	// public static List<Map<String, Object>>
+	// parseAuditResourceByActionToList(String action, String body) throws
+	// Exception {
+	//
+	// List<Map<String, Object>> auditList = new ArrayList<Map<String,
+	// Object>>();
+	//
+	//// String auditingMessage = null;
+	//
+	// Map auditingMessage = null;
+	// auditingMessage = retrieveAuditMessagesByPattern(action);
+	//
+	// if (body == null) {
+	//// String pattern = "/_search?q=ACTION:\"" + action + "\"";
+	//// auditingMessage = retrieveAuditMessagesByPattern(action);
+	//// auditingMessage = retrieveAuditMessagesByPattern(pattern);
+	// } else {
+	//// auditingMessage = retrieveAuditMessagesUsingBody(body);
+	// }
+	//
+	// return ResponseParser.getAuditFromMessage(auditingMessage);
+	//
+	// }
+
+	public static List<Map<String, Object>> parseAuditResourceByActionToList(String action,
+			Map<AuditingFieldsKeysEnum, String> body) throws Exception {
+
+		List<Map<String, Object>> auditList = new ArrayList<Map<String, Object>>();
+
+		// String auditingMessage = null;
+
+		Map auditingMessage = null;
+
+		if (body == null || body.isEmpty()) {
+			auditingMessage = retrieveAuditMessagesByPattern(action, null, false);
+			// String pattern = "/_search?q=ACTION:\"" + action + "\"";
+			// auditingMessage = retrieveAuditMessagesByPattern(action);
+			// auditingMessage = retrieveAuditMessagesByPattern(pattern);
+		} else {
+			auditingMessage = retrieveAuditMessagesByPattern(action, body, false);
+			// auditingMessage = retrieveAuditMessagesUsingBody(body);
+		}
+
+		return ResponseParser.getAuditFromMessage(auditingMessage);
+
+	}
+
+	public JSONObject buildElasticQueryStringObject(String defaultField, String queryValue) throws JSONException {
+
+		JSONObject query_string = new JSONObject();
+		JSONObject jSONObject = new JSONObject();
+		jSONObject.put("default_field", defaultField);
+		jSONObject.put("query", queryValue);
+
+		query_string.put("query_string", jSONObject);
+
+		return query_string;
+	}
+
+	public static JSONObject buildElasticQueryBody(List<JSONObject> listObjects) throws JSONException {
+
+		JSONObject query = new JSONObject();
+		JSONObject bool = new JSONObject();
+		JSONObject must = new JSONObject();
+		JSONArray mustA = new JSONArray();
+
+		for (int i = 0; i < listObjects.size(); i++) {
+			JSONObject match = new JSONObject();
+			match.put("match", listObjects.get(i));
+			mustA.put(match);
+
+		}
+
+		must.put("must", mustA);
+		bool.put("bool", must);
+		query.put("query", bool);
+
+		return query;
+	}
+
+	public static String retrieveAuditMessagesUsingBody(String query_string) throws IOException {
+
+		Config config = Utils.getConfig();
+		HttpRequest getAuditingMessage = new HttpRequest();
+		Map<String, String> headersMap = new HashMap<String, String>();
+		String body = query_string;
+
+		String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(), "_search");
+		RestResponse restResponse = getAuditingMessage.httpSendPost(url, body, headersMap);
+
+		return restResponse.getResponse();
+	}
+
+	public static Map<String, String> retrieveAuditMessagesByPattern(String action, Map<AuditingFieldsKeysEnum, String> body, Boolean retryFlag)
+			throws IOException {
+
+		// get cassandra table name by action
+		String esType = AuditingActionEnum.getActionByName(action).getAuditingEsType();
+		Map<String, String> resultsMap = new HashMap<String, String>();
+
+		List<Pair<AuditingFieldsKeysEnum, String>> myFields = new ArrayList<Pair<AuditingFieldsKeysEnum, String>>();
+		Pair<AuditingFieldsKeysEnum, String> myPair = new Pair<AuditingFieldsKeysEnum, String>(
+				AuditingFieldsKeysEnum.AUDIT_ACTION, action);
+		myFields.add(0, myPair);
+		if (body != null && !body.isEmpty()) {
+			for (Map.Entry<AuditingFieldsKeysEnum, String> mapElement : body.entrySet()) {
+				myFields.add(new Pair<AuditingFieldsKeysEnum, String>(mapElement.getKey(), mapElement.getValue()));
+			}
+		}
+
+		List<Row> fetchFromTable = CassandraUtils.fetchFromTable(auditKeySpaceName, esType, myFields);
+		if(retryFlag){
+			if(fetchFromTable.size() == 0){
+				return resultsMap;
+			}
+		}
+//		assertTrue("expected on fetching from data base one record only, actual: " + fetchFromTable.size(), fetchFromTable.size() == 1);
+		
+		
+		
+		
+		Row row =null;
+		
+		if (fetchFromTable.size() > 1){
+			List<Row> fetchFromTable2 = fetchFromTable;
+			fetchFromTable2.sort((p1, p2) -> p1.getTimestamp(1).compareTo(p2.getTimestamp(1)));
+			row = fetchFromTable2.get(fetchFromTable2.size() - 1);
+		}
+		else {row = fetchFromTable.get(0);}
+
+		ColumnDefinitions columnDefinitions = row.getColumnDefinitions();
+
+		for (int i = 0; i < columnDefinitions.size(); i++) {
+			resultsMap.put(columnDefinitions.getName(i), row.getObject(columnDefinitions.getName(i)) == null ? "null"
+					: row.getObject(columnDefinitions.getName(i)).toString());
+		}
+
+		return resultsMap;
+	}
+
+	// public static Map retrieveAuditMessagesByPattern(String pattern) throws
+	// IOException {
+	//
+	//// Config config = Utils.getConfig();
+	//// HttpRequest getAuditingMessage = new HttpRequest();
+	//// String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES,
+	// config.getEsHost(), config.getEsPort(), pattern);
+	//// RestResponse restResponse = getAuditingMessage.httpSendGet(url, null);
+	//
+	//// get cassandra table name by action
+	// String esType =
+	// AuditingActionEnum.getActionByName(pattern).getAuditingEsType();
+	//// AuditingActionEnum actionByName =
+	// AuditingActionEnum.getActionByName(pattern);
+	//
+	//// Map<AuditingFieldsKeysEnum, String> myFields= new
+	// HashMap<AuditingFieldsKeysEnum, String>();
+	//// myFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION , pattern);
+	//
+	// List<Pair<AuditingFieldsKeysEnum, String>> myFields = new
+	// ArrayList<Pair<AuditingFieldsKeysEnum, String>>();
+	// Pair<AuditingFieldsKeysEnum, String> myPair = new
+	// Pair<AuditingFieldsKeysEnum, String>(AuditingFieldsKeysEnum.AUDIT_ACTION
+	// , pattern);
+	// myFields.add(0, myPair);
+	//
+	//
+	// List<Row> fetchFromTable = CassandraUtils.fetchFromTable("sdcaudit",
+	// esType, myFields);
+	// Row row = fetchFromTable.get(0);
+	//
+	//
+	// ColumnDefinitions columnDefinitions = row.getColumnDefinitions();
+	//// String string = row.getString(columnDefinitions.getName(1));
+	//
+	//// String metaData = row.getColumnDefinitions().toString();
+	//// metaData =metaData.replaceAll("\\((.*?)\\)|\\[|\\]|Columns", "");
+	//// List<String> metaDataList = new
+	// ArrayList<String>(Arrays.asList(metaData.split(", ")));
+	//
+	//
+	//
+	// Map<String, String> resultsMap = new HashMap<String, String>();
+	//
+	//
+	// for (int i=0 ; i < columnDefinitions.size() ; i++){
+	// resultsMap.put(columnDefinitions.getName(i) ,
+	// row.getObject(columnDefinitions.getName(i)) == null ? "null" :
+	// row.getObject(columnDefinitions.getName(i)).toString());
+	// }
+	//// for (String string : metaDataList) {
+	//// resultsMap.put(string , row.getString(string));
+	//// }
+	////
+	//
+	//// String dataString = fetchFromTable.toString();
+	//// dataString = dataString.replaceAll("\\[|\\]|Row", "");
+	//// List<String> dataArray = new
+	// ArrayList<String>(Arrays.asList(dataString.split(", ")));
+	////
+	////
+	//// Map<String, String> resultsMap = new HashMap<String, String>();
+	//// for (int i=0 ; i<metaDataList.size() ; i++) {
+	//// resultsMap.put(metaDataList.get(i), dataArray.get(i));
+	//// }
+	////
+	//// return restResponse.getResponse();
+	// return resultsMap;
+	// }
+
+	public static void categoryAuditSuccess(String action, CategoryDefinition categoryDefinition, User user, int status,
+			String resourceType) throws Exception {
+		categoryAuditSuccessInternal(action, categoryDefinition, null, null, user, status, resourceType);
+	}
+
+	public static void categoryAuditFailure(String action, CategoryDefinition categoryDataDefinition, User user,
+			ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
+		categoryAuditFailureInternal(action, categoryDataDefinition, null, null, user, errorMessage, status,
+				resourceType, variables);
+	}
+
+	public static void subCategoryAuditSuccess(String action, CategoryDefinition categoryDefinition,
+			SubCategoryDefinition subCategoryDefinition, User user, int status, String resourceType) throws Exception {
+		categoryAuditSuccessInternal(action, categoryDefinition, subCategoryDefinition, null, user, status,
+				resourceType);
+	}
+
+	public static void groupingAuditSuccess(String action, CategoryDefinition categoryDefinition,
+			SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user, int status,
+			String resourceType) throws Exception {
+		categoryAuditSuccessInternal(action, categoryDefinition, subCategoryDefinition, groupingDefinition, user,
+				status, resourceType);
+	}
+
+	public static void subCategoryAuditFailure(String action, CategoryDefinition categoryDataDefinition,
+			SubCategoryDefinition subCategoryDefinition, User user, ActionStatus errorMessage, int status,
+			String resourceType, Object... variables) throws Exception {
+		categoryAuditFailureInternal(action, categoryDataDefinition, subCategoryDefinition, null, user, errorMessage,
+				status, resourceType, variables);
+	}
+
+	// NEW Benny
+	public static void groupingAuditFailure(String action, CategoryDefinition categoryDefinition,
+			SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user,
+			ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
+		groupingAuditFailureInternal(action, categoryDefinition, subCategoryDefinition, groupingDefinition, user,
+				errorMessage, status, resourceType, variables);
+	}
+
+	private static void groupingAuditFailureInternal(String action, CategoryDefinition categoryDataDefinition,
+			SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user,
+			ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(action);
+		expectedCatrgoryAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDataDefinition.getName());
+		String subCategoryName = (subCategoryDefinition != null ? subCategoryDefinition.getName()
+				: Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(subCategoryName);
+		String groupingName = (groupingDefinition != null ? groupingDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setGroupingName(groupingName);
+		expectedCatrgoryAuditJavaObject.setResourceType(resourceType);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(status));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, action);
+	}
+
+	///
+	private static void categoryAuditSuccessInternal(String action, CategoryDefinition categoryDefinition,
+			SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user, int status,
+			String resourceType) throws Exception {
+		// resourceType = Service/Resource/Product
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(action);
+		expectedCatrgoryAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDefinition.getName());
+		String subCategoryName = (subCategoryDefinition != null ? subCategoryDefinition.getName()
+				: Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(subCategoryName);
+		String groupingName = (groupingDefinition != null ? groupingDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setGroupingName(groupingName);
+		expectedCatrgoryAuditJavaObject.setResourceType(resourceType);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(status));
+		expectedCatrgoryAuditJavaObject.setDesc("OK");
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, action);
+	}
+
+	///////////////////////////
+	///// BENNNNNNNNY
+	public enum UserAuditJsonKeysEnum {
+		ACTION("ACTION"), MODIFIER("MODIFIER"), STATUS("STATUS"), DESC("DESCRIPTION"), USER_AFTER(
+				"USER_AFTER"), USER_BEFORE("USER_BEFORE");
+		private String auditJsonKeyName;
+
+		private UserAuditJsonKeysEnum(String auditJsonKeyName) {
+			this.auditJsonKeyName = auditJsonKeyName;
+		}
+
+		public String getAuditJsonKeyName() {
+			return auditJsonKeyName.toLowerCase();
+		}
+	}
+
+	public static void validateAddUserAudit(ExpectedUserCRUDAudit expectedAddUserAuditJavaObject, String action)
+			throws Exception {
+
+		List<Map<String, Object>> actionToList = getAuditListByAction(expectedAddUserAuditJavaObject.getAction(), 1);
+		Map<String, Object> map = actionToList.get(0);
+		validateField(map, UserAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map, UserAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+				expectedAddUserAuditJavaObject.getModifier());
+		validateField(map, UserAuditJsonKeysEnum.USER_AFTER.getAuditJsonKeyName(),
+				expectedAddUserAuditJavaObject.getUserAfter());
+		validateField(map, UserAuditJsonKeysEnum.USER_BEFORE.getAuditJsonKeyName(),
+				expectedAddUserAuditJavaObject.getUserBefore());
+		validateField(map, UserAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				expectedAddUserAuditJavaObject.getStatus());
+		validateField(map, UserAuditJsonKeysEnum.DESC.getAuditJsonKeyName(), expectedAddUserAuditJavaObject.getDesc());
+
+	}
+
+	private static void categoryAuditFailureInternal(String action, CategoryDefinition categoryDataDefinition,
+			SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user,
+			ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
+		// validate audit
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
+		ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
+		expectedCatrgoryAuditJavaObject.setAction(action);
+		expectedCatrgoryAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		expectedCatrgoryAuditJavaObject.setCategoryName(categoryDataDefinition.getName());
+		String subCategoryName = (subCategoryDefinition != null ? subCategoryDefinition.getName()
+				: Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setSubCategoryName(subCategoryName);
+		String groupingName = (groupingDefinition != null ? groupingDefinition.getName() : Constants.EMPTY_STRING);
+		expectedCatrgoryAuditJavaObject.setGroupingName(groupingName);
+		expectedCatrgoryAuditJavaObject.setResourceType(resourceType);
+		expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(status));
+		expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
+		AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, action);
+	}
+
+	public static void validateGetCategoryHirarchy(ExpectedCategoryAudit expectedCatrgoryAuditJavaObject, String action)
+			throws Exception {
+
+		List<Map<String, Object>> actionToList = getAuditListByAction(expectedCatrgoryAuditJavaObject.getAction(), 1);
+		Map<String, Object> map = actionToList.get(0);
+
+		expectedCatrgoryAuditJavaObject.setModifier(getModifierString(expectedCatrgoryAuditJavaObject.getModifierName(),
+				expectedCatrgoryAuditJavaObject.getModifierUid()));
+		validateField(map, CategoryAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map, CategoryAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getModifier());
+		validateField(map, CategoryAuditJsonKeysEnum.DETAILS.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getDetails());
+		validateField(map, CategoryAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getStatus());
+		validateField(map, CategoryAuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getDesc());
+
+	}
+
+	public static void validateCategoryAudit(ExpectedCategoryAudit expectedCatrgoryAuditJavaObject, String action)
+			throws Exception {
+
+		List<Map<String, Object>> actionToList = getAuditListByAction(expectedCatrgoryAuditJavaObject.getAction(), 1);
+		Map<String, Object> map = actionToList.get(0);
+		validateField(map, CategoryAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map, CategoryAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getModifier());
+		validateField(map, CategoryAuditJsonKeysEnum.CATEGORY_NAME.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getCategoryName());
+		validateField(map, CategoryAuditJsonKeysEnum.SUB_CATEGORY_NAME.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getSubCategoryName());
+		validateField(map, CategoryAuditJsonKeysEnum.GROUPING_NAME.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getGroupingName());
+		validateField(map, CategoryAuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getResourceType());
+		validateField(map, CategoryAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getStatus());
+		validateField(map, CategoryAuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(),
+				expectedCatrgoryAuditJavaObject.getDesc());
+	}
+
+	public static void GetCategoryHierarchyAuditSuccess(String action, String componentType, User user, int status)
+			throws Exception {
+		ExpectedGetUserListAudit expectedGetListOfUsersAuditJavaObject = new ExpectedGetUserListAudit();
+		expectedGetListOfUsersAuditJavaObject.setAction(action);
+		expectedGetListOfUsersAuditJavaObject.setStatus(String.valueOf(status));
+		expectedGetListOfUsersAuditJavaObject.setDesc("OK");
+		expectedGetListOfUsersAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
+		expectedGetListOfUsersAuditJavaObject.setDetails(componentType.toLowerCase());
+		validateAuditGetListOfUsersByRoles(expectedGetListOfUsersAuditJavaObject, action);
+	}
+
+	public static String buildArtifactDataAudit(ArtifactDefinition artifactDefinition) {
+		StringBuilder sb = new StringBuilder();
+		if (artifactDefinition.getTimeout() == null) {
+			artifactDefinition.setTimeout(0);
+		}
+		if (artifactDefinition != null) {
+			sb.append(artifactDefinition.getArtifactGroupType() == null ? null
+					: artifactDefinition.getArtifactGroupType().getType()).append(",").append("'")
+					.append(artifactDefinition.getArtifactLabel()).append("'").append(",")
+					.append(artifactDefinition.getArtifactType()).append(",")
+					.append(artifactDefinition.getArtifactName()).append(",").append(artifactDefinition.getTimeout())
+					.append(",").append(artifactDefinition.getEsId());
+			sb.append(",");
+			if (artifactDefinition.getArtifactVersion() != null) {
+				sb.append(artifactDefinition.getArtifactVersion());
+			} else {
+				sb.append(" ");
+			}
+			sb.append(",");
+			if (artifactDefinition.getArtifactUUID() != null) {
+				sb.append(artifactDefinition.getArtifactUUID());
+			} else {
+				sb.append(" ");
+			}
+		}
+
+		return sb.toString();
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedMissingInformationAuditObject(String Action,
+			String resourceUid, ComponentType resourceType) throws FileNotFoundException {
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceUid);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion("");
+		expectedAudit.setModifierName("");
+		expectedAudit.setModifierUid("");
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState("");
+		expectedAudit.setPrevArtifactUuid("");
+		expectedAudit.setCurrArtifactUuid("");
+		expectedAudit.setArtifactData("");
+		expectedAudit.setStatus("403");
+		expectedAudit.setDesc(buildAuditDescription(
+				new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name()),
+				new ArrayList<String>()));
+		return expectedAudit;
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedComponentNotFoundAuditObject(String Action,
+			String resourceUid, ComponentType resourceType, String artifactUid, User user,
+			ArrayList<String> notFoundComponent) throws FileNotFoundException {
+		String desc = null;
+
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceUid);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion("");
+		expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
+		expectedAudit.setModifierUid(user.getUserId());
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState("");
+		expectedAudit.setPrevArtifactUuid("");
+		expectedAudit.setCurrArtifactUuid(artifactUid);
+		expectedAudit.setArtifactData("");
+		expectedAudit.setStatus("404");
+
+		if (resourceType.getValue() == ComponentType.SERVICE.getValue()) {
+			desc = buildAuditDescription(
+					new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name()),
+					notFoundComponent);
+		} else if (resourceType.getValue() == ComponentType.RESOURCE.getValue())
+			desc = buildAuditDescription(
+					new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name()),
+					notFoundComponent);
+
+		expectedAudit.setDesc(desc);
+		return expectedAudit;
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedArtifactNotFoundAuditObject(String Action, String resourceUid,
+			ComponentType resourceType, String artifactUid, User user, String currState, String currVersion)
+			throws FileNotFoundException {
+		String desc = null;
+
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceUid);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion(currVersion);
+		expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
+		expectedAudit.setModifierUid(user.getUserId());
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState(currState);
+		expectedAudit.setPrevArtifactUuid("");
+		expectedAudit.setCurrArtifactUuid(artifactUid);
+		expectedAudit.setArtifactData("");
+		expectedAudit.setStatus("404");
+
+		desc = buildAuditDescription(
+				new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name()),
+				Arrays.asList(""));
+
+		expectedAudit.setDesc(desc);
+		return expectedAudit;
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedArtifactNotFoundAuditObject(String Action,
+			String resourceName, ComponentType resourceType, String artifactUid, LifecycleStateEnum lifecycle,
+			User user, String currVersion) throws FileNotFoundException {
+		String desc = null;
+
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceName);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion(currVersion);
+		expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
+		expectedAudit.setModifierUid(user.getUserId());
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState(lifecycle.name());
+		expectedAudit.setPrevArtifactUuid("");
+		expectedAudit.setCurrArtifactUuid(artifactUid);
+		expectedAudit.setArtifactData("");
+		expectedAudit.setStatus("404");
+
+		desc = buildAuditDescription(
+				new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name()),
+				new ArrayList<String>());
+
+		expectedAudit.setDesc(desc);
+		return expectedAudit;
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedRestrictedOperationAuditObject(String Action,
+			String resourceNameOrUid, ComponentType resourceType, String artifactUid, User user, String currVersion,
+			String currState) throws FileNotFoundException {
+		String desc = null;
+
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceNameOrUid);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion(currVersion);
+		expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
+		expectedAudit.setModifierUid(user.getUserId());
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState(currState);
+		expectedAudit.setPrevArtifactUuid("");
+		expectedAudit.setCurrArtifactUuid(artifactUid);
+		expectedAudit.setArtifactData("");
+		expectedAudit.setStatus("409");
+
+		desc = buildAuditDescription(
+				new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name()),
+				new ArrayList<String>());
+
+		expectedAudit.setDesc(desc);
+		return expectedAudit;
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedInvalidContentAuditObject(String Action, String resourceName,
+			ComponentType resourceType, String artifactUid, User user, String currVersion, String currState,
+			ArrayList<String> invalidContentList) throws FileNotFoundException {
+		return expectedInvalidContentAuditObject(ActionStatus.INVALID_CONTENT, Action, resourceName, resourceType,
+				artifactUid, user, currVersion, currState, invalidContentList);
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedInvalidContentAuditObject(ActionStatus actionStatus,
+			String Action, String resourceName, ComponentType resourceType, String artifactUid, User user,
+			String currVersion, String currState, ArrayList<String> invalidContentList) throws FileNotFoundException {
+		String desc = null;
+
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceName);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion(currVersion);
+		expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
+		expectedAudit.setModifierUid(user.getUserId());
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState(currState);
+		expectedAudit.setPrevArtifactUuid("");
+		expectedAudit.setCurrArtifactUuid(artifactUid);
+		expectedAudit.setArtifactData("");
+		expectedAudit.setStatus("400");
+
+		desc = buildAuditDescription(new ErrorValidationUtils().parseErrorConfigYaml(actionStatus.name()),
+				invalidContentList);
+
+		expectedAudit.setDesc(desc);
+		return expectedAudit;
+	}
+
+	public static ExpectedResourceAuditJavaObject expectedSuccessAuditObject(String Action, String resourceName,
+			ComponentType resourceType, ArtifactReqDetails artifactReq, User user, String currVersion, String currState,
+			String prevArtifactUuid) throws FileNotFoundException {
+		ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
+		expectedAudit.setAction(Action);
+		expectedAudit.setResourceName(resourceName);
+		expectedAudit.setResourceType(resourceType.getValue());
+		expectedAudit.setPrevVersion("");
+		expectedAudit.setCurrVersion(currVersion);
+		expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
+		expectedAudit.setModifierUid(user.getUserId());
+		expectedAudit.setPrevState("");
+		expectedAudit.setCurrState(currState);
+		expectedAudit.setPrevArtifactUuid(prevArtifactUuid);
+		expectedAudit.setCurrArtifactUuid(artifactReq.getUniqueId());
+		expectedAudit
+				.setArtifactData(buildArtifactDataAudit(ArtifactUtils.convertArtifactReqToDefinition(artifactReq)));
+		expectedAudit.setStatus("200");
+		expectedAudit.setDesc("OK");
+		return expectedAudit;
+	}
+
+	public static JSONObject filterAuditByUuid(String action, String uuid) throws Exception {
+		Map<String, String> actionMap = new HashMap<String, String>();
+		actionMap.put("ACTION", action);
+		JSONObject actionJsonObject = new JSONObject(actionMap);
+		Map<String, String> uuidMap = new HashMap<String, String>();
+		uuidMap.put("SERVICE_INSTANCE_ID", uuid);
+		JSONObject uuidJsonObject = new JSONObject(uuidMap);
+
+		List<JSONObject> filters = new ArrayList<JSONObject>(Arrays.asList(actionJsonObject, uuidJsonObject));
+		JSONObject body = buildElasticQueryBody(filters);
+		return body;
+	}
+
+	public static void validateAudit(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action)
+			throws Exception {
+		List<Map<String, Object>> actionToList = getAuditListByAction(resourceAuditJavaObject.getAction(), 1);
+		Map<String, Object> map2 = actionToList.get(0);
+		validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceName());
+		validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getResourceType());
+		validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getPrevVersion());
+		validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(),
+				resourceAuditJavaObject.getCurrVersion());
+		validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getMODIFIER());
+		validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevState());
+		validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
+		validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
+		validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
+		validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
+	}
+
+	////// service audit validation/////////////////////
+
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ServiceReqDetails serviceReqDetails,
+			String serviceVersion, User sdncUserDetails) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+
+		expectedResourceAuditJavaObject.setAction("Create");
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		String userFirstLastName = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
+		expectedResourceAuditJavaObject.setModifierName(userFirstLastName);
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setResourceName(serviceReqDetails.getName());
+		expectedResourceAuditJavaObject.setResourceType("Service");
+		expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(serviceVersion) - 0.1f));
+		expectedResourceAuditJavaObject.setCurrVersion(serviceVersion);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setComment(null);
+
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ServiceReqDetails serviceReqDetails,
+			String serviceVersion, User sdncUserDetails, ActionStatus errorStatus, List<String> variables)
+			throws FileNotFoundException {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = constructFieldsForAuditValidation(
+				serviceReqDetails, serviceVersion, sdncUserDetails);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorStatus.name());
+
+		expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
+		String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		expectedResourceAuditJavaObject.setDesc(auditDesc);
+
+		return expectedResourceAuditJavaObject;
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java
new file mode 100644
index 0000000..0d49d97
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.FileNotFoundException;
+import java.util.Arrays;
+
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.testng.Assert;
+
+public class BaseValidationUtils {
+
+	public static final int STATUS_CODE_SUCCESS = 200;
+	public static final int STATUS_CODE_CREATED = 201;
+	public static final int STATUS_CODE_DELETE = 204;
+	public static final int STATUS_CODE_NOT_FOUND = 404;
+	public static final int STATUS_CODE_SUCCESS_NO_CONTENT = 204;
+	public static final int STATUS_CODE_SUCCESS_DELETE = 204;
+	public static final int STATUS_CODE_INVALID_CONTENT = 400;
+	public static final int STATUS_CODE_MISSING_DATA = 400;
+	public static final int STATUS_CODE_MISSING_INFORMATION = 403;
+	public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
+	public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
+	public static final int STATUS_CODE_ALREADY_EXISTS = 409;
+
+	// ------
+	protected static Boolean checkErrorCode(RestResponse deleteResponse) {
+		if (deleteResponse.getErrorCode() == STATUS_CODE_SUCCESS
+				|| deleteResponse.getErrorCode() == STATUS_CODE_DELETE) {
+			return true;
+		}
+		return false;
+	}
+
+	// *** STATUS CODE VALIDATION UTIITIES ****
+	public static void checkStatusCode(RestResponse response, String assertMessage, boolean AND, int... statuses) {
+		int statusCode = response.getErrorCode();
+		for (int status : statuses) {
+			if (AND && statusCode != status) {
+				Assert.fail(assertMessage + " status: " + statusCode);
+			} else if (statusCode == status) {
+				return;
+			}
+		}
+		if (!AND) {
+			Assert.fail(assertMessage + " status: " + statusCode);
+		}
+	}
+
+	public static void checkDeleteResponse(RestResponse response) {
+		checkStatusCode(response, "delete request failed", false, STATUS_CODE_DELETE, STATUS_CODE_NOT_FOUND,
+				STATUS_CODE_SUCCESS); // STATUS_CODE_SUCCESS for deActivate user
+	}
+
+	public static void checkCreateResponse(RestResponse response) {
+		checkStatusCode(response, "create request failed", false, STATUS_CODE_CREATED);
+	}
+
+	public static void checkSuccess(RestResponse response) {
+		checkStatusCode(response, "request failed", false, STATUS_CODE_SUCCESS);
+	}
+
+	public static void checkErrorResponse(RestResponse errorResponse, ActionStatus actionStatus,
+			String... expectedVariables) throws FileNotFoundException {
+		// Expected error
+		ErrorInfo expectedError = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		String expectedMessage = expectedError.getMessage();
+
+		// Actual error
+		ResponseFormat responseFormat = ResponseParser.parseToObjectUsingMapper(errorResponse.getResponse(),
+				ResponseFormat.class);
+		String actualMessage = responseFormat.getText();
+		String[] actualVariables = responseFormat.getVariables();
+
+		assertEquals("Unexpected error message", expectedMessage, actualMessage);
+		assertEquals("Unexpected error variables", Arrays.asList(expectedVariables), Arrays.asList(actualVariables));
+	}
+
+	public static void checkErrorMessageResponse(RestResponse errorResponse, ActionStatus actionStatus)
+			throws FileNotFoundException {
+		// Expected error
+		ErrorInfo expectedError = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		String expectedMessage = expectedError.getMessage();
+
+		// Actual error
+		ResponseFormat responseFormat = ResponseParser.parseToObjectUsingMapper(errorResponse.getResponse(),
+				ResponseFormat.class);
+		String actualMessage = responseFormat.getText();
+
+		assertEquals("Unexpected error message", expectedMessage, actualMessage);
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java
new file mode 100644
index 0000000..d63a514
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import org.json.JSONObject;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+
+public class CategoryValidationUtils {
+
+	public static void verifyCategoryExistInGetResponse(RestResponse getAllCategoryRest,
+			CategoryDefinition categoryDefinition) {
+
+		int categoriesNum = CategoryRestUtils.getMatchingCategoriesNum(getAllCategoryRest, categoryDefinition);
+		assertEquals("category " + categoryDefinition.getName() + " not found during get or found more than once", 1,
+				categoriesNum);
+	}
+
+	public static void verifyCategoryNotExistsInGetResponse(RestResponse getAllCategoryRest,
+			CategoryDefinition categoryDefinition) {
+
+		int categoriesNum = CategoryRestUtils.getMatchingCategoriesNum(getAllCategoryRest, categoryDefinition);
+		assertEquals("category " + categoryDefinition.getName() + " should't be found during get", 0, categoriesNum);
+	}
+
+	public static void verifySubCategoryExistInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
+			SubCategoryDefinition expectedSubCategoryDefinition) {
+
+		int subCategoriesNum = CategoryRestUtils.getMatchingSubCategoriesNum(getAllCategoryRest, parentCategoryId,
+				expectedSubCategoryDefinition);
+		assertEquals(
+				"sub-category " + expectedSubCategoryDefinition.getName()
+						+ " not found during get or found more than once for parentId " + parentCategoryId,
+				1, subCategoriesNum);
+	}
+
+	public static void verifyGroupingExistInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
+			String subCategoryId, GroupingDefinition expectedGroupingDefinition) {
+
+		int groupingNum = CategoryRestUtils.getMatchingGroupingNum(getAllCategoryRest, parentCategoryId, subCategoryId,
+				expectedGroupingDefinition);
+		assertEquals(
+				"sub-category " + expectedGroupingDefinition.getName()
+						+ " not found during get or found more than once for parentId " + parentCategoryId,
+				1, groupingNum);
+	}
+
+	public static void verifyGroupingNotExistInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
+			String subCategoryId, GroupingDefinition expectedGroupingDefinition) {
+
+		int groupingNum = CategoryRestUtils.getMatchingGroupingNum(getAllCategoryRest, parentCategoryId, subCategoryId,
+				expectedGroupingDefinition);
+		assertEquals(
+				"sub-category " + expectedGroupingDefinition.getName()
+						+ " not found during get or found more than once for parentId " + parentCategoryId,
+				0, groupingNum);
+	}
+
+	public static void verifySubCategoryNotExistsInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
+			SubCategoryDefinition expectedSubCategoryDefinition) {
+
+		int subCategoriesNum = CategoryRestUtils.getMatchingSubCategoriesNum(getAllCategoryRest, parentCategoryId,
+				expectedSubCategoryDefinition);
+		assertEquals("sub-category " + expectedSubCategoryDefinition.getName()
+				+ " should't be found during get for parentId " + parentCategoryId, 0, subCategoriesNum);
+	}
+
+	/// NEE Benny
+	public static void validateCreateGroupResponse(RestResponse createSubCategoryRest,
+			GroupingDefinition expectedGroupDefinition) throws Exception {
+
+		String response = createSubCategoryRest.getResponse();
+		JSONObject jobject = new JSONObject(response);
+		assertTrue(jobject.get("name").equals(expectedGroupDefinition.getName()));
+		assertTrue(jobject.get("normalizedName").equals(expectedGroupDefinition.getNormalizedName()));
+		// assertNotNull(jobject.get("normalizedName"));
+		assertNotNull(jobject.get("uniqueId"));
+		expectedGroupDefinition.setUniqueId(jobject.get("uniqueId").toString());
+
+	}
+
+	public static void validateCreateSubCategoryResponse(RestResponse createSubCategoryRest,
+			SubCategoryDefinition expectedSubCategoryDefinition) throws Exception {
+
+		String response = createSubCategoryRest.getResponse();
+		JSONObject jobject = new JSONObject(response);
+		assertTrue(jobject.get("name").equals(expectedSubCategoryDefinition.getName()));
+		assertNotNull(jobject.get("normalizedName"));
+		assertNotNull(jobject.get("uniqueId"));
+	}
+
+	public static void validateCreateCategoryResponse(RestResponse createCategoryRest,
+			CategoryDefinition expectedCategoryDefinition) throws Exception {
+		String response = createCategoryRest.getResponse();
+		JSONObject jobject = new JSONObject(response);
+		assertTrue(jobject.get("name").equals(expectedCategoryDefinition.getName()));
+		assertTrue(jobject.get("normalizedName").equals(expectedCategoryDefinition.getNormalizedName()));
+		assertNotNull(jobject.get("uniqueId"));
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java
new file mode 100644
index 0000000..0fe1153
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java
@@ -0,0 +1,488 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
+import org.openecomp.sdc.common.rest.api.RestResponseAsByteArray;
+import org.openecomp.sdc.common.util.ZipUtil;
+
+public class CsarValidationUtils {
+
+	public static String getCsarPayload(String csarName, String fileLocation) throws Exception {
+
+		RestResponseAsByteArray csar = ImportRestUtils.getCsar(csarName, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		assertTrue("Return response code different from 200", csar.getHttpStatusCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		Map<String, byte[]> readZip = null;
+		byte[] data = csar.getResponse();
+		if (data != null && data.length > 0) {
+			readZip = ZipUtil.readZip(data);
+
+		}
+		byte[] artifactsBs = readZip.get(fileLocation);
+		String str = new String(artifactsBs, StandardCharsets.UTF_8);
+		return str;
+
+	}
+	
+	public static String getCsarPayload(File csarName, String fileLocation) throws Exception {
+
+//		RestResponseAsByteArray csar = ImportRestUtils.getCsar(csarName, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+//		assertTrue("Return response code different from 200", csar.getHttpStatusCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
+		Map<String, byte[]> readZip = null;
+		Path path = csarName.toPath();
+		
+		byte[] data = Files.readAllBytes(path);
+		if (data != null && data.length > 0) {
+			readZip = ZipUtil.readZip(data);
+		}
+		byte[] artifactsBs = readZip.get(fileLocation);
+		String str = new String(artifactsBs, StandardCharsets.UTF_8);
+		return str;
+
+	}
+
+	public static void validateCsarVfArtifact(String csarUUID, Resource resource) throws Exception {
+
+		List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(csarUUID);
+		assertTrue(
+				"check group count, expected: " + getGroupCount(listTypeHeatMetaDefinition) + ", actual: "
+						+ resource.getGroups().size(),
+				getGroupCount(listTypeHeatMetaDefinition) == resource.getGroups().size());
+		assertTrue(
+				"check artifact count, expected: " + getArtifactCount(listTypeHeatMetaDefinition, false) + ", actual: "
+						+ resource.getDeploymentArtifacts().size(),
+				getArtifactCount(listTypeHeatMetaDefinition, false) == resource.getDeploymentArtifacts().size());
+
+	}
+	
+	/*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
+
+		String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
+		JSONParser parser = new JSONParser();
+		String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
+		if (csarPayload != null) {
+			Object parse = parser.parse(csarPayload);
+			JSONObject jsonObject = (JSONObject) parse;
+			JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
+			List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
+			listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
+			return listHeatMetaDefenition;
+		}
+		return null;
+
+	}*/
+	
+	/*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(File csarUUID) throws Exception {
+
+		String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
+		JSONParser parser = new JSONParser();
+		String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
+		if (csarPayload != null) {
+			Object parse = parser.parse(csarPayload);
+			JSONObject jsonObject = (JSONObject) parse;
+			JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
+			List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
+			listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
+			return listHeatMetaDefenition;
+		}
+		return null;
+
+	}*/
+	
+	private static Integer getGroupCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
+		int count = 0;
+		for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
+			count = count + typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
+		}
+		return count;
+	}
+	
+	private static Integer getArtifactCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition, Boolean isEnvIncluded) {
+		int count = 0;
+		List<HeatMetaFirstLevelDefinition> uniqeArtifactList = new ArrayList<>();
+
+		for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
+			for (GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition
+					.getGroupHeatMetaDefinition()) {
+				if (isEnvIncluded) {
+					count = count + groupHeatMetaDefinition.getArtifactList().size();
+				} else {
+					for (HeatMetaFirstLevelDefinition fileName : groupHeatMetaDefinition.getArtifactList()) {
+						if (!fileName.getFileName().contains(".env") && !uniqeArtifactList.contains(fileName)) {
+							uniqeArtifactList.add(fileName);
+							count = count + 1;
+						}
+					}
+				}
+			}
+		}
+		return count;
+	}
+	
+	/*protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure, List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
+
+		@SuppressWarnings("unchecked")
+		Set<Object> typeSet = jsonObjectImportStructure.keySet();
+		for (Object type : typeSet) {
+			TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
+			log.debug(type.toString());
+			log.debug("{}", jsonObjectImportStructure.get(type));
+			JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
+			heatMetaDefenition.setTypeName((String) type);
+			List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
+			heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroupFromJsonArray(array, groupHeatMetaDefinitions, true, false));
+			listHeatMetaDefenition.add(heatMetaDefenition);
+		}
+		return listHeatMetaDefenition;
+	}*/
+	
+/*	protected static List<GroupHeatMetaDefinition> fetchArtifactByGroupFromJsonArray(JSONArray array, List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup, Boolean isNested) {
+
+		GroupHeatMetaDefinition groupHeatMetaDefinition;
+
+		if (array != null) {
+			for (int i = 0; i < array.size(); i++) {
+				if (openNewGroup) {
+					groupHeatMetaDefinition = new GroupHeatMetaDefinition();
+					int groupNumber = listGroupHeatMetaDefinition.size() + 1;
+					log.debug("groupName={}", groupNumber);
+					groupHeatMetaDefinition.setGroup(groupNumber);
+					listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
+					PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
+					propertyHeatMetaDefinition.setName("isBase");
+					propertyHeatMetaDefinition.setValue(false);
+					groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
+				}
+				groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
+				JSONObject jsonObject = (JSONObject) array.get(i);
+				fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, jsonObject, isNested);
+			}
+		}
+		return listGroupHeatMetaDefinition;
+	}*/
+	
+	
+	/*public static void fetchArtifactByGroupFromJsonObject(List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, GroupHeatMetaDefinition groupHeatMetaDefinition, JSONObject jsonObject, Boolean isNested) {
+		@SuppressWarnings("unchecked")
+		Set<Object> groupsKey = jsonObject.keySet();
+		for (Object groupKey : groupsKey) {
+			String groupKeyStr = (String) groupKey;
+			if (groupKeyStr.equals("isBase")) {
+				PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
+				propertyHeatMetaDefinition.setName(groupKeyStr);
+				propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
+				if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition().equals(propertyHeatMetaDefinition)) {
+					groupHeatMetaDefinition.getPropertyHeatMetaDefinition().setValue((boolean) jsonObject.get(groupKeyStr));
+				}
+			}
+ 			if (groupKeyStr.equals("fileName")) {
+				String artifactName = (String) jsonObject.get(groupKeyStr);
+				String artifactType = ArtifactTypeEnum.HEAT_ARTIFACT.getType();
+				if(isNested){
+					artifactType = ArtifactTypeEnum.HEAT_NESTED.getType();
+				}
+				if(jsonObject.get("type") != null && isNested == false){
+					artifactType = (String) jsonObject.get("type");
+				}
+				HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifactName, artifactType);
+				List<HeatMetaFirstLevelDefinition> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
+				listArtifactNames.add(heatMetaFirstLevelDefinition);
+				groupHeatMetaDefinition.setArtifactList(listArtifactNames);
+			} else {
+				if((groupKeyStr.equals("env"))){
+					if (jsonObject.get(groupKeyStr) instanceof JSONObject){
+						fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, (JSONObject) jsonObject.get(groupKeyStr), false);
+					}else{
+						assertTrue("Expected object is JSONObject, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONObject"));
+					}
+				}
+				if((groupKeyStr.equals("nested"))){
+					if (jsonObject.get(groupKeyStr) instanceof JSONArray){
+						fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, true);
+					}else{
+						assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
+					}
+					
+				}else if (!(groupKeyStr.equals("isBase") || groupKeyStr.equals("type") || groupKeyStr.equals("env"))) {
+					if (jsonObject.get(groupKeyStr) instanceof JSONArray){
+						fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, false);
+					}else{
+						assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
+					}
+				}
+			}
+		}
+	}*/
+	
+	/*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
+
+		String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
+		JSONParser parser = new JSONParser();
+		String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
+		if (csarPayload != null) {
+			Object parse = parser.parse(csarPayload);
+			JSONObject jsonObject = (JSONObject) parse;
+			JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
+			List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
+			listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
+			return listHeatMetaDefenition;
+		}
+		return null;
+
+	}
+
+	protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure,
+			List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
+
+		@SuppressWarnings("unchecked")
+		Set<Object> typeSet = jsonObjectImportStructure.keySet();
+		for (Object type : typeSet) {
+			TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
+			log.debug(type.toString());
+			log.debug("{}", jsonObjectImportStructure.get(type));
+			JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
+			heatMetaDefenition.setTypeName((String) type);
+			List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
+			heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroup(array, groupHeatMetaDefinitions, true));
+			listHeatMetaDefenition.add(heatMetaDefenition);
+		}
+		return listHeatMetaDefenition;
+	}
+
+	protected static List<GroupHeatMetaDefinition> fetchArtifactByGroup(JSONArray array,
+			List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup) {
+
+		GroupHeatMetaDefinition groupHeatMetaDefinition;
+
+		if (array != null) {
+			for (int i = 0; i < array.size(); i++) {
+				if (openNewGroup) {
+					groupHeatMetaDefinition = new GroupHeatMetaDefinition();
+					int groupNumber = listGroupHeatMetaDefinition.size() + 1;
+					log.debug("groupName={}", groupNumber);
+					groupHeatMetaDefinition.setGroup(groupNumber);
+					listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
+					PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
+					propertyHeatMetaDefinition.setName("isBase");
+					propertyHeatMetaDefinition.setValue(false);
+					groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
+				}
+				groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
+				JSONObject jsonObject = (JSONObject) array.get(i);
+				@SuppressWarnings("unchecked")
+				Set<Object> groupsKey = jsonObject.keySet();
+				for (Object groupKey : groupsKey) {
+					String groupKeyStr = (String) groupKey;
+					if (groupKeyStr.equals("isBase")) {
+						PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
+						propertyHeatMetaDefinition.setName(groupKeyStr);
+						propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
+						if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition()
+								.equals(propertyHeatMetaDefinition)) {
+							groupHeatMetaDefinition.getPropertyHeatMetaDefinition()
+									.setValue((boolean) jsonObject.get(groupKeyStr));
+						}
+					}
+					if (groupKeyStr.equals("fileName") || groupKeyStr.equals("env")) {
+						String artifactName = (String) jsonObject.get(groupKeyStr);
+						List<String> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
+						listArtifactNames.add(artifactName);
+						groupHeatMetaDefinition.setArtifactList(listArtifactNames);
+					} else {
+						if (!groupKeyStr.equals("isBase")) {
+							fetchArtifactByGroup((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition,
+									false);
+						}
+					}
+				}
+			}
+		}
+		return listGroupHeatMetaDefinition;
+	}
+
+	private static Integer getArtifactCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition,
+			Boolean isEnvIncluded) {
+		int count = 0;
+		List<String> uniqeArtifactList = new ArrayList<>();
+
+		for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
+			for (GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition
+					.getGroupHeatMetaDefinition()) {
+				if (isEnvIncluded) {
+					count = count + groupHeatMetaDefinition.getArtifactList().size();
+				} else {
+					for (String fileName : groupHeatMetaDefinition.getArtifactList()) {
+						if (!fileName.contains(".env") && !uniqeArtifactList.contains(fileName)) {
+							uniqeArtifactList.add(fileName);
+							count = count + 1;
+						}
+					}
+				}
+			}
+		}
+		return count;
+	}
+
+	private static Integer getGroupCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
+		int count = 0;
+		for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
+			count = count + typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
+		}
+		return count;
+	}
+
+	private static String groupNameBuilder(Resource resource) {
+		String separator = "::";
+		String module = "module-";
+		String groupName = resource.getSystemName() + separator + module;
+		return groupName;
+	}
+
+	public static void validateCsarVfArtifact(String csarUUID, Resource resource) throws Exception {
+
+		List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = getListTypeHeatMetaDefinition(csarUUID);
+		assertTrue(
+				"check group count, expected: " + getGroupCount(listTypeHeatMetaDefinition) + ", actual: "
+						+ resource.getGroups().size(),
+				getGroupCount(listTypeHeatMetaDefinition) == resource.getGroups().size());
+		assertTrue(
+				"check artifact count, expected: " + getArtifactCount(listTypeHeatMetaDefinition, false) + ", actual: "
+						+ resource.getDeploymentArtifacts().size(),
+				getArtifactCount(listTypeHeatMetaDefinition, false) == resource.getDeploymentArtifacts().size());
+
+	}
+
+	public static void validateToscaDefinitonObjectVsResource(ToscaDefinition toscaDefinition, Resource resource)
+			throws Exception {
+
+		assertTrue(
+				"check resource instance count, expected: " + getResourceInstanceCount(toscaDefinition) + ", actual: "
+						+ resource.getComponentInstances().size(),
+				getResourceInstanceCount(toscaDefinition) == resource.getComponentInstances().size());
+		assertTrue(
+				"check resource instance relation count, expected: " + getResourceInstanceRelationCount(toscaDefinition)
+						+ ", actual: " + resource.getComponentInstancesRelations().size(),
+				getResourceInstanceRelationCount(toscaDefinition) == resource.getComponentInstancesRelations().size());
+
+	}
+
+	public static Integer getResourceInstanceCount(ToscaDefinition toscaDefinition) {
+
+		return toscaDefinition.getTopology_template().getNode_templates().size();
+	}
+
+	public static Integer getResourceInstanceRelationCount(ToscaDefinition toscaDefinition) {
+		int count = 0;
+//		List<ToscaNodeTemplatesTopologyTemplateDefinition> toscaNodeTemplatesTopologyTemplateDefinition = toscaDefinition
+//				.getTopology_template().getToscaNodeTemplatesTopologyTemplateDefinition();
+		Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> toscaNodeTemplatesTopologyTemplateDefinition = toscaDefinition.getTopology_template().getNode_templates();
+		for (int i = 0; i < toscaNodeTemplatesTopologyTemplateDefinition.size(); i++) {
+//			List<ToscaRequirementsNodeTemplatesDefinition> requirements = toscaNodeTemplatesTopologyTemplateDefinition.get(i).getRequirements();
+			
+			for(Entry entry: toscaDefinition.getTopology_template().getNode_templates().entrySet() ){
+				if (entry.getValue().equals("requirements")){
+					
+				}
+			}
+			
+			if (requirements != null) {
+				for (ToscaRequirementsNodeTemplatesDefinition requirement : requirements) {
+					if (requirement.getNode() != null) {
+						count = count + 1;
+					}
+				}
+			}
+		}
+		return count;
+	}
+
+	// not finished yet
+	private static void validateCsarVfgroup(String csarUUID, Resource resource) {
+
+		List<GroupDefinition> groups = resource.getGroups();
+		for (GroupDefinition groupDefinition : groups) {
+			List<String> artifacts = groupDefinition.getArtifacts();
+			assertTrue("group description is null", groupDefinition.getDescription() != null);
+			assertTrue("InvariantUUID is null", groupDefinition.getInvariantUUID() != null);
+			// groupDefinition.getMembers();
+			assertTrue(
+					"name format mismatch, expected: " + groupNameBuilder(resource) + "[0-9], actual: "
+							+ groupDefinition.getName(),
+					groupDefinition.getName().contains(groupNameBuilder(resource)));
+			// groupDefinition.getProperties();
+			// groupDefinition.getPropertyValueCounter();
+			assertTrue(groupDefinition.getType().equals(getGroupType()));
+		}
+
+		String expectedCsarUUID = csarUUID;
+		// String expectedToscaResourceName = "org.openecomp.resource.vf." +
+		// WordUtils.capitalize(resourceDetails.getName().toLowerCase());
+		//
+		// assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID,
+		// resource.getCsarUUID()),
+		// expectedCsarUUID.equals(resource.getCsarUUID()));
+		// assertTrue("toscaResourceName : " +
+		// buildAssertMessage(expectedToscaResourceName,
+		// resource.getToscaResourceName()),
+		// expectedToscaResourceName.equals(resource.getToscaResourceName()));
+		//
+		// RestResponse getResourceResponse =
+		// ResourceRestUtils.getResource(resource.getUniqueId());
+		// Resource getResource =
+		// ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(),
+		// Resource.class);
+		// assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID,
+		// getResource.getCsarUUID()),
+		// expectedCsarUUID.equals(getResource.getCsarUUID()));
+		// assertTrue("toscaResourceName : " +
+		// buildAssertMessage(expectedToscaResourceName,
+		// getResource.getToscaResourceName()),
+		// expectedToscaResourceName.equals(getResource.getToscaResourceName()));
+
+	}
+
+	private static String getGroupType() {
+		return "org.openecomp.groups.VfModule";
+	}
+*/
+
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java
new file mode 100644
index 0000000..46948d8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java
@@ -0,0 +1,86 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.ci.tests.utils.DistributionUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+
+public class DistributionValidationUtils {
+
+	public static Map<String, String> verifyDistributedArtifactDownloadUsingDB(String distributionID, Map<String, String> expectedArtifactsMapOfDistributedService, List<String> distributionStatusEnumList) throws Exception {
+		
+		String action = "DStatus";
+		int timer = 0;
+		int timeWaitPerArtifcat = 3;
+		if(expectedArtifactsMapOfDistributedService.size() != 0){
+			timer = (expectedArtifactsMapOfDistributedService.size()/10*15 + expectedArtifactsMapOfDistributedService.size() * timeWaitPerArtifcat * distributionStatusEnumList.size() + 30) * 1000 ;
+		}
+		for (String distributionStatusList : distributionStatusEnumList){
+			for (Entry<String, String> url : expectedArtifactsMapOfDistributedService.entrySet()){
+				Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		        body.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_ID, distributionID);
+		        body.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, url.getValue());
+		        body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, distributionStatusList);
+		        Map<String, String> actualAuditRecord = new HashMap<String, String>();
+				actualAuditRecord = AuditValidationUtils.retrieveAuditMessagesByPattern(action, body, true);
+				while (timer != 0) {
+					if(actualAuditRecord.size() == 0 ){
+						Thread.sleep(1000);
+						actualAuditRecord = AuditValidationUtils.retrieveAuditMessagesByPattern(action, body, true);
+						timer-=1000;
+						if(timer == 0 && actualAuditRecord.size() == 0){
+							assertNotNull("audit record did not found in DB for artifact url: " + url.getValue(), null);
+						}
+					}else{
+						timer = timer - timeWaitPerArtifcat * 1000;
+						break;
+					}
+					
+				}
+			}
+		}
+		return null;
+	}
+
+	public static void validateDistributedArtifactsByAudit(Service service, List<String> distributionStatusList) throws Exception, IOException, ParseException {
+		String distributionID;
+		AtomicOperationUtils.distributeService(service, true);
+		distributionID = DistributionUtils.getLatestServiceDistributionObject(service).getDistributionID();
+		if(distributionID != null){
+			Map<String, String> expectedArtifactsMapOfDistributedService = DistributionUtils.getArtifactsMapOfDistributedService(service);
+			DistributionValidationUtils.verifyDistributedArtifactDownloadUsingDB(distributionID, expectedArtifactsMapOfDistributedService, distributionStatusList);
+		}
+		else{
+			assertNotNull("distributionID is null", distributionID);
+		}
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java
new file mode 100644
index 0000000..b79e4c6
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java
@@ -0,0 +1,120 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import org.yaml.snakeyaml.Yaml;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ExceptionEnumType;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ErrorValidationUtils {
+	static Logger logger = LoggerFactory.getLogger(ErrorValidationUtils.class.getName());
+
+	public static void checkBodyResponseOnError(String errorType, List<String> variables, String actualResponse)
+			throws FileNotFoundException, JSONException {
+
+		ErrorInfo errorInfo = parseErrorConfigYaml(errorType);
+		JSONObject expectedResponseBody = null;
+		if (errorInfo.getMessageId() != null) {
+			if (errorInfo.getMessageId().contains("SVC")) {
+				expectedResponseBody = restExceptionFormatBuilder(errorInfo.getMessageId(), errorInfo.getMessage(),
+						variables, ExceptionEnumType.SERVICE_EXCEPTION.getValue());
+			} else {
+				expectedResponseBody = restExceptionFormatBuilder(errorInfo.getMessageId(), errorInfo.getMessage(),
+						variables, ExceptionEnumType.POLICY_EXCPTION.getValue());
+			}
+		}
+		actualResponse = actualResponse.replaceAll("\\n", "");
+		logger.debug("actualResponse - {}", actualResponse);
+		logger.debug("expectedResponseBody - {}", expectedResponseBody);
+		assertEquals(expectedResponseBody, new JSONObject(actualResponse));
+	}
+	
+	public static String checkUIResponseOnError(String errorType)
+			throws FileNotFoundException, JSONException {
+
+		ErrorInfo errorInfo = parseErrorConfigYaml(errorType);
+		String messageId = errorInfo.getMessageId();
+		
+		return messageId;
+	}
+
+	public static JSONObject restExceptionFormatBuilder(String messageId, String text, List<String> variables,
+			String type) {
+
+		JSONObject simpleElements = new JSONObject();
+		JSONObject exceptionType = new JSONObject();
+		JSONObject requestError = new JSONObject();
+
+		try {
+			simpleElements.put("messageId", messageId);
+			simpleElements.put("text", text);
+			simpleElements.put("variables", variables);
+			exceptionType.put(type, simpleElements);
+			requestError.put("requestError", exceptionType);
+
+		} catch (JSONException e) {
+			e.printStackTrace();
+		}
+
+		return requestError;
+
+	}
+
+	public static ErrorInfo parseErrorConfigYaml(String error) throws FileNotFoundException {
+		Yaml yaml = new Yaml();
+		ErrorInfo errInfo = null;
+		Config config = Utils.getConfig();
+		String errorConfigurationFile = config.getErrorConfigurationFile();
+		File file = new File(errorConfigurationFile);
+		// File file = new
+		// File("../catalog-be/src/main/resources/config/error-configuration.yaml");
+		InputStream inputStream = new FileInputStream(file);
+		Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream);
+		// System.out.println(map.get("errors"));
+		@SuppressWarnings("unchecked")
+		Map<String, ErrorInfo> errorMap = (Map<String, ErrorInfo>) map.get("errors");
+		@SuppressWarnings("unchecked")
+		Map<String, Object> errorInfo = (Map<String, Object>) errorMap.get(error);
+
+		String message = (String) errorInfo.get("message");
+		String messageId = (String) errorInfo.get("messageId");
+		int code = (Integer) errorInfo.get("code");
+		errInfo = new ErrorInfo(code, message, messageId);
+
+		return errInfo;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
new file mode 100644
index 0000000..ba5114c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
@@ -0,0 +1,239 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.openecomp.sdc.be.model.Product;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.GroupingDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest.ComponentOperationEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+
+public class ProductValidationUtils {
+
+	static Logger logger = Logger.getLogger(ProductValidationUtils.class.getName());
+
+	public static void compareExpectedAndActualProducts(Product expectedProduct, Product actualProduct) {
+		compareExpectedAndActualProducts(expectedProduct, actualProduct, null);
+	}
+
+	public static void compareExpectedAndActualProducts(Product expectedProduct, Product actualProduct,
+			ComponentOperationEnum operation) {
+
+		assertEquals(expectedProduct.getName(), actualProduct.getName());
+		assertEquals(expectedProduct.getFullName(), actualProduct.getFullName());
+		assertEquals(expectedProduct.getDescription(), actualProduct.getDescription());
+
+		List<String> expectedContacts = expectedProduct.getContacts();
+		List<String> actualContacts = actualProduct.getContacts();
+		assertTrue(
+				"Expected contacts:" + Arrays.toString(expectedContacts.toArray()) + ", actual contacts:"
+						+ Arrays.toString(actualContacts.toArray()),
+				expectedContacts.size() == actualContacts.size() && expectedContacts.containsAll(actualContacts)
+						&& actualContacts.containsAll(expectedContacts));
+
+		List<String> expectedTags = expectedProduct.getTags();
+		List<String> actualTags = actualProduct.getTags();
+		assertTrue(
+				"Expected tags:" + Arrays.toString(expectedTags.toArray()) + ", actual tags:"
+						+ Arrays.toString(actualTags.toArray()),
+				expectedTags.size() == actualTags.size() && expectedTags.containsAll(actualTags)
+						&& actualTags.containsAll(expectedTags));
+
+		assertEquals(expectedProduct.getLifecycleState(), actualProduct.getLifecycleState());
+		assertEquals(expectedProduct.getVersion(), actualProduct.getVersion());
+		assertEquals(expectedProduct.isHighestVersion(), actualProduct.isHighestVersion());
+		assertEquals(expectedProduct.getNormalizedName(), actualProduct.getNormalizedName());
+
+		compareCategories(expectedProduct, actualProduct);
+		assertEquals(expectedProduct.getLastUpdaterUserId(), actualProduct.getLastUpdaterUserId());
+		if (operation != null) {
+			assertEquals(expectedProduct.getCreatorUserId(), actualProduct.getCreatorUserId());
+		}
+
+		Long lastUpdateDate = actualProduct.getLastUpdateDate();
+		Long creationDate = actualProduct.getCreationDate();
+		Map<String, String> allVersions = actualProduct.getAllVersions();
+
+		if (operation != null) {
+			if (operation == ComponentOperationEnum.UPDATE_COMPONENT
+					|| operation == ComponentOperationEnum.CHANGE_STATE_CHECKOUT
+					|| operation == ComponentOperationEnum.CHANGE_STATE_CHECKIN
+					|| operation == ComponentOperationEnum.CHANGE_STATE_UNDO_CHECKOUT) {
+				assertTrue("Last update date:" + lastUpdateDate + ", creation date: " + creationDate,
+						lastUpdateDate > 0 && creationDate > 0 && lastUpdateDate > creationDate);
+			} else {
+				assertTrue("Last update date:" + lastUpdateDate + ", creation date: " + creationDate,
+						lastUpdateDate > 0 && lastUpdateDate.equals(creationDate));
+			}
+		}
+
+		// Check UUIDs
+		// If just created, no way to test the UUIDs themselves
+		// If updated, we expect the UUIDs of actual to match the expected
+		String uniqueId = actualProduct.getUniqueId();
+		if (operation == ComponentOperationEnum.CREATE_COMPONENT) {
+			UUID.fromString(uniqueId);
+			UUID.fromString(actualProduct.getUUID());
+			UUID.fromString(actualProduct.getInvariantUUID());
+			assertTrue(allVersions.size() == 1);
+			assertTrue(allVersions.get("0.1").equals(uniqueId));
+		} else {
+			if (operation == ComponentOperationEnum.CHANGE_STATE_CHECKOUT) {
+				assertFalse(expectedProduct.getUniqueId().equals(uniqueId));
+				// Assigning the updated uniqueId to expected so that it can be
+				// passed to further logic
+				expectedProduct.setUniqueId(uniqueId);
+			} else if (operation != null) {
+				assertTrue(expectedProduct.getUniqueId().equals(uniqueId));
+			}
+			assertEquals(expectedProduct.getUUID(), actualProduct.getUUID());
+			assertEquals(expectedProduct.getInvariantUUID(), actualProduct.getInvariantUUID());
+		}
+	}
+
+	private static void compareCategories(Product expectedProduct, Product actualProduct) {
+		List<CategoryDefinition> expectedCategories = expectedProduct.getCategories();
+		List<CategoryDefinition> actualCategories = actualProduct.getCategories();
+		if (expectedCategories != null && actualCategories != null) {
+			int expSize = expectedCategories.size();
+			int actSize = actualCategories.size();
+
+			assertTrue("Expected size:" + expSize + ", actual size:" + actSize, expSize == actSize);
+
+			for (CategoryDefinition actualDefinition : actualCategories) {
+				int lastIndexOfCat = expectedCategories.lastIndexOf(actualDefinition);
+				assertTrue("Actual category " + actualDefinition + " not found in expected.", lastIndexOfCat != -1);
+				CategoryDefinition expectedDefinition = expectedCategories.get(lastIndexOfCat);
+				List<SubCategoryDefinition> actualSubcategories = actualDefinition.getSubcategories();
+				List<SubCategoryDefinition> expectedSubcategories = expectedDefinition.getSubcategories();
+				for (SubCategoryDefinition actualSub : actualSubcategories) {
+					lastIndexOfCat = expectedSubcategories.lastIndexOf(actualSub);
+					assertTrue("Actual subcategory " + actualSub + " not found in expected.", lastIndexOfCat != -1);
+					SubCategoryDefinition expectedSub = expectedSubcategories.get(lastIndexOfCat);
+					List<GroupingDefinition> actualGroupings = actualSub.getGroupings();
+					List<GroupingDefinition> expectedGroupings = expectedSub.getGroupings();
+					for (GroupingDefinition actualGrouping : actualGroupings) {
+						lastIndexOfCat = expectedGroupings.lastIndexOf(actualGrouping);
+						assertTrue("Actual grouping " + actualSub + " not found in expected.", lastIndexOfCat != -1);
+					}
+				}
+			}
+
+			for (CategoryDefinition expectedDefinition : expectedCategories) {
+				int lastIndexOfCat = actualCategories.lastIndexOf(expectedDefinition);
+				assertTrue("Expected category " + expectedDefinition + " not found in actual.", lastIndexOfCat != -1);
+				CategoryDefinition actualDefinition = actualCategories.get(lastIndexOfCat);
+				List<SubCategoryDefinition> actualSubcategories = actualDefinition.getSubcategories();
+				List<SubCategoryDefinition> expectedSubcategories = expectedDefinition.getSubcategories();
+				for (SubCategoryDefinition expectedSub : expectedSubcategories) {
+					lastIndexOfCat = actualSubcategories.lastIndexOf(expectedSub);
+					assertTrue("Expected subcategory " + expectedSub + " not found in actual.", lastIndexOfCat != -1);
+					SubCategoryDefinition actualSub = actualSubcategories.get(lastIndexOfCat);
+					List<GroupingDefinition> actualGroupings = actualSub.getGroupings();
+					List<GroupingDefinition> expectedGroupings = expectedSub.getGroupings();
+					for (GroupingDefinition expectedGrouping : expectedGroupings) {
+						lastIndexOfCat = actualGroupings.lastIndexOf(expectedGrouping);
+						assertTrue("Expected grouping " + expectedGrouping + " not found in actual.",
+								lastIndexOfCat != -1);
+					}
+				}
+			}
+		}
+	}
+
+	public static void verifyProductsNotExistInUserFollowedPage(User user, Product... nonExpectedProducts)
+			throws Exception {
+		String component = "products";
+		Boolean isExist;
+		Product nonExpectedProduct;
+		RestResponse getFollowedPage = ProductRestUtils.getFollowed(user.getUserId());
+		JSONArray followedProductes = getListArrayFromRestResponse(getFollowedPage, component);
+		if (followedProductes != null) { // if any product exist in followed
+											// page
+			for (int i = 0; i < nonExpectedProducts.length; i++) {
+				nonExpectedProduct = nonExpectedProducts[i];
+				isExist = false;
+				for (int k = 0; k < followedProductes.size(); k++) {
+					JSONObject jobject = (JSONObject) followedProductes.get(k);
+					if (jobject.get("uuid").toString().equals(nonExpectedProduct.getUUID())) {
+						isExist = true;
+						k = followedProductes.size();
+					}
+				}
+				assertFalse(isExist);
+			}
+		}
+
+	}
+
+	public static void checkUserFollowedPage(User user, Product... expectedProducts) throws Exception {
+		String component = "products";
+		Boolean isExist;
+		Product expectedProduct;
+		RestResponse getFollowedPage = ProductRestUtils.getFollowed(user.getUserId());
+		JSONArray followedProductes = getListArrayFromRestResponse(getFollowedPage, component);
+		assertTrue("check if any followedProductes received ", followedProductes != null);
+		assertTrue("check if any expectedProducts and followedProductes are the same size",
+				expectedProducts.length == followedProductes.size());
+		for (int i = 0; i < expectedProducts.length; i++) {
+			expectedProduct = expectedProducts[i];
+			isExist = false;
+			for (int k = 0; k < followedProductes.size(); k++) {
+				JSONObject jobject = (JSONObject) followedProductes.get(k);
+				// if(jobject.get("uuid").toString().equals(expectedProduct.getUUID()))
+				if (jobject.get("uniqueId").toString().equals(expectedProduct.getUniqueId())) {
+
+					String productString = jobject.toJSONString();
+					Product actualProduct = ResponseParser.parseToObjectUsingMapper(productString, Product.class);
+					ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct, null);
+					isExist = true;
+					k = followedProductes.size();
+				}
+			}
+			assertTrue(isExist);
+		}
+	}
+
+	private static JSONArray getListArrayFromRestResponse(RestResponse restResponse, String lst) {
+		String json = restResponse.getResponse();
+		JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
+		JSONArray resources = (JSONArray) jsonResp.get(lst);
+		return resources;
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java
new file mode 100644
index 0000000..07f2ef8
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java
@@ -0,0 +1,358 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.InterfaceDefinition;
+import org.openecomp.sdc.be.model.Operation;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.enums.RespJsonKeysEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+
+import com.google.gson.Gson;
+
+public class ResourceValidationUtils {
+
+	public static void validateResourceReqVsResp(ResourceReqDetails resourceDetails,
+			ResourceRespJavaObject resourceRespJavaObject) {
+
+		String expected;
+
+		expected = resourceDetails.getDescription();
+		assertEquals("resource description - ", expected, resourceRespJavaObject.getDescription());
+
+		expected = resourceDetails.getVendorName();
+		assertEquals("resource vendorName - ", expected, resourceRespJavaObject.getVendorName());
+
+		expected = resourceDetails.getVendorRelease();
+		assertEquals("resource vendorReleaseName - ", expected, resourceRespJavaObject.getVendorRelease());
+
+		expected = resourceDetails.getContactId();
+		assertEquals("resource contactId - ", expected, resourceRespJavaObject.getContactId());
+
+	}
+
+	public static void validateResourceReqVsResp(ResourceReqDetails resourceDetails, Resource resourceRespJavaObject) {
+
+		String expected;
+
+		expected = resourceDetails.getDescription();
+		assertEquals("resource description - ", expected, resourceRespJavaObject.getDescription());
+
+		expected = resourceDetails.getVendorName();
+		assertEquals("resource vendorName - ", expected, resourceRespJavaObject.getVendorName());
+
+		expected = resourceDetails.getVendorRelease();
+		assertEquals("resource vendorReleaseName - ", expected, resourceRespJavaObject.getVendorRelease());
+
+		expected = resourceDetails.getContactId();
+		assertEquals("resource contactId - ", expected, resourceRespJavaObject.getContactId());
+
+		// Validating deduplication of tags
+		List<String> expectedTags = resourceDetails.getTags();
+		if (expectedTags != null) {
+			Set<String> hs = new LinkedHashSet<>(expectedTags);
+			expectedTags.clear();
+			expectedTags.addAll(hs);
+			List<String> receivedTags = resourceRespJavaObject.getTags();
+			assertEquals("resource tags - ", expectedTags, receivedTags);
+		}
+
+	}
+
+	public static void validateModelObjects(Resource expected, Resource actual) throws Exception {
+
+		compareElements(expected.getUniqueId(), actual.getUniqueId());
+		compareElements(expected.getName(), actual.getName());
+		compareElements(expected.getVersion(), actual.getVersion());
+		compareElements(expected.getCreatorUserId(), actual.getCreatorUserId());
+		compareElements(expected.getCreatorFullName(), actual.getCreatorFullName());
+		compareElements(expected.getLastUpdaterUserId(), actual.getLastUpdaterUserId());
+		compareElements(expected.getLastUpdaterFullName(), actual.getLastUpdaterFullName());
+		compareElements(expected.getCreatorFullName(), actual.getCreatorFullName());
+		compareElements(expected.getCreationDate(), actual.getCreationDate());
+		compareElements(expected.getLastUpdateDate(), actual.getLastUpdateDate());
+		compareElements(expected.getDescription(), actual.getDescription());
+		compareElements(expected.getIcon(), actual.getIcon());
+		compareElements(expected.getLastUpdateDate(), actual.getLastUpdateDate());
+		// TODO compare tags
+		compareElements(expected.getCategories(), actual.getCategories());
+		compareElements(expected.getLifecycleState(), actual.getLifecycleState());
+		compareElements(expected.getVendorName(), actual.getVendorName());
+		compareElements(expected.getVendorRelease(), actual.getVendorRelease());
+		compareElements(expected.getContactId(), actual.getContactId());
+		compareElements(expected.getUUID(), actual.getUUID());
+		compareElements(expected.getVersion(), actual.getVersion());
+
+	}
+
+	public static void validateResp(RestResponse restResponse, ResourceRespJavaObject resourceRespJavaObject)
+			throws Exception {
+
+		Gson gson = new Gson();
+		String response = restResponse.getResponse();
+
+		validateResp(response, resourceRespJavaObject, gson);
+
+	}
+
+	public static void validateResp(String response, ResourceRespJavaObject resourceRespJavaObject, Gson gson) {
+
+		Map<String, Object> map = new HashMap<String, Object>();
+		map = (Map<String, Object>) gson.fromJson(response, map.getClass());
+
+		// De-duplicating the tags list for comparison
+		List<String> tags = resourceRespJavaObject.getTags();
+		if (tags != null) {
+			Set<String> hs = new LinkedHashSet<>(tags);
+			tags = new ArrayList<String>(hs);
+			resourceRespJavaObject.setTags(tags);
+			tags = new ArrayList<String>(hs);
+			resourceRespJavaObject.setTags(tags);
+		}
+
+		validateField(map, RespJsonKeysEnum.RESOURCE_NAME.getRespJsonKeyName(), resourceRespJavaObject.getName());
+		validateField(map, RespJsonKeysEnum.RESOURCE_DESC.getRespJsonKeyName(),
+				resourceRespJavaObject.getDescription());
+		// validateField(map, RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName(),
+		// resourceRespJavaObject.getCategories());
+		validateField(map, RespJsonKeysEnum.VENDOR_NAME.getRespJsonKeyName(), resourceRespJavaObject.getVendorName());
+		validateField(map, RespJsonKeysEnum.VENDOR_RELEASE.getRespJsonKeyName(),
+				resourceRespJavaObject.getVendorRelease());
+		validateField(map, RespJsonKeysEnum.CONTACT_ID.getRespJsonKeyName(), resourceRespJavaObject.getContactId());
+		validateField(map, RespJsonKeysEnum.ICON.getRespJsonKeyName(), resourceRespJavaObject.getIcon());
+		validateField(map, RespJsonKeysEnum.IS_ABSTRACT.getRespJsonKeyName(),
+				Boolean.valueOf(resourceRespJavaObject.getAbstractt()));
+		validateField(map, RespJsonKeysEnum.HIGHEST_VERSION.getRespJsonKeyName(),
+				Boolean.valueOf(resourceRespJavaObject.getIsHighestVersion()));
+		validateField(map, RespJsonKeysEnum.UNIQUE_ID.getRespJsonKeyName(), resourceRespJavaObject.getUniqueId());
+		validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceRespJavaObject.getVersion());
+		validateField(map, RespJsonKeysEnum.LIFE_CYCLE_STATE.getRespJsonKeyName(),
+				resourceRespJavaObject.getLifecycleState());
+		validateField(map, RespJsonKeysEnum.TAGS.getRespJsonKeyName(), tags);
+		validateField(map, RespJsonKeysEnum.CREATOR_ATT_UID.getRespJsonKeyName(),
+				resourceRespJavaObject.getCreatorUserId());
+		validateField(map, RespJsonKeysEnum.CREATOR_FULL_NAME.getRespJsonKeyName(),
+				resourceRespJavaObject.getCreatorFullName());
+		validateField(map, RespJsonKeysEnum.LAST_UPDATER_ATT_UID.getRespJsonKeyName(),
+				resourceRespJavaObject.getLastUpdaterUserId());
+		validateField(map, RespJsonKeysEnum.LAST_UPDATER_FULL_NAME.getRespJsonKeyName(),
+				resourceRespJavaObject.getLastUpdaterFullName());
+		validateField(map, RespJsonKeysEnum.COST.getRespJsonKeyName(), resourceRespJavaObject.getCost());
+		validateField(map, RespJsonKeysEnum.LICENSE_TYPE.getRespJsonKeyName(), resourceRespJavaObject.getLicenseType());
+		validateField(map, RespJsonKeysEnum.RESOURCE_TYPE.getRespJsonKeyName(),
+				resourceRespJavaObject.getResourceType().toString());
+		if (resourceRespJavaObject.getResourceType().equals("VF")) {
+			validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(), null);
+		} else {
+			validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(),
+					resourceRespJavaObject.getDerivedFrom());
+		}
+
+		validateCategories(resourceRespJavaObject, map);
+
+		String uuid = ResponseParser.getValueFromJsonResponse(response, RespJsonKeysEnum.UUID.getRespJsonKeyName());
+		assertTrue("UUID is empty", uuid != null && !uuid.isEmpty());
+	}
+
+	private static void validateCategories(ResourceRespJavaObject resourceRespJavaObject, Map<String, Object> map) {
+		assertTrue(RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName() + " is missing",
+				map.containsKey(RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName()));
+		Object foundValue = map.get(RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName());
+		List<Map<String, Object>> foundList = (List<Map<String, Object>>) foundValue;
+		List<CategoryDefinition> excpectedList = resourceRespJavaObject.getCategories();
+
+		assertTrue(foundList.size() == excpectedList.size());
+		for (int i = 0; i < foundList.size(); i++) {
+			CategoryDefinition expCat = excpectedList.get(i);
+			Map<String, Object> foun = foundList.get(i);
+			assertTrue("expected " + expCat.getName() + " not equal to actual " + foundValue,
+					foun.get("name").equals(expCat.getName()));
+		}
+	}
+
+	public static void validateField(Map<String, Object> map, String jsonField, Object expectedValue) {
+		if (expectedValue == null) {
+			assertTrue(jsonField + " is expected to be null", !map.containsKey(jsonField));
+		} else {
+			assertTrue(jsonField + " is missing", map.containsKey(jsonField));
+			Object foundValue = map.get(jsonField);
+			compareElements(expectedValue, foundValue);
+		}
+	}
+
+	public static void compareElements(Object expectedValue, Object foundValue) {
+		if (expectedValue instanceof String) {
+			assertTrue(foundValue instanceof String);
+			assertTrue("expected " + expectedValue + " not equal to actual " + foundValue,
+					foundValue.equals(expectedValue));
+		}
+		/*
+		 * else if( expectedValue instanceof Number){ assertTrue(foundValue
+		 * instanceof Number); assertTrue(foundValue == expectedValue); }
+		 */
+		else if (expectedValue instanceof Boolean) {
+			assertTrue(foundValue instanceof Boolean);
+			assertTrue(foundValue == expectedValue);
+		} else if (expectedValue instanceof Map) {
+			assertTrue(foundValue instanceof Map);
+			Map<String, Object> foundMap = (Map<String, Object>) foundValue;
+			Map<String, Object> excpectedMap = (Map<String, Object>) expectedValue;
+			assertTrue(foundMap.size() == excpectedMap.size());
+			Iterator<String> foundkeyItr = foundMap.keySet().iterator();
+			while (foundkeyItr.hasNext()) {
+				String foundKey = foundkeyItr.next();
+				assertTrue(excpectedMap.containsKey(foundKey));
+				compareElements(excpectedMap.get(foundKey), foundMap.get(foundKey));
+			}
+
+		} else if (expectedValue instanceof List) {
+			assertTrue(foundValue instanceof List);
+			List<Object> foundList = (List<Object>) foundValue;
+			List<Object> excpectedList = (List<Object>) expectedValue;
+			assertTrue(foundList.size() == excpectedList.size());
+			for (int i = 0; i < foundList.size(); i++) {
+				compareElements(excpectedList.get(i), foundList.get(i));
+			}
+
+		} else {
+			assertTrue(foundValue.equals(expectedValue));
+		}
+	}
+
+	public static boolean validateUuidAfterChangingStatus(String oldUuid, String newUuid) {
+		return oldUuid.equals(newUuid);
+
+	}
+
+	public static void validateRespArt(RestResponse restResponse, ResourceRespJavaObject resourceRespJavaObject,
+			String interfaze) throws Exception {
+
+		Gson gson = new Gson();
+		String response = restResponse.getResponse();
+
+		Map<String, Object> map = new HashMap<String, Object>();
+		map = (Map<String, Object>) gson.fromJson(response, map.getClass());
+
+		Resource resource = gson.fromJson(response, Resource.class);
+
+		Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
+		Map<String, InterfaceDefinition> interfaces = null;
+
+		if (interfaze != null) {
+			interfaces = resource.getInterfaces();
+			Map<String, Operation> operation = interfaces.get(interfaze).getOperationsMap();
+			// operation.get("configure").getUniqueId();
+		}
+
+		validateField(map, RespJsonKeysEnum.RESOURCE_NAME.getRespJsonKeyName(), resourceRespJavaObject.getName());
+		validateField(map, RespJsonKeysEnum.RESOURCE_DESC.getRespJsonKeyName(),
+				resourceRespJavaObject.getDescription());
+		// validateField(map, RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName(),
+		// resourceRespJavaObject.getCategories());
+		validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(), resourceRespJavaObject.getDerivedFrom());
+		validateField(map, RespJsonKeysEnum.VENDOR_NAME.getRespJsonKeyName(), resourceRespJavaObject.getVendorName());
+		validateField(map, RespJsonKeysEnum.VENDOR_RELEASE.getRespJsonKeyName(),
+				resourceRespJavaObject.getVendorRelease());
+		validateField(map, RespJsonKeysEnum.CONTACT_ID.getRespJsonKeyName(), resourceRespJavaObject.getContactId());
+		validateField(map, RespJsonKeysEnum.ICON.getRespJsonKeyName(), resourceRespJavaObject.getIcon());
+		validateField(map, RespJsonKeysEnum.IS_ABSTRACT.getRespJsonKeyName(),
+				Boolean.valueOf(resourceRespJavaObject.getAbstractt()));
+		validateField(map, RespJsonKeysEnum.HIGHEST_VERSION.getRespJsonKeyName(),
+				Boolean.valueOf(resourceRespJavaObject.getIsHighestVersion()));
+		validateField(map, RespJsonKeysEnum.UNIQUE_ID.getRespJsonKeyName(), resourceRespJavaObject.getUniqueId());
+		validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceRespJavaObject.getVersion());
+		validateField(map, RespJsonKeysEnum.LIFE_CYCLE_STATE.getRespJsonKeyName(),
+				resourceRespJavaObject.getLifecycleState());
+		validateField(map, RespJsonKeysEnum.TAGS.getRespJsonKeyName(), resourceRespJavaObject.getTags());
+		validateField(map, RespJsonKeysEnum.CREATOR_ATT_UID.getRespJsonKeyName(),
+				resourceRespJavaObject.getCreatorUserId());
+		validateField(map, RespJsonKeysEnum.CREATOR_FULL_NAME.getRespJsonKeyName(),
+				resourceRespJavaObject.getCreatorFullName());
+		validateField(map, RespJsonKeysEnum.LAST_UPDATER_ATT_UID.getRespJsonKeyName(),
+				resourceRespJavaObject.getLastUpdaterUserId());
+		validateField(map, RespJsonKeysEnum.LAST_UPDATER_FULL_NAME.getRespJsonKeyName(),
+				resourceRespJavaObject.getLastUpdaterFullName());
+
+		// validate number of artifacts
+		if (resourceRespJavaObject.getArtifacts() != null) {
+
+			// assertEquals("check number of artifacts",
+			// resourceRespJavaObject.getArtifacts().size(), artifacts.size());
+			int iterNum = -1;
+			ArrayList<String> myArtifacats = new ArrayList<String>();
+			Iterator it = artifacts.entrySet().iterator();
+			while (it.hasNext()) {
+				iterNum++;
+				Map.Entry pair = (Map.Entry) it.next();
+				// System.out.println(pair.getKey() + " = " + pair.getValue());
+				ArtifactDefinition myArtifact = artifacts.get(pair.getKey());
+				myArtifacats.add(myArtifact.getEsId());
+				it.remove(); // avoids a ConcurrentModificationException
+			}
+			// assertTrue("check service contains
+			// artifacts",myArtifacats.containsAll(resourceRespJavaObject.getArtifacts()));
+		}
+
+		// validate number of interfaces:
+
+		if (interfaze != null) {
+			assertEquals("check number of interfaces", resourceRespJavaObject.getInterfaces().size(),
+					interfaces.size());
+		}
+
+	}
+
+	public static boolean validateResourceIsAbstartct(List<Resource> resourceList, Boolean bool) {
+		if (resourceList != null && resourceList.size() > 0) {
+			for (Resource resource : resourceList) {
+				if (resource.isAbstract().equals(bool))
+					continue;
+				else
+					return false;
+			}
+		} else
+			return false;
+		return true;
+	}
+
+	public static void validateResourceVersion(Resource resource, String expectedVersion) {
+		if (resource != null && !resource.equals("")) {
+			assertTrue("expected resource version is: " + expectedVersion + ", but actual is: " + resource.getVersion(),
+					resource.getVersion().equals(expectedVersion));
+		}
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java
new file mode 100644
index 0000000..a7c7b7d
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java
@@ -0,0 +1,130 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertEquals;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+
+public class ServiceValidationUtils {
+
+	public static void validateServiceResponseMetaData(ServiceReqDetails serviceDetails, Service service, User user,
+			LifecycleStateEnum lifecycleState) {
+		validateServiceResponseMetaData(serviceDetails, service, user, user, lifecycleState);
+	}
+
+	public static void validateServiceResponseMetaData(ServiceReqDetails expectedService, Service service,
+			User creatorUser, User updaterUser, LifecycleStateEnum lifeCycleState) {
+		List<String> expectedTags = expectedService.getTags();
+		expectedTags.add(expectedService.getName());
+		List<String> receivedTags = service.getTags();
+		if (expectedTags != null) {
+			Set<String> hs = new LinkedHashSet<>(expectedTags);
+			expectedTags.clear();
+			expectedTags.addAll(hs);
+		}
+
+		assertEquals("Check service name on response after create service", expectedService.getName(),
+				service.getName());
+		// check size of list
+		assertEquals("Check only 1 category returned on response after create service", 1,
+				expectedService.getCategories().size());
+		assertEquals("Check service name on response after create service", expectedService.getName(),
+				service.getName());
+		assertEquals("Check categories on response after create service",
+				expectedService.getCategories().get(0).getName(), service.getCategories().get(0).getName());
+		assertEquals("Check tag list on response after create service", expectedTags, receivedTags);
+		assertEquals("Check description on response after create service", expectedService.getDescription(),
+				service.getDescription());
+		// assertEquals("Check vendor name on response after create service",
+		// expectedService.getVendorName(), service.getVendorName());
+		// assertEquals("Check vendor release on response after create service",
+		// expectedService.getVendorRelease(), service.getVendorRelease());
+		assertEquals("Check attContant name on response after create service",
+				expectedService.getContactId().toLowerCase(), service.getContactId());
+		assertEquals("Check icon name on response after create service", expectedService.getIcon(), service.getIcon());
+		assertEquals("Check LastUpdaterUserId after create service", updaterUser.getUserId(),
+				service.getLastUpdaterUserId());
+		assertEquals("Check LastUpdaterName after create service",
+				updaterUser.getFirstName() + " " + updaterUser.getLastName(), service.getLastUpdaterFullName());
+		assertEquals("Check CreatorUserId after create service", creatorUser.getUserId(), service.getCreatorUserId());
+		assertEquals("Check CreatorName after create service",
+				creatorUser.getFirstName() + " " + creatorUser.getLastName(), service.getCreatorFullName());
+		assertEquals("Check version after create service", expectedService.getVersion(), service.getVersion());
+		// assertEquals("Check UniqueId after create service", SERVICE_PREFIX +
+		// serviceDetails.getServiceName().toLowerCase()+"." +
+		// serviceBaseVersion, service.getUniqueId());
+		assertFalse("Check uuid after create service", service.getUUID().isEmpty());
+
+		// assertTrue("check creation date after create service",
+		// service.getCreationDate() != null);
+		// assertTrue("check update date after create service",
+		// service.getLastUpdateDate() != null);
+
+		if (lifeCycleState != null)
+			assertEquals("Check LifecycleState after create service", lifeCycleState, service.getLifecycleState());
+		else
+			assertEquals("Check LifecycleState after create service", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
+					service.getLifecycleState());
+	}
+
+	public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ServiceReqDetails serviceReqDetails,
+			String serviceVersion, User sdncUserDetails) {
+
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+
+		expectedResourceAuditJavaObject.setAction("Create");
+		expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
+		String userFirstLastName = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
+		expectedResourceAuditJavaObject.setModifierName(userFirstLastName);
+		expectedResourceAuditJavaObject.setStatus("200");
+		expectedResourceAuditJavaObject.setDesc("OK");
+		expectedResourceAuditJavaObject.setResourceName(serviceReqDetails.getName());
+		expectedResourceAuditJavaObject.setResourceType("Service");
+		expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(serviceVersion) - 0.1f));
+		expectedResourceAuditJavaObject.setCurrVersion(serviceVersion);
+		expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
+		expectedResourceAuditJavaObject.setComment(null);
+
+		return expectedResourceAuditJavaObject;
+
+	}
+
+	public static void validateDistrubtionStatusValue(RestResponse response,
+			DistributionStatusEnum expectedDistributionValue) throws Exception {
+		String actualDistributionValue = ResponseParser.getValueFromJsonResponse(response.getResponse(),
+				"distributionStatus");
+		assertEquals(expectedDistributionValue.name(), actualDistributionValue);
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java
new file mode 100644
index 0000000..1fa20c1
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java
@@ -0,0 +1,279 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.utils.validation;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.sdc.be.dao.utils.UserStatusEnum;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.users.AddUserAuditMessageInfo;
+import org.openecomp.sdc.ci.tests.users.UserAuditJavaObject;
+import org.openecomp.sdc.ci.tests.utils.DbUtils;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+public class UserValidationUtils {
+	public static void compareExpectedAndActualUsers(User expected, User actual) {
+
+		String actualFirstName = actual.getFirstName();
+		String expectedFirstName = expected.getFirstName();
+		assertEquals("check user first name - ", expectedFirstName, actualFirstName);
+
+		String actualLastName = actual.getLastName();
+		String expectedLastName = expected.getLastName();
+		assertEquals("check user last name - ", expectedLastName, actualLastName);
+
+		String actualUserId = actual.getUserId();
+		String expectedUserId = expected.getUserId();
+		assertEquals("check user userId - ", expectedUserId, actualUserId);
+
+		String actualEmail = actual.getEmail();
+		String expectedEmail = expected.getEmail();
+		assertEquals("check user email - ", expectedEmail, actualEmail);
+
+		Long actualLastLoginTime = actual.getLastLoginTime();
+		Long expectedLastLoginTime = expected.getLastLoginTime();
+		assertEquals("check user last login time - ", expectedLastLoginTime, actualLastLoginTime);
+
+		String actualRole = actual.getRole();
+		if (expected.getRole() == null) {
+			String expectedRole = UserRoleEnum.DESIGNER.name();
+			assertEquals("check user role - ", expectedRole, actualRole);
+		} else {
+			String expectedRole = expected.getRole();
+			assertEquals("check user role - ", expectedRole, actualRole);
+		}
+
+		UserStatusEnum actualStatus = expected.getStatus();
+		UserStatusEnum expectedStatus = expected.getStatus();
+		assertEquals("check user status - ", expectedStatus, actualStatus);
+	}
+
+	public static void validateDeleteUserAuditMessage(User sdncUserDetails, User sdncModifierDetails,
+			String responseCode, String responseMessage, AddUserAuditMessageInfo addUserAuditMessageInfo) {
+		String action = "DeleteUser";
+		validateUserAuditMessage(sdncUserDetails, sdncModifierDetails, responseCode, responseMessage,
+				addUserAuditMessageInfo, action);
+
+	}
+
+	private static void validateUserAuditMessage(User sdncUserDetails, User sdncModifierDetails, String responseCode,
+			String responseMessage, AddUserAuditMessageInfo addUserAuditMessageInfo, String expectedAction) {
+
+		assertEquals("check audit action - ", expectedAction, addUserAuditMessageInfo.getACTION());
+
+		// String expectedModifierFirstLastName =
+		// sdncModifierDetails.getFirstName() + " " +
+		// sdncModifierDetails.getLastName();
+		// assertEquals("check audit modifier name - ",
+		// expectedModifierFirstLastName,
+		// addUserAuditMessageInfo.getMODIFIER_NAME());
+		String fullName = sdncModifierDetails.getFullName();
+		if (sdncModifierDetails.getFullName().equals(" ")) {
+			fullName = "";
+		}
+		String expectedModifierId = fullName + "(" + sdncModifierDetails.getUserId() + ")";
+		assertEquals("check audit modifier uid - ", expectedModifierId, addUserAuditMessageInfo.getMODIFIER());
+
+		String expectedUserFirstLastName = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
+		if (expectedUserFirstLastName.equals("null null")) {
+			expectedUserFirstLastName = "";
+		}
+
+		String email = (sdncUserDetails.getEmail() == null) ? "" : sdncUserDetails.getEmail();
+		String role = (sdncUserDetails.getRole() == null) ? "DESIGNER" : sdncUserDetails.getRole();
+
+		String formatedUser = String.format("%s,%s,%s,%s", sdncUserDetails.getUserId(), expectedUserFirstLastName,
+				email, role);
+
+		//
+		// String expectedUserFirstLastName = sdncUserDetails.getFirstName() + "
+		// " + sdncUserDetails.getLastName();
+		// if (expectedUserFirstLastName.equals("null null")) {
+		// expectedUserFirstLastName = "";
+		// }
+		//
+		// String expectedUserFirstLastName = "";
+		// expectedUserFirstLastName += sdncUserDetails.getFirstName() == null ?
+		// "" : sdncUserDetails.getFirstName();
+		// String lastName = sdncUserDetails.getLastName() == null ? "" :
+		// sdncUserDetails.getLastName();
+		// if (expectedUserFirstLastName.isEmpty()) {
+		// expectedUserFirstLastName = lastName;
+		// } else {
+		// expectedUserFirstLastName += " " + lastName;
+		// }
+
+		assertEquals("check audit user name - ", formatedUser, addUserAuditMessageInfo.getUSER());
+
+		// String expectedUserUid = sdncUserDetails.getUserId();
+		// assertEquals("check audit user uid - ", expectedUserUid,
+		// addUserAuditMessageInfo.getUSER_UID());
+		//
+		// String expectedUserEmail = sdncUserDetails.getEmail() == null ? "" :
+		// sdncUserDetails.getEmail();
+		// //TODO: esofer check with Andrey. Audit return "" but in user we have
+		// null
+		// assertEquals("check audit user email - ", expectedUserEmail,
+		// addUserAuditMessageInfo.getUSER_EMAIL());
+		//
+		// String expectedUserRole = sdncUserDetails.getRole();
+		// if (expectedUserRole ==null){
+		// expectedUserRole = "DESIGNER";
+		// assertEquals("check audit user role - ", expectedUserRole,
+		// addUserAuditMessageInfo.getUSER_ROLE());
+		// }else{
+		// assertEquals("check audit user role - ", expectedUserRole,
+		// addUserAuditMessageInfo.getUSER_ROLE());
+		// }
+
+		String expectedUserResponseCode = responseCode;
+		assertEquals("check audit user response code - ", expectedUserResponseCode,
+				addUserAuditMessageInfo.getSTATUS());
+
+		String expectedUserResponseMessage = responseMessage;
+		assertEquals("check audit user response message - ", expectedUserResponseMessage,
+				addUserAuditMessageInfo.getDESC());
+
+	}
+
+	public static void validateDataAgainstAuditDB_access(User sdncUserDetails, UserAuditJavaObject auditJavaObject,
+			RestResponse restResponse, ErrorInfo errorInfo, List<String> variables) {
+
+		validateAuditDataAgainstAuditDbInAccess(sdncUserDetails, auditJavaObject, restResponse, errorInfo, variables);
+
+	}
+
+	public static void validateAuditDataAgainstAuditDbInAccess(User sdncUserDetails,
+			UserAuditJavaObject auditJavaObject, RestResponse restResponse, ErrorInfo errorInfo,
+			List<String> variables) {
+
+		String expected;
+
+		expected = "Access";
+		assertEquals("ACTION- ", expected, auditJavaObject.getACTION());
+
+		if (sdncUserDetails.getFirstName() != StringUtils.EMPTY && sdncUserDetails.getLastName() != StringUtils.EMPTY) {
+			expected = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
+		} else {
+			expected = StringUtils.EMPTY;
+		}
+		String formatedUser = String.format("%s(%s)", expected, sdncUserDetails.getUserId());
+		assertTrue(
+				"check audit user: expected start with - " + formatedUser + " ,actual - " + auditJavaObject.getUSER(),
+				auditJavaObject.getUSER().startsWith(formatedUser));
+
+		expected = restResponse.getErrorCode().toString();
+		assertEquals("check audit user status code - ", expected, auditJavaObject.getSTATUS());
+
+		if (restResponse.getErrorCode() == 200 || restResponse.getErrorCode() == 201) {
+			expected = errorInfo.getMessage();
+		} else {
+			expected = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
+		}
+
+		assertEquals("check audit user desc - ", expected, auditJavaObject.getDESC());
+
+		// expected = sdncUserDetails.getUserId();
+		// assertEquals(expected, auditJavaObject.getUSER());
+
+	}
+
+	public static void validateUserDetailsOnResponse(User sdncUserDetails, String userDetailsOnResponse) {
+
+		String actualFirstName = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "firstName");
+		String expectedFirstName = sdncUserDetails.getFirstName();
+		assertEquals("check user first name - ", expectedFirstName, actualFirstName);
+
+		String actualLastName = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "lastName");
+		String expectedLastName = sdncUserDetails.getLastName();
+		assertEquals("check user last name - ", expectedLastName, actualLastName);
+
+		String actualUserId = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "userId");
+		String expectedUserId = sdncUserDetails.getUserId();
+		assertEquals("check user userId - ", expectedUserId, actualUserId);
+
+		String actualEmail = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "email");
+		String expectedEmail = sdncUserDetails.getEmail();
+		assertEquals("check user email - ", expectedEmail, actualEmail);
+
+		String actualRole = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "role");
+		if (sdncUserDetails.getRole() == null) {
+			String expectedRole = UserRoleEnum.DESIGNER.name();
+			assertEquals("check user role - ", expectedRole, actualRole);
+		} else {
+			String expectedRole = sdncUserDetails.getRole();
+			assertEquals("check user role - ", expectedRole, actualRole);
+		}
+
+		String actualStatus = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "status");
+		String expectedStatus = sdncUserDetails.getStatus().name();
+		assertEquals("check user status - ", expectedStatus, actualStatus);
+
+	}
+
+	public static AddUserAuditMessageInfo getAddUserAuditMessage(String action) throws Exception {
+
+		Gson gson = new Gson();
+		String index = "auditingevents*";
+		String type = "useradminevent";
+		String pattern = "/_search?q=ACTION:\"" + action + "\"";
+		String auditingMessage = DbUtils.retrieveAuditMessagesByPattern(pattern);
+		// String auditingMessage = retrieveAuditMessageByIndexType(index, type,
+		// pattern);
+		JsonElement jElement = new JsonParser().parse(auditingMessage);
+		JsonObject jObject = jElement.getAsJsonObject();
+		JsonObject hitsObject = (JsonObject) jObject.get("hits");
+		JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
+		// for (int i = 0; i < hitsArray.size();){
+		if (hitsArray != null) {
+			JsonObject jHitObject = (JsonObject) hitsArray.get(0);
+			JsonObject jSourceObject = (JsonObject) jHitObject.get("_source");
+			AddUserAuditMessageInfo addUserAuditMessageInfo = new AddUserAuditMessageInfo();
+			addUserAuditMessageInfo = gson.fromJson(jSourceObject, AddUserAuditMessageInfo.class);
+			return addUserAuditMessageInfo;
+		}
+		return null;
+
+	}
+
+	public static void validateAddUserAuditMessage(User sdncUserDetails, User sdncModifierDetails, String responseCode,
+			String responseMessage, AddUserAuditMessageInfo addUserAuditMessageInfo) {
+
+		String action = "AddUser";
+		validateUserAuditMessage(sdncUserDetails, sdncModifierDetails, responseCode, responseMessage,
+				addUserAuditMessageInfo, action);
+
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/webSealAccess/NeoJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/webSealAccess/NeoJavaObject.java
new file mode 100644
index 0000000..0c19627
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/webSealAccess/NeoJavaObject.java
@@ -0,0 +1,111 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.ci.tests.webSealAccess;
+
+public class NeoJavaObject {
+
+	String userId;
+	String firstName;
+	String lastName;
+	String email;
+	String role;
+	String label;
+	String elementType;
+
+	public NeoJavaObject(String userId, String firstName, String lastName, String email, String role, String label,
+			String elementType) {
+		super();
+		this.userId = userId;
+		this.firstName = firstName;
+		this.lastName = lastName;
+		this.email = email;
+		this.role = role;
+		this.label = label;
+		this.elementType = elementType;
+	}
+
+	public NeoJavaObject() {
+		super();
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+	public String getEmail() {
+		return email;
+	}
+
+	public void setEmail(String email) {
+		this.email = email;
+	}
+
+	public String getRole() {
+		return role;
+	}
+
+	public void setRole(String role) {
+		this.role = role;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public String getElementType() {
+		return elementType;
+	}
+
+	public void setElementType(String elementType) {
+		this.elementType = elementType;
+	}
+
+	@Override
+	public String toString() {
+		return "QueryUserNeo4jInfo [userId=" + userId + ", firstName=" + firstName + ", lastName=" + lastName
+				+ ", email=" + email + ", role=" + role + ", label=" + label + ", elementType=" + elementType + "]";
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java
new file mode 100644
index 0000000..5ac70bf
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java
@@ -0,0 +1,1146 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static java.util.Arrays.asList;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.json.simple.parser.JSONParser;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceDetailedAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.SearchCriteriaEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtilsExternalAPI;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.SkipException;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
+public class AssetLifeCycle extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
+	protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
+	protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+	protected static User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+
+	protected Gson gson = new Gson();
+	protected JSONParser jsonParser = new JSONParser();
+
+
+	protected String serviceVersion;
+	protected ResourceReqDetails resourceDetails;
+	protected User sdncUserDetails;
+	protected ServiceReqDetails serviceDetails;
+	
+	public static final int STATUS_CODE_SUCCESS = 200;
+	public static final int STATUS_CODE_CREATED = 201;
+	public static final int STATUS_CODE_DELETE = 204;
+	public static final int STATUS_CODE_NOT_FOUND = 404;
+	public static final int STATUS_CODE_SUCCESS_NO_CONTENT = 204;
+	public static final int STATUS_CODE_SUCCESS_DELETE = 204;
+	public static final int STATUS_CODE_INVALID_CONTENT = 400;
+	public static final int STATUS_CODE_MISSING_DATA = 400;
+	public static final int STATUS_CODE_MISSING_INFORMATION = 403;
+	public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
+	public static final int STATUS_CODE_ALREADY_EXISTS = 409;
+	public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
+	public static final int STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT = 400;
+	public static final int STATUS_CODE_MISSING_COMPONENT_NAME = 400;
+	public static final int STATUS_CODE_UNSUPPORTED_ERROR = 400;
+	public static final int STATUS_CODE_IMPORT_SUCCESS = 201;
+	public static final int STATUS_CODE_UPDATE_SUCCESS = 200;
+	public static final int RESTRICTED_OPERATION = 409;
+	public static final int STATUS_CODE_GET_SUCCESS = 200;
+	public static final int COMPONENT_IN_CHECKOUT_STATE = 403;
+	public static final int COMPONENT_ALREADY_CHECKED_IN = 409;
+	public static final int COMPONENT_NOT_READY_FOR_CERTIFICATION = 403;
+	public static final int COMPONENT_SENT_FOR_CERTIFICATION = 403;
+	public static final int COMPONENT_IN_CERT_IN_PROGRESS_STATE = 403;
+	public static final int COMPONENT_ALREADY_CERTIFIED = 403; 
+	
+	
+	
+	@Rule 
+	public static TestName name = new TestName();
+
+	public AssetLifeCycle() {
+		super(name, AssetLifeCycle.class.getName());
+
+	}
+	
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test
+	public void createResourceCheckInThenCheckOut() throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VF.toString());
+		
+		RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
+		defaultResource.setVersion(String.format("%.1f",0.1));
+		ResourceAssetStructure parsedCreatedResponse = gson.fromJson(restResponse.getResponse(), ResourceAssetStructure.class);
+		
+		restResponse = LifecycleRestUtils.checkInResource(parsedCreatedResponse.getUuid(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check in.");
+		
+		Component resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, defaultResource.getName(), defaultResource.getVersion());
+		Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKIN.getComponentState().toString(), "Life cycle state not changed.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.RESOURCES);	
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	
+		restResponse = LifecycleRestUtils.checkOutResource(parsedCreatedResponse.getUuid(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check out.");
+		
+		resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, defaultResource.getName(), String.format("%.1f", Double.parseDouble(defaultResource.getVersion()) + 0.1));
+		Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKOUT.getComponentState().toString(), "Life cycle state not changed.");
+		
+		// auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setCurrVersion("0.2");
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test
+	public void createServiceCheckInThenCheckOut() throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		
+		Component resourceDetails = null;
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check in.");
+		
+		resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceDetails.getName(), resourceDetails.getVersion());
+		Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKIN.getComponentState().toString(), "Life cycle state not changed.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.SERVICES);	
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	
+		restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check out.");
+		
+		resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceDetails.getName(), String.format("%.1f", Double.parseDouble(resourceDetails.getVersion()) + 0.1));
+		Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKOUT.getComponentState().toString(), "Life cycle state not changed.");
+		
+		// auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setCurrVersion("0.2");
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	@DataProvider(name="invalidAssetUUID") 
+	public static Object[][] dataProviderInvalidAssetUUID() {
+		return new Object[][] {
+			{AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKIN},
+			{AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKIN},
+			
+			{AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKOUT},
+			{AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKOUT},
+			
+			{AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CERTIFICATIONREQUEST},
+			{AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CERTIFICATIONREQUEST},
+			
+			{AssetTypeEnum.SERVICES, LifeCycleStatesEnum.STARTCERTIFICATION},
+			{AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.STARTCERTIFICATION},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidAssetUUID")
+	public void invalidAssetUUID(AssetTypeEnum assetTypeEnum, LifeCycleStatesEnum lifeCycleStatesEnum) throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		String assetUUID = "InvalidAssetUUID";
+		ErrorInfo errorInfo = null;
+		
+		RestResponse restResponse = null;
+		if(assetTypeEnum.equals(AssetTypeEnum.SERVICES)) {
+			
+			if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKIN)) {
+				restResponse = LifecycleRestUtils.checkInService(assetUUID, defaultUser);
+			} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKOUT)) {
+				restResponse = LifecycleRestUtils.checkOutService(assetUUID, defaultUser);
+			} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFICATIONREQUEST)) {
+				restResponse = LifecycleRestUtils.certificationRequestService(assetUUID, defaultUser);
+			} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.STARTCERTIFICATION)) {
+				restResponse = LifecycleRestUtils.startTestingService(assetUUID, defaultUser);
+			}
+				
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name());
+		} else {
+			
+			if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKIN)) {
+				restResponse = LifecycleRestUtils.checkInResource(assetUUID, defaultUser);
+			} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKOUT)) {
+				restResponse = LifecycleRestUtils.checkOutResource(assetUUID, defaultUser);
+			} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFICATIONREQUEST)) {
+				restResponse = LifecycleRestUtils.certificationRequestResource(assetUUID, defaultUser);
+			} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.STARTCERTIFICATION)) {
+				restResponse = LifecycleRestUtils.startTestingResource(assetUUID, defaultUser);
+			}
+			
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
+			
+		}
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_NOT_FOUND, "Asset found.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", assetTypeEnum.getValue().toLowerCase(), assetUUID, lifeCycleStatesEnum.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultInvalidChangeAssetLifeCycleExternalAPI(assetUUID, defaultUser, lifeCycleStatesEnum, assetTypeEnum);	
+		
+		List<String> variables = asList(assetUUID);
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	@DataProvider(name="invalidUserCheckinForCheckedOutService") 
+	public static Object[][] dataProviderInvalidUserCheckinForCheckedOutService() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckinForCheckedOutService")
+	public void invalidUserCheckinForCheckedOutService(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckinForCheckedInService") 
+	public static Object[][] dataProviderInvalidUserCheckinForCheckedInService() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckinForCheckedInService")
+	public void invalidUserCheckinForCheckedInService(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckoutForCheckedOutService") 
+	public static Object[][] dataProviderInvalidUserCheckoutForCheckedOutService() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckoutForCheckedOutService")
+	public void invalidUserCheckoutForCheckedOutService(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckoutForCheckedInService") 
+	public static Object[][] dataProviderInvalidUserCheckoutForCheckedInService() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckoutForCheckedInService")
+	public void invalidUserCheckoutForCheckedInService(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckinForCheckedOutResource") 
+	public static Object[][] dataProviderInvalidUserCheckinForCheckedOutResource() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckinForCheckedOutResource")
+	public void invalidUserCheckinForCheckedOutResource(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckinForCheckedInResource") 
+	public static Object[][] dataProviderInvalidUserCheckinForCheckedInResource() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckinForCheckedInResource")
+	public void invalidUserCheckinForCheckedInResource(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckoutForCheckedOutResource") 
+	public static Object[][] dataProviderInvalidUserCheckoutForCheckedOutResource() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckoutForCheckedOutResource")
+	public void invalidUserCheckoutForCheckedOutResource(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkOutResource(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	@DataProvider(name="invalidUserCheckoutForCheckedInResource") 
+	public static Object[][] dataProviderInvalidUserCheckoutForCheckedInResource() {
+		return new Object[][] {
+			{ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			// TODO: remove comment after talk with renana if it is defect or not
+//			{ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
+			{ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},
+			};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidUserCheckoutForCheckedInResource")
+	public void invalidUserCheckoutForCheckedInResource(User defaultUser) throws Exception {
+		Component resourceDetails = null;
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		resourceDetails = createdComponent.left().value();
+		resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		
+		RestResponse restResponse = LifecycleRestUtils.checkOutResource(resourceDetails.getUUID(), defaultUser);
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)RESTRICTED_OPERATION, "Expected for restricted operation.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setStatus("409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList("");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	
+	
+	
+	@DataProvider(name="invalidStatesForService") 
+	public static Object[][] dataProviderInvalidStatesForService() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CHECKED_IN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "409", ActionStatus.COMPONENT_ALREADY_CHECKED_IN, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			{LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			{LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			
+			{LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CHECKOUT_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_IN_CHECKOUT_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			{LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			{LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_SENT_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, "403", ActionStatus.COMPONENT_SENT_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, LifeCycleStatesEnum.CERTIFY, RESTRICTED_OPERATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, "409", ActionStatus.RESTRICTED_OPERATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CHECKIN, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+		};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidStatesForService")
+	public void invalidStatesForService(LifeCycleStatesEnum initState, LifeCycleStatesEnum targetState, int errorCode,
+			LifecycleStateEnum preState, LifecycleStateEnum currState, String status,
+			ActionStatus actionStatus, User user, User operationUser) throws Exception {
+		
+		if(initState.equals(LifeCycleStatesEnum.STARTCERTIFICATION) && targetState.equals(LifeCycleStatesEnum.CHECKIN)){
+			throw new SkipException("Open bug DE270217");			
+		}
+		
+		getExtendTest().log(Status.INFO, String.format("initState: %s, targetState: %s, errorCode: %s,"
+				+ " preState: %s, currState: %s, status: %s, actionStatus: %s, user: %s, operationUser: %s", initState, targetState, errorCode, preState,
+				currState, status, actionStatus, user, operationUser));
+		
+		
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		
+		resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, initState, true).getLeft();
+		
+		RestResponse restResponse = null;
+		
+		if(targetState.equals(LifeCycleStatesEnum.CHECKOUT)) {
+			restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.CHECKIN)) {
+			restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.CERTIFICATIONREQUEST)) {
+			restResponse = LifecycleRestUtils.certificationRequestService(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.STARTCERTIFICATION)) {
+			restResponse = LifecycleRestUtils.startTestingService(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.CERTIFY)) {
+			restResponse = LifecycleRestUtils.certifyService(resourceDetails.getUUID(), user);
+		}
+		
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)errorCode, "Expected that response code will be equal.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, user, targetState, AssetTypeEnum.SERVICES);	
+		if(initState.equals(LifeCycleStatesEnum.CERTIFY)) {
+			expectedResourceAuditJavaObject.setCurrVersion("1.0");
+			expectedResourceAuditJavaObject.setPrevVersion("1.0");
+		}
+		expectedResourceAuditJavaObject.setPrevState(preState.toString());
+		expectedResourceAuditJavaObject.setCurrState(currState.toString());
+		expectedResourceAuditJavaObject.setStatus(status);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		List<String> variables = null;
+		if(ActionStatus.RESTRICTED_OPERATION.equals(actionStatus)) {
+			variables = asList("");
+		} else if(ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION.equals(actionStatus)) {
+			variables = asList(resourceDetails.getName(), AssetTypeEnum.SERVICES.getCorrespondingComponent().toLowerCase());
+		} else {
+			if(operationUser == null) {
+				variables = asList(resourceDetails.getName(), AssetTypeEnum.SERVICES.getCorrespondingComponent().toLowerCase(), user.getFirstName(), user.getLastName(), user.getUserId());
+			} else {
+				variables = asList(resourceDetails.getName(), AssetTypeEnum.SERVICES.getCorrespondingComponent().toLowerCase(), operationUser.getFirstName(), operationUser.getLastName(), operationUser.getUserId());
+			}
+			
+		}
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	@DataProvider(name="invalidStatesForResource") 
+	public static Object[][] dataProviderInvalidStatesForResource() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CHECKED_IN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "409", ActionStatus.COMPONENT_ALREADY_CHECKED_IN, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			{LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			{LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			
+			{LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CHECKOUT_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_IN_CHECKOUT_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			{LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			{LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_SENT_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, "403", ActionStatus.COMPONENT_SENT_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, LifeCycleStatesEnum.CERTIFY, RESTRICTED_OPERATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, "409", ActionStatus.RESTRICTED_OPERATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
+			
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CHECKIN, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+			{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
+		};
+	}
+	
+	// US849997 - Story [BE]: External API for asset lifecycle - checkout
+	@Test(dataProvider="invalidStatesForResource")
+	public void invalidStatesForResource(LifeCycleStatesEnum initState, LifeCycleStatesEnum targetState, int errorCode,
+			LifecycleStateEnum preState, LifecycleStateEnum currState, String status,
+			ActionStatus actionStatus, User user, User operationUser) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("initState: %s, targetState: %s, errorCode: %s,"
+				+ " preState: %s, currState: %s, status: %s, actionStatus: %s, user: %s, operationUser: %s", initState, targetState, errorCode, preState,
+				currState, status, actionStatus, user, operationUser));
+		
+		if(initState.equals(LifeCycleStatesEnum.STARTCERTIFICATION) && targetState.equals(LifeCycleStatesEnum.CHECKIN)){
+			throw new SkipException("Open bug DE270217");			
+		}
+		
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		
+		resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, initState, true).getLeft();
+		
+		RestResponse restResponse = null;
+		
+		if(targetState.equals(LifeCycleStatesEnum.CHECKOUT)) {
+			restResponse = LifecycleRestUtils.checkOutResource(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.CHECKIN)) {
+			restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.CERTIFICATIONREQUEST)) {
+			restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.STARTCERTIFICATION)) {
+			restResponse = LifecycleRestUtils.startTestingResource(resourceDetails.getUUID(), user);
+		} else if(targetState.equals(LifeCycleStatesEnum.CERTIFY)) {
+			restResponse = LifecycleRestUtils.certifyResource(resourceDetails.getUUID(), user);
+		}
+		
+		Assert.assertEquals(restResponse.getErrorCode(), (Integer)errorCode, "Expected that response code will be equal.");
+		
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, user, targetState, AssetTypeEnum.RESOURCES);	
+		if(initState.equals(LifeCycleStatesEnum.CERTIFY)) {
+			expectedResourceAuditJavaObject.setCurrVersion("1.0");
+			expectedResourceAuditJavaObject.setPrevVersion("1.0");
+		}
+		expectedResourceAuditJavaObject.setPrevState(preState.toString());
+		expectedResourceAuditJavaObject.setCurrState(currState.toString());
+		expectedResourceAuditJavaObject.setStatus(status);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
+		List<String> variables = null;
+		if(ActionStatus.RESTRICTED_OPERATION.equals(actionStatus)) {
+			variables = asList("");
+		} else if(ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION.equals(actionStatus)) {
+			variables = asList(resourceDetails.getName(), AssetTypeEnum.RESOURCES.getCorrespondingComponent().toLowerCase());
+		} else {
+			if(operationUser == null) {
+				variables = asList(resourceDetails.getName(), AssetTypeEnum.RESOURCES.getCorrespondingComponent().toLowerCase(), user.getFirstName(), user.getLastName(), user.getUserId());
+			} else {
+				variables = asList(resourceDetails.getName(), AssetTypeEnum.RESOURCES.getCorrespondingComponent().toLowerCase(), operationUser.getFirstName(), operationUser.getLastName(), operationUser.getUserId());
+			}
+			
+		}
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	
+
+	
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
+	@Test
+	public void BasicFlowForResourceSubmitForTestingStartTesting() throws Exception {
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Certification request
+		restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.CERTIFICATIONREQUEST.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CERTIFICATIONREQUEST, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.READY_FOR_CERTIFICATION.toString());
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// Start testing
+		restResponse = LifecycleRestUtils.startTestingResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.STARTCERTIFICATION.getState()));
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.READY_FOR_CERTIFICATION.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.toString());
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
+	@Test
+	public void BasicFlowForServiceSubmitForTestingStartTesting() throws Exception {
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Certification request
+		restResponse = LifecycleRestUtils.certificationRequestService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.SERVICES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.CERTIFICATIONREQUEST.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CERTIFICATIONREQUEST, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.READY_FOR_CERTIFICATION.toString());
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// Start testing
+		restResponse = LifecycleRestUtils.startTestingService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.SERVICES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.STARTCERTIFICATION.getState()));
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.READY_FOR_CERTIFICATION.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.toString());
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
+	@Test
+	public void specialCaseInvalidFlowForVfcmtSubmitForTesting() throws Exception {
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFCMT, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Certification request
+		restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.CERTIFICATIONREQUEST.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CERTIFICATIONREQUEST, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setStatus("400");
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_VFCMT_LIFECYCLE_STATE_NOT_VALID.name());
+		List<String> variables = asList(LifeCycleStatesEnum.CERTIFICATIONREQUEST.getState());
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
+	@Test
+	public void specialCaseInvalidFlowForVfcmtStartTesting() throws Exception {
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFCMT, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Certification request
+		restResponse = LifecycleRestUtils.startTestingResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.STARTCERTIFICATION.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setStatus("400");
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_VFCMT_LIFECYCLE_STATE_NOT_VALID.name());
+		List<String> variables = asList(LifeCycleStatesEnum.STARTCERTIFICATION.getState());
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	
+	
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	
+	
+	
+	// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
+	@Test
+	public void BasicFlowForResourceCertify() throws Exception {
+		Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Certification request
+		restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Start testing
+		restResponse = LifecycleRestUtils.startTestingResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Certify
+		restResponse = LifecycleRestUtils.certifyResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.CERTIFY.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.toString());
+		expectedResourceAuditJavaObject.setCurrVersion("1.0");
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+	}
+		
+	// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
+	@Test
+	public void BasicFlowForServiceCertify() throws Exception {
+		Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
+		Component resourceDetails = createdComponent.left().value();
+		RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Certification request
+		restResponse = LifecycleRestUtils.certificationRequestService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		
+		// Start testing
+		restResponse = LifecycleRestUtils.startTestingService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Certify
+		restResponse = LifecycleRestUtils.certifyService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.SERVICES.getValue().toLowerCase(), resourceDetails.getUUID(), LifeCycleStatesEnum.CERTIFY.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.CERTIFY, AssetTypeEnum.SERVICES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFICATION_IN_PROGRESS.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.toString());
+		expectedResourceAuditJavaObject.setCurrVersion("1.0");
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	
+	@Test
+	public void theFlow() throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
+		
+		// 1. Create VFCMT.
+		RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
+		BaseRestUtils.checkCreateResponse(restResponse);
+		ResourceAssetStructure parsedCreatedResponse = gson.fromJson(restResponse.getResponse(), ResourceAssetStructure.class);
+		
+		// 2. Using search external API with resourceType=VFCMT to retrieve VFCMT.
+		restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), ResourceTypeEnum.VFCMT.toString());
+		BaseRestUtils.checkSuccess(restResponse);
+		ResourceAssetStructure dataOutOfSearchResponseForResourceName = ResponseParser.getDataOutOfSearchExternalAPIResponseForResourceName(restResponse.getResponse(), parsedCreatedResponse.getName());
+		Assert.assertEquals(parsedCreatedResponse.getUuid(), dataOutOfSearchResponseForResourceName.getUuid(), "Created resourceUUID not equal to search retrive resourceUUID.");
+		
+		// 3. Use getSpecificMetadata external API to receive full information of the VFCMT.
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, dataOutOfSearchResponseForResourceName.getUuid());
+		BaseRestUtils.checkSuccess(assetResponse);
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		Assert.assertEquals(resourceAssetMetadata.getUuid(), parsedCreatedResponse.getUuid(), "Created resourceUUID not equal to getSpecificMetadata resourceUUID.");
+		
+		// 4. Upload artifact via upload artifact external API.
+		Component initComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), parsedCreatedResponse.getVersion());
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", "OTHER", true, false);
+		RestResponse uploadArtifactRestResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(initComponentVersion, defaultUser, artifactReqDetails);
+		BaseRestUtils.checkSuccess(uploadArtifactRestResponse);
+		ArtifactDefinition responseArtifact = ArtifactRestUtils.getArtifactDataFromJson(uploadArtifactRestResponse.getResponse());
+		initComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), parsedCreatedResponse.getVersion());
+		
+		// 5. Update artifact via external API.
+		CRUDExternalAPI crudExternalAPI = new CRUDExternalAPI();
+		crudExternalAPI.updateArtifactOnAssetViaExternalAPI(initComponentVersion, ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, "OTHER");
+	
+		
+		// 6. Use external API to checkin the VFCMT.
+		RestResponse checkInRestResponse = LifecycleRestUtils.checkInResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(checkInRestResponse);
+		parsedCreatedResponse = gson.fromJson(checkInRestResponse.getResponse(), ResourceAssetStructure.class);
+		Assert.assertEquals(parsedCreatedResponse.getVersion(), "0.1", "Expect that version will not change.");
+		Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
+		Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
+		
+		// Auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, initComponentVersion.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), initComponentVersion.getUUID(), LifeCycleStatesEnum.CHECKIN.getState()));
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(initComponentVersion, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.RESOURCES);	
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// 7. Then checkout the VFCMT via external API.
+		RestResponse checkOutRestResponse = LifecycleRestUtils.checkOutResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(checkOutRestResponse);
+		parsedCreatedResponse = gson.fromJson(checkOutRestResponse.getResponse(), ResourceAssetStructure.class);
+		Assert.assertEquals(parsedCreatedResponse.getVersion(), "0.2", "Expect that version will change to 0.2.");
+		Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
+		Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
+		
+		// Auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, initComponentVersion.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), initComponentVersion.getUUID(), LifeCycleStatesEnum.CHECKOUT.getState()));
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(initComponentVersion, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setCurrVersion("0.2");
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// 8. The minor version must be incremented, the invariantUUID, and UUID must stay the same, the uniqueId should be changed, the artifacts from first version exists on the new version.
+		Component newComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), String.format("%.1f", Double.parseDouble(parsedCreatedResponse.getVersion())));
+		Assert.assertEquals(newComponentVersion.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
+		Assert.assertEquals(newComponentVersion.getUUID(), initComponentVersion.getUUID(), "Expected that UUID will not change.");
+		Assert.assertNotEquals(newComponentVersion.getUniqueId(), initComponentVersion.getUniqueId(), "Expected that uniqueId will change.");
+		Assert.assertTrue(newComponentVersion.getDeploymentArtifacts().keySet().contains(responseArtifact.getArtifactLabel()), "Expected that artifact from first version exists on the new version.");
+		
+		// 9. The previous version remains untouched, the highest version flag on the first version is false, all information (metadata / artifacts) are the same on the first version.
+		initComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), String.format("%.1f", Double.parseDouble("0.1")));
+		Assert.assertEquals(initComponentVersion.isHighestVersion(), (Boolean)false, "Expected that highest version flag on first version is false.");
+		
+		// 10. Check in via external API.
+		checkInRestResponse = LifecycleRestUtils.checkInResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(checkInRestResponse);
+		parsedCreatedResponse = gson.fromJson(checkInRestResponse.getResponse(), ResourceAssetStructure.class);
+		Assert.assertEquals(parsedCreatedResponse.getVersion(), "0.2", "Expect that version will not change.");
+		Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
+		Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
+		
+		// Auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, initComponentVersion.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), initComponentVersion.getUUID(), LifeCycleStatesEnum.CHECKIN.getState()));
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(initComponentVersion, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrVersion("0.2");
+		expectedResourceAuditJavaObject.setPrevVersion("0.2");
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// 11. Certify via external API.
+		RestResponse certifyRestResponse = LifecycleRestUtils.certifyResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(certifyRestResponse);
+		parsedCreatedResponse = gson.fromJson(certifyRestResponse.getResponse(), ResourceAssetStructure.class);
+		Assert.assertEquals(parsedCreatedResponse.getVersion(), "1.0", "Expect that version will change to 1.0");
+		Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
+		Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
+		
+		// Auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, initComponentVersion.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), initComponentVersion.getUUID(), LifeCycleStatesEnum.CERTIFY.getState()));
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(initComponentVersion, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CERTIFY, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.toString());
+		expectedResourceAuditJavaObject.setCurrVersion("1.0");
+		expectedResourceAuditJavaObject.setPrevVersion("0.2");
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// 12. Check out via external API.
+		checkOutRestResponse = LifecycleRestUtils.checkOutResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(checkOutRestResponse);
+		parsedCreatedResponse = gson.fromJson(checkOutRestResponse.getResponse(), ResourceAssetStructure.class);
+		Assert.assertEquals(parsedCreatedResponse.getVersion(), "1.1", "Expect that version will change to 1.1");
+		Assert.assertNotEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will change.");
+		Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
+		
+		// Auditing verification
+		body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, initComponentVersion.getName());
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", AssetTypeEnum.RESOURCES.getValue().toLowerCase(), initComponentVersion.getUUID(), LifeCycleStatesEnum.CHECKOUT.getState()));
+		expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(initComponentVersion, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.RESOURCES);	
+		expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.CERTIFIED.toString());
+		expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
+		expectedResourceAuditJavaObject.setCurrVersion("1.1");
+		expectedResourceAuditJavaObject.setPrevVersion("1.0");
+		AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java
new file mode 100644
index 0000000..c3f9a72
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java
@@ -0,0 +1,3528 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static java.util.Arrays.asList;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpResponseException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.BasicResponseHandler;
+import org.apache.http.util.EntityUtils;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig.Feature;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.config.BeEcompErrorManager;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.DistributionNotificationStatusEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.DistributionValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.config.EcompErrorName;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.openecomp.sdc.common.util.GeneralUtility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.SkipException;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+import com.google.gson.Gson;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
+import fj.data.Either;
+
+public class CRUDExternalAPI extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
+	protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
+	protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+	protected Gson gson = new Gson();
+	protected JSONParser jsonParser = new JSONParser();
+
+	protected String serviceVersion;
+	protected ResourceReqDetails resourceDetails;
+	protected User sdncUserDetails;
+	protected ServiceReqDetails serviceDetails;
+	
+	@Rule 
+	public static TestName name = new TestName();
+
+	public CRUDExternalAPI() {
+		super(name, CRUDExternalAPI.class.getName());
+	}
+	
+	@DataProvider(name="uploadArtifactOnVfcVlCpViaExternalAPI" , parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnVfcVlCpViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.CP}
+			};
+	}
+	
+	// External API
+	// Upload artifact on VFC, VL, CP via external API - happy flow
+	@Test(dataProvider="uploadArtifactOnVfcVlCpViaExternalAPI")
+	public void uploadArtifactOnVfcVlCpViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s, resourceTypeEnum: %s", chosenLifeCycleState, artifactType, resourceTypeEnum));
+		uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, chosenLifeCycleState, artifactType, resourceTypeEnum);
+	}
+	
+	@DataProvider(name="uploadArtifactOnVFViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnVFViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CHECKOUT, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CHECKIN, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER"}
+			};
+	}
+	
+	// External API
+	// Upload artifact on VF via external API - happy flow
+	@Test(dataProvider="uploadArtifactOnVFViaExternalAPI")
+	public void uploadArtifactOnVFViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, chosenLifeCycleState, artifactType, null);
+	}
+	
+	
+	@DataProvider(name="uploadArtifactOnServiceViaExternalAPI" , parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnServiceViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER"}
+			};
+	}
+	
+	
+	@Test(dataProvider="uploadArtifactOnServiceViaExternalAPI")
+	public void uploadArtifactOnServiceViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, chosenLifeCycleState, artifactType, null);
+	}
+	
+	
+	@DataProvider(name="uploadArtifactOnServiceViaExternalAPIIncludingDistribution", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnServiceViaExternalAPIIncludingDistribution() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			};
+	}
+	
+	@Test(dataProvider="uploadArtifactOnServiceViaExternalAPIIncludingDistribution")
+	public void uploadArtifactOnServiceViaExternalAPIIncludingDistribution(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
+		if(true){
+			throw new SkipException("Automated TC need repair.");			
+		}
+		
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, chosenLifeCycleState, artifactType, null);
+		
+		component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		
+		if(config.getIsDistributionClientRunning()){
+			List<String> distributionStatusList = Arrays.asList(DistributionNotificationStatusEnum.DOWNLOAD_OK.toString(), DistributionNotificationStatusEnum.DEPLOY_OK.toString(), DistributionNotificationStatusEnum.NOTIFIED.toString());
+			DistributionValidationUtils.validateDistributedArtifactsByAudit((Service)component, distributionStatusList);
+		}
+	}
+	
+	
+	// Happy flow - get chosen life cycle state, artifact type and asset type
+	// Create asset, upload artifact via external API + check audit & response code
+	// Download artifact via external API + check audit & response code
+	protected Component uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		Component component = null;
+		RestResponse restResponse;
+		int numberOfArtifact = 0;
+		
+		// get artifact data
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, false);
+		
+		// create component/s & upload artifact via external api
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
+			component = getComponentWithResourceInstanceInTargetLifeCycleState(chosenLifeCycleState, resourceTypeEnum);
+			
+			restResponse = uploadArtifactOfRIIncludingValiditionOfAuditAndResponseCode(component, component.getComponentInstances().get(0), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
+			component =AtomicOperationUtils.getCompoenntObject(component, UserRoleEnum.DESIGNER);
+			
+ 			if((LifeCycleStatesEnum.CERTIFICATIONREQUEST == chosenLifeCycleState) && (!component.getComponentType().toString().equals(ComponentTypeEnum.RESOURCE.toString()))) {
+//				numberOfArtifact = component.getComponentInstances().get(0).getDeploymentArtifacts().size();
+				numberOfArtifact = (component.getComponentInstances().get(0).getDeploymentArtifacts() == null ? 0 : component.getComponentInstances().get(0).getDeploymentArtifacts().size());
+			} else {
+//				numberOfArtifact = component.getComponentInstances().get(0).getDeploymentArtifacts().size() + 1;
+				numberOfArtifact = (component.getComponentInstances().get(0).getDeploymentArtifacts() == null ? 0 : component.getComponentInstances().get(0).getDeploymentArtifacts().size());
+			}
+		} else {
+			component = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, chosenLifeCycleState, resourceTypeEnum);
+			
+			restResponse = uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
+			numberOfArtifact = component.getDeploymentArtifacts().size() + 1;
+		}
+		
+		
+		
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		component = getNewerVersionOfComponent(component, chosenLifeCycleState);
+		
+		// Get list of deployment artifact + download them via external API
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		Assert.assertEquals(numberOfArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will be increase by one.");
+		
+		// Download the uploaded artifact via external API
+		downloadResourceDeploymentArtifactExternalAPI(component, deploymentArtifacts.get(responseArtifact.getArtifactLabel()), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentTypeEnum);
+	
+		return component;
+	}
+	
+	// Upload artifact via external API + Check auditing for upload operation + Check response of external API
+	public RestResponse uploadArtifactOfRIIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, ComponentInstance componentInstance, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, Integer expectedResponseCode) throws Exception {
+		RestResponse restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, resourceDetails.getComponentInstances().get(0));
+		
+		// Check response of external API
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPLOAD_BY_API;
+		
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, componentInstance.getNormalizedName());
+		
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		expectedExternalAudit.setRESOURCE_NAME(componentInstance.getNormalizedName());
+		expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + componentInstance.getNormalizedName() + "/artifacts");
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPLOAD_BY_API.getName(), body);
+		
+		return restResponse;
+	}
+	
+	
+	
+	
+	protected Component getComponentWithResourceInstanceInTargetLifeCycleState(LifeCycleStatesEnum lifeCycleStatesEnum, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		Component component;
+		if(resourceTypeEnum == ResourceTypeEnum.VF) {
+			component = getComponentInTargetLifeCycleState(ComponentTypeEnum.SERVICE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
+			
+			Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, null);
+			AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
+			
+			// Add artifact to service if asked for certifcationrequest - must be at least one artifact for the flow
+			if((LifeCycleStatesEnum.CERTIFICATIONREQUEST == lifeCycleStatesEnum) || (LifeCycleStatesEnum.STARTCERTIFICATION == lifeCycleStatesEnum)) {
+			}
+			AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, component, UserRoleEnum.DESIGNER, true, true).left().value();
+			component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, lifeCycleStatesEnum, true).getLeft();
+		} else {
+			component = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
+			Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, resourceTypeEnum);
+			AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
+			component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, lifeCycleStatesEnum, true).getLeft();
+		}
+		
+		
+		return component;
+	}
+	
+	
+	
+	
+	// Upload artifact via external API + Check auditing for upload operation + Check response of external API
+	protected RestResponse uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, Integer expectedResponseCode) throws Exception {
+		RestResponse restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(resourceDetails, sdncModifierDetails, artifactReqDetails);
+		
+		// Check response of external API
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPLOAD_BY_API;
+		
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPLOAD_BY_API.getName(), body);
+		
+		return restResponse;
+	}
+	
+	
+	
+	// Check Component version (increase by one if not in checkout)
+	// Input: component, componentLifeCycleState
+	// for any LifeCycleState != checkout
+	// find component of version +0.1
+	// check that this version different for input version
+	// check that this component uniqueID different from input uniqueID
+	// Return: that version
+	protected Component getNewerVersionOfComponent(Component component, LifeCycleStatesEnum lifeCycleStatesEnum) throws Exception {
+		Component resourceDetails = null;
+		
+		if((!lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKOUT)) && (!lifeCycleStatesEnum.equals(LifeCycleStatesEnum.STARTCERTIFICATION))) {
+			
+			
+			String resourceVersion = component.getVersion();
+			String resourceUniqueID = component.getUniqueId();
+			
+			if(component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
+				resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), String.format("%.1f", Double.parseDouble(component.getVersion()) + 0.1));
+			} else {
+				resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), String.format("%.1f", Double.parseDouble(component.getVersion()) + 0.1));
+			}
+			
+			String resourceNewVersion = resourceDetails.getVersion();
+			String resourceNewUniqueID = resourceDetails.getUniqueId();
+			
+			System.out.println(resourceNewVersion);
+			System.out.println("Service UUID: " + resourceDetails.getUUID());
+			System.out.println("Service UniqueID: " + resourceDetails.getUniqueId());
+			
+			// Checking that new version exist + different from old one by unique id
+			Assert.assertNotEquals(resourceVersion, resourceNewVersion, "Expected for diffrent resource version.");
+			Assert.assertNotEquals(resourceUniqueID, resourceNewUniqueID, "Expected that resource will have new unique ID.");
+		} else {
+			if(component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
+				resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
+			} else {
+				resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
+			}
+		}
+		return resourceDetails;
+	}
+	
+	
+	
+	
+	
+	// download deployment via external api + check response code for success (200) + get artifactReqDetails and verify payload + verify audit
+	protected RestResponse downloadResourceDeploymentArtifactExternalAPI(Component resourceDetails, ArtifactDefinition artifactDefinition, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, ComponentTypeEnum componentTypeEnum) throws Exception {
+		RestResponse restResponse;
+		
+		if(componentTypeEnum == ComponentTypeEnum.RESOURCE_INSTANCE) {
+			restResponse = ArtifactRestUtils.getComponentInstanceDeploymentArtifactExternalAPI(resourceDetails.getUUID(), resourceDetails.getComponentInstances().get(0).getNormalizedName(), artifactDefinition.getArtifactUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getComponentType().toString());
+		} else {
+			restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceDetails.getUUID(), artifactDefinition.getArtifactUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getComponentType().toString());
+		}
+		
+		Integer responseCode = restResponse.getErrorCode();
+		Integer expectedCode = 200;
+		Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
+		
+		
+		// For known artifact/payload - verify payload of downloaded artfaict
+		if (artifactReqDetails != null) {
+			String response = restResponse.getResponse();
+			String payloadData = artifactReqDetails.getPayload();
+			String decodedPaypload = org.openecomp.sdc.ci.tests.utils.Decoder.decode(payloadData);
+			
+			Assert.assertEquals(response, decodedPaypload, "Response artifact payload not correct.");
+		}
+		
+		//TODO - including body - resourceDetails.getName()
+//		// Verify audit
+//		String auditAction = "DownloadArtifact";
+//		
+//		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+//		body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, responseCode.toString());
+//		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+//		
+//		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+//		expectedResourceAuditJavaObject.setAction(auditAction);
+//		expectedResourceAuditJavaObject.setResourceType(resourceDetails.getComponentType().getValue());
+//		expectedResourceAuditJavaObject.setStatus("200");
+//		expectedResourceAuditJavaObject.setDesc("OK");
+//		expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+//		
+//		if(componentTypeEnum == ComponentTypeEnum.RESOURCE_INSTANCE) {
+//			expectedResourceAuditJavaObject.setResourceName(resourceDetails.getComponentInstances().get(0).getName());
+//			String resource_url = String.format("/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s", resourceDetails.getUUID(), resourceDetails.getComponentInstances().get(0).getNormalizedName(), artifactDefinition.getArtifactUUID());
+//			expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+//				
+//			AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+//		} else {
+//			expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName());
+//			String resource_url = String.format("/sdc/v1/catalog/services/%s/artifacts/%s", resourceDetails.getUUID(), artifactDefinition.getArtifactUUID());
+//			expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+//		}
+//		
+//		AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+		
+		return restResponse;
+		
+	}
+	
+	// download deployment via external api + check response code for success (200) + verify audit
+	protected void downloadResourceDeploymentArtifactExternalAPI(Component resourceDetails, ArtifactDefinition artifactDefinition, User sdncModifierDetails) throws Exception {
+		downloadResourceDeploymentArtifactExternalAPI(resourceDetails, artifactDefinition, sdncModifierDetails, null, resourceDetails.getComponentType());
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	@DataProvider(name="uploadArtifactOnRIViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnRIViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT"},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL"},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP"},
+			
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT"},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL"},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP"},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP"}
+			
+			};
+	}
+	
+	
+	
+	
+	
+	@Test(dataProvider="uploadArtifactOnRIViaExternalAPI")
+	public void uploadArtifactOnRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType, null);
+	}
+	
+	
+	
+	@DataProvider(name="uploadArtifactOnVfcVlCpRIViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnVfcVlCpRIViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.CP}
+			
+			};
+	}
+	
+	
+	
+	
+	
+	@Test(dataProvider="uploadArtifactOnVfcVlCpRIViaExternalAPI")
+	public void uploadArtifactOnVfcVlCpRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType, resourceTypeEnum);
+	}
+	
+	
+	
+	
+	@DataProvider(name="uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI() {
+		return new Object[][] {
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeEmpty"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameEmpty"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelEmpty"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionEmpty"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithSameLabel"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithSameLabel"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidCheckSum"},
+			};
+	}
+	
+	
+	
+	
+	// InvalidArtifact + check audit & response code function
+	@Test(dataProvider="uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI")
+	public void uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState,
+			ComponentTypeEnum componentTypeEnum, String uploadArtifactTestType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, componentTypeEnum: %s, uploadArtifactTestType: %s", chosenLifeCycleState, componentTypeEnum, uploadArtifactTestType));
+		Component resourceDetails;
+		ComponentInstance componentResourceInstanceDetails = null;
+		ArtifactReqDetails artifactReqDetails;
+		
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum)	 {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
+			
+			resourceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.SERVICE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
+			resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(chosenLifeCycleState, null);
+			componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
+		} else {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.toString(), true, false);
+			
+			resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, chosenLifeCycleState, null);
+		}
+		
+		
+		switch (uploadArtifactTestType) {
+		case "uploadArtifactWithInvalidTypeToLong":
+			uploadArtifactWithInvalidTypeToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidTypeEmpty":
+			uploadArtifactWithInvalidTypeEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidCheckSum":
+			uploadArtifactWithInvalidCheckSum(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidNameToLong":
+			uploadArtifactWithInvalidNameToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidNameEmpty":
+			uploadArtifactWithInvalidNameEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidLabelToLong":
+			uploadArtifactWithInvalidLabelToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidLabelEmpty":
+			uploadArtifactWithInvalidLabelEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidDescriptionToLong":
+			uploadArtifactWithInvalidDescriptionToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithInvalidDescriptionEmpty":
+			uploadArtifactWithInvalidDescriptionEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		case "uploadArtifactWithSameLabel":
+		default:
+			uploadArtifactWithSameLabel(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+			break;
+		}	
+	}
+	
+	// Upload artifact with invalid type via external API - to long type
+	protected void uploadArtifactWithInvalidTypeToLong(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		artifactReqDetails.setArtifactType("dsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfds");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
+		List<String> variables = asList(artifactReqDetails.getArtifactType());
+		
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+	// Upload artifact with invalid type via external API - empty type
+	protected void uploadArtifactWithInvalidTypeEmpty(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		artifactReqDetails.setArtifactType("");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
+		List<String> variables = asList(artifactReqDetails.getArtifactType());
+		
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+	// Upload artifact with invalid checksum via external API
+	protected void uploadArtifactWithInvalidCheckSum(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_INVALID_MD5.name());
+		List<String> variables = asList();
+		uploadArtifactWithInvalidCheckSumOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+						artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables);
+	}
+	
+	
+	// Upload artifact with valid type & invalid name via external API - name to long
+	protected void uploadArtifactWithInvalidNameToLong(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
+		List<String> variables = asList("artifact name", "255");
+		artifactReqDetails.setArtifactName("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+						artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+	
+	// Upload artifact with valid type & invalid name via external API - name is empty
+	protected void uploadArtifactWithInvalidNameEmpty(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_ARTIFACT_NAME.name());
+		List<String> variables = asList();
+		
+		artifactReqDetails.setArtifactName("");
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+	
+	// Upload artifact with valid type & invalid label via external API - label to long
+	protected void uploadArtifactWithInvalidLabelToLong(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
+		List<String> variables = asList("artifact label", "255");
+		artifactReqDetails.setArtifactLabel("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+		
+		
+	// Upload artifact with valid type & invalid label via external API - label is empty
+	protected void uploadArtifactWithInvalidLabelEmpty(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		List<String> variables = asList("artifact label");
+		artifactReqDetails.setArtifactLabel("");
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+	
+	// Upload artifact with invalid description via external API - to long description
+	protected void uploadArtifactWithInvalidDescriptionToLong(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+			
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
+		List<String> variables = asList("artifact description", "256");
+		artifactReqDetails.setDescription("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+			
+			
+	// Upload artifact with invalid description via external API - empty description
+	protected void uploadArtifactWithInvalidDescriptionEmpty(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+			
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		List<String> variables = asList("artifact description");
+		artifactReqDetails.setDescription("");
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+
+	
+	
+	// Upload artifact with same label via external API
+	protected void uploadArtifactWithSameLabel(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			ComponentInstance componentResourceInstanceDetails) throws Exception {
+		
+		RestResponse restResponse = null;
+		if(componentResourceInstanceDetails != null) {
+			restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+		} else {
+			restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails);
+
+		}
+		
+		ArtifactDefinition artifactDefinition = getArtifactDataFromJson(restResponse.getResponse());
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_EXIST.name());
+		
+		List<String> variables = asList(artifactDefinition.getArtifactDisplayName());
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables, null, false);
+	}
+	
+	protected RestResponse uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			Integer expectedResponseCode, ComponentInstance componentResourceInstanceDetails, ErrorInfo errorInfo, List<String> variables, LifeCycleStatesEnum lifeCycleStatesEnum, Boolean includeResourceNameInAudit) throws Exception {
+		RestResponse restResponse;
+		
+		if(componentResourceInstanceDetails != null) {
+			restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(resourceDetails, sdncModifierDetails, artifactReqDetails, componentResourceInstanceDetails);
+		} else {
+			restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(resourceDetails, sdncModifierDetails, artifactReqDetails);
+
+		}
+		
+		// validate response code
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+				
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPLOAD_BY_API;
+				
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+//		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		
+		responseArtifact.setUpdaterFullName("");
+		responseArtifact.setUserIdLastUpdater(sdncModifierDetails.getUserId());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditFailure(assetTypeEnum, action, responseArtifact, resourceDetails.getUUID(), errorInfo, variables);
+		expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getName());
+		expectedExternalAudit.setRESOURCE_TYPE(resourceDetails.getComponentType().getValue());
+		expectedExternalAudit.setARTIFACT_DATA(null);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, responseCode.toString());
+		if(componentResourceInstanceDetails != null) {
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getComponentInstances().get(0).getNormalizedName());
+			expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + resourceDetails.getComponentInstances().get(0).getNormalizedName() + "/artifacts");
+			expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getComponentInstances().get(0).getNormalizedName());
+		} else {
+			if(includeResourceNameInAudit) {
+				body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+			} else {
+				if((lifeCycleStatesEnum == LifeCycleStatesEnum.CHECKIN) || (lifeCycleStatesEnum == LifeCycleStatesEnum.STARTCERTIFICATION)) {
+				expectedExternalAudit.setRESOURCE_NAME("");
+				body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, "");
+				} else {
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+				}
+			}
+		}
+		
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPLOAD_BY_API.getName(), body);
+		
+		return restResponse;
+	
+	}
+
+	
+	
+	
+	
+	
+	protected RestResponse uploadArtifactWithInvalidCheckSumOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
+			Integer expectedResponseCode, ComponentInstance componentResourceInstanceDetails, ErrorInfo errorInfo, List<String> variables) throws Exception {
+		RestResponse restResponse;
+		
+		if(componentResourceInstanceDetails != null) {
+			restResponse = ArtifactRestUtils.externalAPIUploadArtifactWithInvalidCheckSumOfComponentInstanceOnAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
+		} else {
+			restResponse = ArtifactRestUtils.externalAPIUploadArtifactWithInvalidCheckSumOfTheAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails);
+
+		}
+		
+		// validate response code
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		// Check auditing for upload operation
+//		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS.name());
+//		 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
+//		List<String> variables = asList("artifact name", "255");
+		
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+				
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPLOAD_BY_API;
+				
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+//		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		
+		responseArtifact.setUpdaterFullName("");
+		responseArtifact.setUserIdLastUpdater(sdncModifierDetails.getUserId());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditFailure(assetTypeEnum, action, responseArtifact, resourceDetails.getUUID(), errorInfo, variables);
+		expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getName());
+		expectedExternalAudit.setRESOURCE_TYPE(resourceDetails.getComponentType().getValue());
+		expectedExternalAudit.setARTIFACT_DATA(null);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, responseCode.toString());
+		if(componentResourceInstanceDetails != null) {
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getComponentInstances().get(0).getNormalizedName());
+			expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + resourceDetails.getComponentInstances().get(0).getNormalizedName() + "/artifacts");
+			expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getComponentInstances().get(0).getNormalizedName());
+		} else {
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		}
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPLOAD_BY_API.getName(), body);
+		
+		return restResponse;
+	
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	@DataProvider(name="uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset() {
+		return new Object[][] {
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT},
+			};
+	}
+		
+	
+	// External API
+	// Upload artifact by diffrent user then creator of asset - Fail
+	@Test(dataProvider="uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset")
+	public void uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset(ComponentTypeEnum componentTypeEnum, UserRoleEnum userRoleEnum, LifeCycleStatesEnum lifeCycleStatesEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, userRoleEnum: %s, lifeCycleStatesEnum: %s", componentTypeEnum, userRoleEnum, lifeCycleStatesEnum));
+		Component resourceDetails;
+		ComponentInstance componentResourceInstanceDetails = null;
+		ArtifactReqDetails artifactReqDetails;
+		
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum)	 {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
+			
+			resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(lifeCycleStatesEnum, null);
+			componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
+		} else {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.toString(), true, false);
+			
+			resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, lifeCycleStatesEnum, null);
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList();
+		
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(userRoleEnum),
+				artifactReqDetails, 409, componentResourceInstanceDetails, errorInfo, variables, lifeCycleStatesEnum, true);
+		
+//		if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKIN)) {
+//			performeClean();
+//		}
+	}
+	
+	
+	
+	
+	
+	@DataProvider(name="uploadArtifactOnAssetWhichNotExist", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnAssetWhichNotExist() {
+		return new Object[][] {
+			{ComponentTypeEnum.SERVICE},
+			{ComponentTypeEnum.RESOURCE},
+			{ComponentTypeEnum.RESOURCE_INSTANCE},
+			};
+	}
+		
+
+	// External API
+	// Upload artifact on VF via external API - happy flow
+	@Test(dataProvider="uploadArtifactOnAssetWhichNotExist")
+	public void uploadArtifactOnAssetWhichNotExist(ComponentTypeEnum componentTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s", componentTypeEnum));
+		Component resourceDetails;
+		ComponentInstance componentResourceInstanceDetails = null;
+		ArtifactReqDetails artifactReqDetails;
+		
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum)	 {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
+			
+			resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(LifeCycleStatesEnum.CHECKIN, null);
+			componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
+			
+			resourceDetails.setUUID("12345");
+			componentResourceInstanceDetails.setNormalizedName("12345");
+		} else {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", "OTHER", true, false);
+			
+			resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, null);
+			
+			resourceDetails.setUUID("12345");
+		}
+		
+		String componentTypeError = ActionStatus.RESOURCE_NOT_FOUND.name();
+		if (ComponentTypeEnum.SERVICE == componentTypeEnum){
+			componentTypeError = ActionStatus.SERVICE_NOT_FOUND.name();
+		}
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(componentTypeError);
+		List<String> variables = asList(resourceDetails.getUUID());
+		
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 404, componentResourceInstanceDetails, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, false);
+		
+//		performeClean();
+		
+	}
+	
+	
+	@DataProvider(name="uploadArtifactOnAssetWhichInInvalidStateForUploading", parallel=true) 
+	public static Object[][] dataProviderUploadArtifactOnAssetWhichInInvalidStateForUploading() {
+		return new Object[][] {
+			{ComponentTypeEnum.SERVICE},
+			{ComponentTypeEnum.RESOURCE},
+			{ComponentTypeEnum.RESOURCE_INSTANCE},
+			};
+	}
+	
+	
+	@Test(dataProvider="uploadArtifactOnAssetWhichInInvalidStateForUploading")
+	public void uploadArtifactOnAssetWhichInInvalidStateForUploading(ComponentTypeEnum componentTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s", componentTypeEnum));
+		Component resourceDetails;
+		ComponentInstance componentResourceInstanceDetails = null;
+		ArtifactReqDetails artifactReqDetails;
+		
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum)	 {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
+			
+			resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(LifeCycleStatesEnum.STARTCERTIFICATION, null);
+			componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
+		} else {
+			artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.toString(), true, false);
+
+			resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, null);
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
+		List<String> variables = asList(resourceDetails.getName(), resourceDetails.getComponentType().toString().toLowerCase(), resourceDetails.getLastUpdaterFullName().split(" ")[0],
+				resourceDetails.getLastUpdaterFullName().split(" ")[1], resourceDetails.getLastUpdaterUserId());
+		
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				artifactReqDetails, 403, componentResourceInstanceDetails, errorInfo, variables, LifeCycleStatesEnum.STARTCERTIFICATION, true);
+	}
+	
+	
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	//					Update External API											  //
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+
+	@DataProvider(name="updateArtifactForServiceViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactForServiceViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER"},
+			{LifeCycleStatesEnum.CERTIFY, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFY, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFY, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFY, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFY, "OTHER"}
+			};
+	}
+	
+	
+	
+	
+	// Update artifact for Service - Success
+	@Test(dataProvider="updateArtifactForServiceViaExternalAPI")
+	public void updateArtifactForServiceViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
+		updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.SERVICE, lifeCycleStatesEnum, artifactType);
+		
+		// for certify version check that previous version exist, and that it artifact can be download + checksum
+		if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFY)) {
+			// Download the uploaded artifact via external API
+			downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.SERVICE);
+		}
+	}
+	
+	@DataProvider(name="updateArtifactForVFViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactForVFViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CHECKOUT, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CHECKIN, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER"}
+			};
+	}
+	
+	
+	// Update artifact for VF - Success
+	@Test(dataProvider="updateArtifactForVFViaExternalAPI")
+	public void updateArtifactForVFViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
+		updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum, artifactType);
+		
+		// for certify version check that previous version exist, and that it artifact can be download + checksum
+		if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFY)) {
+			// Download the uploaded artifact via external API
+			downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE);
+		}
+	}
+	
+	@DataProvider(name="updateArtifactForVfcVlCpViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactForVfcVlCpViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.CP}
+			};
+	}
+	
+	
+	// Update artifact for VFC/VL/CP - Success
+	@Test(dataProvider="updateArtifactForVfcVlCpViaExternalAPI")
+	public void updateArtifactForVfcVlCpViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s, resourceTypeEnum: %s", lifeCycleStatesEnum, artifactType, resourceTypeEnum));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
+		updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum, artifactType);
+		
+		// for certify version check that previous version exist, and that it artifact can be download + checksum
+		if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFY)) {
+			// Download the uploaded artifact via external API
+			downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE);
+		}
+	}
+	
+	@DataProvider(name="updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI() {
+		return new Object[][] {
+			{ResourceTypeEnum.VFC},
+			{ResourceTypeEnum.VL},
+			{ResourceTypeEnum.CP}
+			};
+	}
+	
+	
+	// Verify that it cannot update VFC/VL/CP artifact on VFCi/VLi/CPi - Failure flow
+	@Test(dataProvider="updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI")
+	public void updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI(ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("resourceTypeEnum: %s", resourceTypeEnum));
+		
+		Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, resourceTypeEnum);
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", "SNMP_TRAP", true, false);
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceInstanceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
+		resourceInstanceDetails = AtomicOperationUtils.changeComponentState(resourceInstanceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		Component component = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
+		component = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		deploymentArtifacts = getDeploymentArtifactsOfAsset(component, ComponentTypeEnum.RESOURCE_INSTANCE);
+		String artifactUUID = null;
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci") && StringUtils.isNotEmpty(deploymentArtifacts.get(key).getArtifactUUID())) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		List<String> variables = asList(artifactUUID);
+		updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", errorInfo, variables, UserRoleEnum.DESIGNER, 404);
+
+	}
+	
+	
+	
+	
+	
+	@DataProvider(name="updateArtifactOnRIViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactOnRIViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", null},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", null},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VF}
+			
+			};
+	}
+	
+	
+	
+	
+	
+	@Test(dataProvider="updateArtifactOnRIViaExternalAPI")
+	public void updateArtifactOnRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
+		updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType);
+		
+		// for certify version check that previous version exist, and that it artifact can be download + checksum
+		if(chosenLifeCycleState.equals(LifeCycleStatesEnum.CERTIFY)) {
+			// Download the uploaded artifact via external API
+			downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE_INSTANCE);
+		}
+	}
+	
+	
+	
+	
+	
+	
+	
+	@DataProvider(name="updateArtifactOnVfcVlCpRIViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactOnVfcVlCpRIViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.CP}
+			
+			};
+	}
+	
+	
+	
+	
+	
+	@Test(dataProvider="updateArtifactOnVfcVlCpRIViaExternalAPI")
+	public void updateArtifactOnVfcVlCpRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
+		updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType);
+		
+		
+		// for certify version check that previous version exist, and that it artifact can be download + checksum
+		if(chosenLifeCycleState.equals(LifeCycleStatesEnum.CERTIFY)) {
+			// Download the uploaded artifact via external API
+			downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE_INSTANCE);
+		}
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	@DataProvider(name="updateArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset() {
+		return new Object[][] {
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			};
+	}
+		
+
+
+	// External API
+	// Update artifact by diffrent user then creator of asset - Fail
+	@Test(dataProvider="updateArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset")
+	public void updateArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset(ComponentTypeEnum componentTypeEnum, UserRoleEnum userRoleEnum, LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, userRoleEnum: %s, lifeCycleStatesEnum: %s, artifactType: %s", componentTypeEnum, userRoleEnum, lifeCycleStatesEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList();
+		updateArtifactOnAssetViaExternalAPI(component, componentTypeEnum, lifeCycleStatesEnum, artifactType, errorInfo, variables, userRoleEnum, 409);
+	}
+	
+	
+	@DataProvider(name="updateArtifactOnAssetWhichNotExist", parallel=true) 
+	public static Object[][] dataProviderUpdateArtifactOnAssetWhichNotExist() {
+		return new Object[][] {
+			{ComponentTypeEnum.SERVICE, "OTHER", null},
+			{ComponentTypeEnum.RESOURCE, "OTHER", null},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VF},
+			};
+	}
+		
+
+
+	// External API
+	// Upload artifact on VF via external API - happy flow
+	@Test(dataProvider="updateArtifactOnAssetWhichNotExist")
+	public void updateArtifactOnAssetWhichNotExist(ComponentTypeEnum componentTypeEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, resourceTypeEnum);
+		
+		// get updated artifact data
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		ArtifactReqDetails artifactReqDetails = getUpdatedArtifact(deploymentArtifacts, artifactType);
+		String artifactUUID = deploymentArtifacts.get(artifactReqDetails.getArtifactLabel()).getArtifactUUID();
+					
+		// Invalid artifactUUID
+		String invalidArtifactUUID = "12341234-1234-1234-1234-123412341234";
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
+		List<String> variables = asList(invalidArtifactUUID);
+		
+		if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, component.getComponentInstances().get(0), artifactReqDetails, invalidArtifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, null, artifactReqDetails, invalidArtifactUUID, errorInfo, variables, null, true);
+
+		}
+		
+		// Invalid componentUUID
+//		errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
+//		variables = asList("null");
+		
+		if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
+			component.getComponentInstances().get(0).setNormalizedName("invalidNormalizedName");
+			
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER.name());
+			
+			variables = asList("invalidNormalizedName", ComponentTypeEnum.RESOURCE_INSTANCE.getValue().toLowerCase(), ComponentTypeEnum.SERVICE.getValue(), component.getName());
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, true);
+		} else {
+			component.setUUID("invalidComponentUUID");
+			
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
+			variables = asList("null");
+			
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, null, artifactReqDetails, artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, false);
+		}
+		
+		performClean();
+	}
+	
+	
+	@DataProvider(name="updateArtifactOnAssetWhichInInvalidStateForUploading", parallel=true) 
+	public static Object[][] dataProviderUpdateProviderDeleteArtifactOnAssetWhichInInvalidStateForUploading() {
+		return new Object[][] {
+			{ComponentTypeEnum.SERVICE, "OTHER"},
+			{ComponentTypeEnum.RESOURCE, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, "DCAE_INVENTORY_TOSCA"},
+			};
+	}
+	
+	
+	@Test(dataProvider="updateArtifactOnAssetWhichInInvalidStateForUploading")
+	public void updateArtifactOnAssetWhichInInvalidStateForUploading(ComponentTypeEnum componentTypeEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
+		List<String> variables = asList(component.getName(), component.getComponentType().toString().toLowerCase(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getFirstName(),
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getLastName(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getUserId());
+		updateArtifactOnAssetViaExternalAPI(component, componentTypeEnum, LifeCycleStatesEnum.STARTCERTIFICATION, artifactType, errorInfo, variables, UserRoleEnum.DESIGNER, 403);
+		
+	}
+	
+	
+	
+	
+	
+	@DataProvider(name="updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderUpdateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidCheckSum"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidCheckSum"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameEmpty"},
+
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelEmpty"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionToLong"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionToLong"},
+			
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionEmpty"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionEmpty"},
+			};
+	}
+	
+	
+	
+	
+	// InvalidArtifact + check audit & response code function
+	@Test(dataProvider="updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI")
+	public void updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState,
+			ComponentTypeEnum componentTypeEnum, String uploadArtifactTestType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, componentTypeEnum: %s, uploadArtifactTestType: %s", chosenLifeCycleState, componentTypeEnum, uploadArtifactTestType));
+		Component component;
+		ComponentInstance componentInstance = null;
+		String artifactType;
+		
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum)	 {
+			artifactType = ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString();
+			component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
+			componentInstance = component.getComponentInstances().get(0);
+		} else {
+			artifactType = ArtifactTypeEnum.OTHER.toString();
+			component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
+		}
+		
+		component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
+		
+		switch (uploadArtifactTestType) {
+		case "updateArtifactWithInvalidCheckSum":
+			updateArtifactWithInvalidCheckSum(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		case "updateArtifactWithInvalidNameToLong":
+			updateArtifactWithInvalidNameToLong(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		case "updateArtifactWithInvalidNameEmpty":
+			updateArtifactWithInvalidNameEmpty(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		case "updateArtifactWithInvalidLabelToLong":
+			updateArtifactWithInvalidLabelToLong(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		case "updateArtifactWithInvalidLabelEmpty":
+			updateArtifactWithInvalidLabelEmpty(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		case "updateArtifactWithInvalidDescriptionToLong":
+			updateArtifactWithInvalidDescriptionToLong(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		case "updateArtifactWithInvalidDescriptionEmpty":
+		default:
+			updateArtifactWithInvalidDescriptionEmpty(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
+			break;
+		}
+		
+///////////////////////////////////////////////////////////////////////////////		
+//		// TODO: there is defect when checking invalid type
+////		// Upload artifact with invalid type via external API
+////		// invalid type
+////		String artifactType = artifactReqDetails.getArtifactType();
+////		artifactReqDetails.setArtifactType("invalidType");
+////		restResponse = uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 400, componentResourceInstanceDetails);
+////		// empty type
+////		artifactReqDetails.setArtifactType("");
+////		restResponse = uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 400, componentResourceInstanceDetails);
+////		artifactReqDetails.setArtifactType(artifactType);
+///////////////////////////////////////////////////////////////////////////////			
+	}
+	
+	// TODO
+	// Update artifact with invalid checksum via external API
+	protected void updateArtifactWithInvalidCheckSum(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_INVALID_MD5.name());
+		List<String> variables = asList();
+//		uploadArtifactWithInvalidCheckSumOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+//						artifactReqDetails, 400, componentResourceInstanceDetails, errorInfo, variables);
+	}
+	
+	
+	// Update artifact with valid type & invalid name via external API - name to long
+	protected void updateArtifactWithInvalidNameToLong(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		if(componentInstance != null) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+					
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
+		List<String> variables = asList("artifact name", "255");
+		artifactReqDetails.setArtifactName("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
+		
+		if(componentInstance != null) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+
+		}
+	}
+	
+	
+	// Update artifact with valid type & invalid name via external API - name is empty
+	protected void updateArtifactWithInvalidNameEmpty(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		if(componentInstance != null) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+					
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_ARTIFACT_NAME.name());
+		List<String> variables = asList();
+		artifactReqDetails.setArtifactName("");
+		
+		if(componentInstance != null) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+
+		}
+	}
+	
+	
+	// Update artifact with valid type & invalid label via external API - label to long
+	protected void updateArtifactWithInvalidLabelToLong(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		if(componentInstance != null) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+					
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_LOGICAL_NAME_CANNOT_BE_CHANGED.name());
+		List<String> variables = asList();
+		artifactReqDetails.setArtifactLabel("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
+
+		if(componentInstance != null) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+
+		}
+	}
+		
+		
+	// Update artifact with valid type & invalid label via external API - label is empty
+	protected void updateArtifactWithInvalidLabelEmpty(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		if(componentInstance != null) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+					
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
+		List<String> variables = asList("artifact label");
+		artifactReqDetails.setArtifactLabel("");
+		
+		if(componentInstance != null) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+
+		}
+	}
+	
+	
+	// Update artifact with invalid description via external API - to long description
+	protected void updateArtifactWithInvalidDescriptionToLong(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		if(componentInstance != null) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+					
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+			
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_LOGICAL_NAME_CANNOT_BE_CHANGED.name());
+		List<String> variables = asList();
+		artifactReqDetails.setDescription("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
+		
+		if(componentInstance != null) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+
+		}
+	}
+			
+			
+	// Update artifact with invalid description via external API - empty description
+	protected void updateArtifactWithInvalidDescriptionEmpty(Component component, User sdncModifierDetails, String artifactType,
+			ComponentInstance componentInstance) throws Exception {
+		
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		if(componentInstance != null) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+					
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_LOGICAL_NAME_CANNOT_BE_CHANGED.name());
+		List<String> variables = asList("artifact description");
+		artifactReqDetails.setDescription("");
+		
+		if(componentInstance != null) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					400, null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
+
+		}
+	}
+	
+
+
+	
+	
+	
+	
+	
+	
+	// Unhappy flow - get chosen life cycle state, artifact type and asset type
+	// update artifact via external API + check audit & response code
+	// Download artifact via external API + check audit & response code
+	// Check artifact version, uuid & checksusm
+	protected Component updateArtifactOnAssetViaExternalAPI(Component component, ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ErrorInfo errorInfo, List<String> variables, UserRoleEnum userRoleEnum, Integer expectedResponseCode) throws Exception {
+		String componentVersionBeforeUpdate = null;
+				
+		// get updated artifact data
+		component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
+		componentVersionBeforeUpdate = component.getVersion();
+		
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		ArtifactReqDetails artifactReqDetails = getUpdatedArtifact(deploymentArtifacts, artifactType);
+		
+		String artifactName = artifactReqDetails.getArtifactLabel();
+		String artifactUUID = deploymentArtifacts.get(artifactName).getArtifactUUID();
+		String artifactVersionBeforeUpdate = deploymentArtifacts.get(artifactName).getArtifactVersion();
+		int numberOfArtifact = deploymentArtifacts.size();		
+				
+		// create component/s & upload artifact via external api
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
+					expectedResponseCode, component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, chosenLifeCycleState, true);
+		} else {
+			updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
+					expectedResponseCode, null, artifactReqDetails, artifactUUID, errorInfo, variables, chosenLifeCycleState, true);
+		}
+		
+		if(component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
+			component = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
+		} else {
+			component = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
+		}
+			
+		// Get list of deployment artifact + download them via external API
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
+			deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+		Assert.assertEquals(numberOfArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will be same as before.");
+		Assert.assertEquals(String.valueOf((Integer.parseInt(artifactVersionBeforeUpdate))), deploymentArtifacts.get(artifactName).getArtifactVersion(), "Expected that aftifact will not change.");
+		Assert.assertEquals(artifactUUID, deploymentArtifacts.get(artifactName).getArtifactUUID(), "Expected that aftifactUUID will not change.");
+		Assert.assertEquals(componentVersionBeforeUpdate, component.getVersion(), "Expected that check-out component will not change version number.");
+
+		return component;
+	}
+	
+	protected RestResponse updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails,
+			Integer expectedResponseCode, ComponentInstance componentInstance, ArtifactReqDetails artifactReqDetails, String artifactUUID, ErrorInfo errorInfo, List<String> variables, LifeCycleStatesEnum lifeCycleStatesEnum, Boolean resourceNameInAudit) throws Exception {
+		RestResponse restResponse;
+		
+		if(componentInstance != null) {
+			restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfComponentInstanceOnAsset(resourceDetails, sdncModifierDetails, artifactReqDetails, componentInstance, artifactUUID);
+		} else {
+			restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfTheAsset(resourceDetails, sdncModifierDetails, artifactReqDetails, artifactUUID);
+
+		}
+		
+		// validate response code
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		//TODO
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+				
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPDATE_BY_API;
+				
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+//		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		
+		responseArtifact.setUpdaterFullName("");
+		responseArtifact.setUserIdLastUpdater(sdncModifierDetails.getUserId());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditFailure(assetTypeEnum, action, responseArtifact, resourceDetails.getUUID(), errorInfo, variables);
+		expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getName());
+		expectedExternalAudit.setRESOURCE_TYPE(resourceDetails.getComponentType().getValue());
+		expectedExternalAudit.setARTIFACT_DATA("");
+		expectedExternalAudit.setCURR_ARTIFACT_UUID(artifactUUID);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, responseCode.toString());
+		if(componentInstance != null) {
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getComponentInstances().get(0).getNormalizedName());
+			expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + resourceDetails.getComponentInstances().get(0).getNormalizedName() + "/artifacts/" + artifactUUID);
+			expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getComponentInstances().get(0).getNormalizedName());
+		} else {
+			expectedExternalAudit.setRESOURCE_URL(expectedExternalAudit.getRESOURCE_URL() + "/" + artifactUUID);
+			if((lifeCycleStatesEnum == LifeCycleStatesEnum.CHECKIN) || (lifeCycleStatesEnum == LifeCycleStatesEnum.STARTCERTIFICATION)) {
+				if(resourceNameInAudit) {
+					expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getName());
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+				} else {
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+//					body.put(AuditingFieldsKeysEnum.AUDIT_CURR_ARTIFACT_UUID, artifactUUID);
+					expectedExternalAudit.setRESOURCE_NAME("");
+				}			
+			} else {
+				body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+			}
+		}
+			
+		
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPDATE_BY_API.getName(), body);
+		return restResponse;
+	
+	}
+	
+	
+	// This function get component, user & if updatedPayload or not
+	// It will create default payload / updated payload of artifact
+	// And download artifact of component which starts with ci
+	protected RestResponse downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(Component component, String artifactType, User sdncModifierDetails, ComponentTypeEnum componentTypeEnum) throws IOException, Exception {
+		// Download the uploaded artifact via external API
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("abcd", artifactType, true, false);
+		String artifactName = null;
+		for (String key : component.getDeploymentArtifacts().keySet()) {
+			if (key.startsWith("ci")) {
+				artifactName = key;
+				break;
+			}
+		}
+		return downloadResourceDeploymentArtifactExternalAPI(component, component.getDeploymentArtifacts().get(artifactName), sdncModifierDetails, artifactReqDetails, componentTypeEnum);
+	}
+	
+	// Get deployment artifact of asset
+	protected Map<String, ArtifactDefinition> getDeploymentArtifactsOfAsset(Component component, ComponentTypeEnum componentTypeEnum) {
+		Map<String, ArtifactDefinition> deploymentArtifacts = null;
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
+			for(ComponentInstance componentInstance: component.getComponentInstances()) {
+				if(componentInstance.getNormalizedName().startsWith("ci")) {
+					deploymentArtifacts = componentInstance.getDeploymentArtifacts();
+					break;
+				}
+			}
+		} else {
+			deploymentArtifacts = component.getDeploymentArtifacts();
+		}
+		return deploymentArtifacts;
+	}
+	
+	// get deploymentArtifact of asset and artifactType -> generate new artifact that can be updated on the asset
+	protected ArtifactReqDetails getUpdatedArtifact(Map<String, ArtifactDefinition> deploymentArtifacts, String artifactType) throws IOException, Exception {
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactReqDetails.setArtifactDisplayName(deploymentArtifacts.get(key).getArtifactDisplayName());
+				artifactReqDetails.setArtifactName(deploymentArtifacts.get(key).getArtifactName());
+				artifactReqDetails.setArtifactLabel(deploymentArtifacts.get(key).getArtifactLabel());
+				break;
+			}
+		}
+		
+		return artifactReqDetails;
+	}
+	
+	// Happy flow - get chosen life cycle state, artifact type and asset type
+	// update artifact via external API + check audit & response code
+	// Download artifact via external API + check audit & response code
+	// Check artifact version, uuid & checksusm
+	protected Component updateArtifactOnAssetViaExternalAPI(Component component, ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
+		RestResponse restResponse = null;
+		int numberOfArtifact = 0;
+		String artifactVersionBeforeUpdate = null;
+		String artifactName = null;
+		String componentVersionBeforeUpdate = null;
+			
+		// get updated artifact data
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
+		String artifactUUID = null;
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactName = key;
+				artifactVersionBeforeUpdate = deploymentArtifacts.get(key).getArtifactVersion();
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				artifactReqDetails.setArtifactDisplayName(deploymentArtifacts.get(key).getArtifactDisplayName());
+				artifactReqDetails.setArtifactName(deploymentArtifacts.get(key).getArtifactName());
+				artifactReqDetails.setArtifactLabel(deploymentArtifacts.get(key).getArtifactLabel());
+				break;
+			}
+		}
+		
+		component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
+		componentVersionBeforeUpdate = component.getVersion();
+		deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		numberOfArtifact = deploymentArtifacts.size();
+		
+		
+		// create component/s & upload artifact via external api
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
+			if((chosenLifeCycleState == LifeCycleStatesEnum.CERTIFICATIONREQUEST) && (!component.getComponentType().toString().equals(ComponentTypeEnum.RESOURCE.toString()))) {
+				numberOfArtifact = numberOfArtifact - 1;
+			}
+ 			restResponse = updateArtifactOfRIIncludingValiditionOfAuditAndResponseCode(component, component.getComponentInstances().get(0), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, artifactUUID, 200);
+		} else {
+			
+			restResponse = updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, artifactUUID, 200);
+		}
+			
+			
+			
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		component = getNewerVersionOfComponent(component, chosenLifeCycleState);
+			
+		// Get list of deployment artifact + download them via external API
+		deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		Assert.assertEquals(numberOfArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will be same as before.");
+		Assert.assertEquals(String.valueOf((Integer.parseInt(artifactVersionBeforeUpdate) + 1)), deploymentArtifacts.get(artifactName).getArtifactVersion(), "Expected that aftifact version will increase by one.");
+		
+		if(chosenLifeCycleState == LifeCycleStatesEnum.CHECKOUT) {
+			Assert.assertEquals(componentVersionBeforeUpdate, component.getVersion(), "Expected that check-out component will not change version number.");
+		} else {
+			Assert.assertEquals(String.format("%.1f", (Double.parseDouble(componentVersionBeforeUpdate) + 0.1)), component.getVersion(), "Expected that non check-out component version will increase by 0.1.");
+		}
+		
+		// Download the uploaded artifact via external API
+		downloadResourceDeploymentArtifactExternalAPI(component, deploymentArtifacts.get(responseArtifact.getArtifactLabel()), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentTypeEnum);
+		
+		return component;
+	}
+	
+	
+	// Update artifact via external API + Check auditing for upload operation + Check response of external API
+	protected RestResponse updateArtifactOfRIIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, ComponentInstance componentInstance, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
+		RestResponse restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfComponentInstanceOnAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, resourceDetails.getComponentInstances().get(0), artifactUUID);
+		
+		// Check response of external API
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPDATE_BY_API;
+		
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, componentInstance.getNormalizedName());
+		
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+//		expectedExternalAudit.setRESOURCE_URL(expectedExternalAudit.getRESOURCE_URL()+ "/" + artifactUUID);
+		expectedExternalAudit.setRESOURCE_NAME(componentInstance.getNormalizedName());
+		expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + componentInstance.getNormalizedName() + "/artifacts/" + artifactUUID);
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPDATE_BY_API.getName(), body);
+		
+		return restResponse;
+	}
+	
+	
+	// Update artifact via external API + Check auditing for upload operation + Check response of external API
+	protected RestResponse updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
+		RestResponse restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfTheAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, artifactUUID);
+		
+		// Check response of external API
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_UPDATE_BY_API;
+		
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		expectedExternalAudit.setRESOURCE_URL(expectedExternalAudit.getRESOURCE_URL()+ "/" + artifactUUID);
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_UPDATE_BY_API.getName(), body);
+		
+		return restResponse;
+	}
+	
+	
+	
+	
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	//					Delete External API											  //
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	////////////////////////////////////////////////////////////////////////////////////
+	@DataProvider(name="deleteArtifactForServiceViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactForServiceViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER"},
+			{LifeCycleStatesEnum.CERTIFY, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFY, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFY, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFY, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFY, "OTHER"}
+			};
+	}
+	
+	
+	
+	
+	// Delete artifact for Service - Success
+	@Test(dataProvider="deleteArtifactForServiceViaExternalAPI")
+	public void deleteArtifactForServiceViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
+		deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.SERVICE, lifeCycleStatesEnum);
+	}
+	
+	@DataProvider(name="deleteArtifactForVFViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactForVFViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CHECKOUT, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CHECKIN, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML"},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_JSON"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_POLICY"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_EVENT"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "APPC_CONFIG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_DOC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_TOSCA"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC"},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER"},
+			};
+	}
+	
+	
+	// Delete artifact for VF - Success
+	@Test(dataProvider="deleteArtifactForVFViaExternalAPI")
+	public void deleteArtifactForVFViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
+		deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum);
+	}
+	
+	@DataProvider(name="deleteArtifactForVfcVlCpViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactForVfcVlCpViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKIN, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "YANG_XML", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VNF_CATALOG", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VF_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "VENDOR_LICENSE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_INVENTORY_PROFILE", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "MODEL_QUERY_SPEC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "OTHER", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.CP}
+			};
+	}
+	
+	
+	// Delete artifact for VFC, VL, CP - Success
+	@Test(dataProvider="deleteArtifactForVfcVlCpViaExternalAPI")
+	public void deleteArtifactForVfcVlCpViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s, resourceTypeEnum: %s", lifeCycleStatesEnum, artifactType, resourceTypeEnum));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
+		deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum);
+	}
+	
+	@DataProvider(name="deleteArtifactOnRIViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactOnRIViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", null},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", null},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", null},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", null},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VF},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VF}
+			
+			};
+	}
+	
+	
+	
+	
+	
+	@Test(dataProvider="deleteArtifactOnRIViaExternalAPI")
+	public void deleteArtifactOnRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
+		deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState);
+	}
+	
+	
+	@DataProvider(name="deleteArtifactOnVfcVlCpRIViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactOnVfcVlCpRIViaExternalAPI() {
+		return new Object[][] {
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP,},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKOUT, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CHECKIN, "SNMP_TRAP", ResourceTypeEnum.CP},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VFC},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VFC},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.VL},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.VL},
+			
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_JSON", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_POLICY", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_DOC", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_BLUEPRINT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "DCAE_INVENTORY_EVENT", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_POLL", ResourceTypeEnum.CP},
+			{LifeCycleStatesEnum.CERTIFICATIONREQUEST, "SNMP_TRAP", ResourceTypeEnum.CP}
+			
+			};
+	}
+	
+	
+	
+	
+	
+	@Test(dataProvider="deleteArtifactOnVfcVlCpRIViaExternalAPI")
+	public void deleteArtifactOnVfcVlCpRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
+		deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState);
+	}
+	
+	
+	@DataProvider(name="deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset() {
+		return new Object[][] {
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.DESIGNER2, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+//			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_STRATEGIST1, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKIN, "DCAE_INVENTORY_TOSCA"},
+			{ComponentTypeEnum.RESOURCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.SERVICE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.PRODUCT_MANAGER1, LifeCycleStatesEnum.CHECKOUT, "DCAE_INVENTORY_TOSCA"},
+			};
+	}
+		
+
+	// External API
+	// Delete artifact by diffrent user then creator of asset - Fail
+	@Test(dataProvider="deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset")
+	public void deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset(ComponentTypeEnum componentTypeEnum, UserRoleEnum userRoleEnum, LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, userRoleEnum %s, lifeCycleStatesEnum %s, artifactType: %s", componentTypeEnum, userRoleEnum, lifeCycleStatesEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, lifeCycleStatesEnum, artifactType, null);
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		
+		String artifactUUID = null;
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
+		List<String> variables = asList();
+		
+		if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
+					409, component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, lifeCycleStatesEnum, true);
+		} else {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
+					409, null, artifactUUID, errorInfo, variables, lifeCycleStatesEnum, true);
+		}
+			
+		//TODO
+//		downloadResourceDeploymentArtifactExternalAPI(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, componentTypeEnum);
+	}
+	
+	
+	@DataProvider(name="deleteArtifactOnAssetWhichNotExist", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactOnAssetWhichNotExist() {
+		return new Object[][] {
+			{ComponentTypeEnum.SERVICE, "OTHER", null},
+			{ComponentTypeEnum.RESOURCE, "OTHER", null},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, "DCAE_INVENTORY_TOSCA", ResourceTypeEnum.VF},
+			};
+	}
+		
+
+	// External API
+	// Upload artifact on VF via external API - happy flow
+	@Test(dataProvider="deleteArtifactOnAssetWhichNotExist")
+	public void deleteArtifactOnAssetWhichNotExist(ComponentTypeEnum componentTypeEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, resourceTypeEnum);
+		
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		
+		String artifactUUID = null;
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		// Invalid artifactUUID
+		String invalidArtifactUUID = "12341234-1234-1234-1234-123412341234";
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
+		List<String> variables = asList(invalidArtifactUUID);
+		
+		if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, component.getComponentInstances().get(0), invalidArtifactUUID, errorInfo, variables, null, true);
+		} else {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, null, invalidArtifactUUID, errorInfo, variables, null, true);
+
+		}
+		
+		
+		// Invalid componentUUID	
+		if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
+			component.getComponentInstances().get(0).setNormalizedName("invalidNormalizedName");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER.name());
+			variables = asList("invalidNormalizedName", ComponentTypeEnum.RESOURCE_INSTANCE.getValue().toLowerCase(), ComponentTypeEnum.SERVICE.getValue(), component.getName());
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, true);
+		} else {
+			component.setUUID("invalidComponentUUID");
+			if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE)) {
+				errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
+			} else {
+				errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name());
+			}
+			variables = asList("invalidComponentUUID");
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					404, null, artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, false);
+		}
+		
+		
+//		performeClean();
+		
+	}
+	
+	@DataProvider(name="deleteArtifactOnAssetWhichInInvalidStateForUploading", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactOnAssetWhichInInvalidStateForUploading() {
+		return new Object[][] {
+			{ComponentTypeEnum.SERVICE, "OTHER"},
+			{ComponentTypeEnum.RESOURCE, "OTHER"},
+			{ComponentTypeEnum.RESOURCE_INSTANCE, "DCAE_INVENTORY_TOSCA"},
+			};
+	}
+	
+	
+	@Test(dataProvider="deleteArtifactOnAssetWhichInInvalidStateForUploading")
+	public void deleteArtifactOnAssetWhichInInvalidStateForUploading(ComponentTypeEnum componentTypeEnum, String artifactType) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
+		Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
+		component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
+		
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		String artifactUUID = null;
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		
+		
+		// Invalid artifactUUID
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
+		List<String> variables = asList(component.getName(), component.getComponentType().toString().toLowerCase(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getFirstName(),
+				ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getLastName(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getUserId());
+		
+		if(componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					403, component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, null, true);
+		} else {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+					403, null, artifactUUID, errorInfo, variables, null, true);
+
+		}
+		
+	}
+	
+	
+	@DataProvider(name="deleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI", parallel=true) 
+	public static Object[][] dataProviderDeleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI() {
+		return new Object[][] {
+			{ResourceTypeEnum.VFC},
+			{ResourceTypeEnum.VL},
+			{ResourceTypeEnum.CP}
+			};
+	}
+	
+	
+	// Verify that it cannot delete VFC/VL/CP artifact on VFCi/VLi/CPi - Failure flow
+	@Test(dataProvider="deleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI")
+	public void deleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI(ResourceTypeEnum resourceTypeEnum) throws Exception {
+		getExtendTest().log(Status.INFO, String.format("resourceTypeEnum: %s", resourceTypeEnum));
+		
+		Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, resourceTypeEnum);
+		ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", "SNMP_TRAP", true, false);
+		uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceInstanceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
+		resourceInstanceDetails = AtomicOperationUtils.changeComponentState(resourceInstanceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		Component component = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
+		component = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
+		
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
+		Map<String, ArtifactDefinition> deploymentArtifacts;
+		deploymentArtifacts = getDeploymentArtifactsOfAsset(component, ComponentTypeEnum.RESOURCE_INSTANCE);
+		String artifactUUID = null;
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")) {
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				break;
+			}
+		}
+		List<String> variables = asList(artifactUUID);
+		deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
+				404, component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, null, true);
+	}
+	
+	protected RestResponse deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails,
+			Integer expectedResponseCode, ComponentInstance componentInstance, String artifactUUID, ErrorInfo errorInfo, List<String> variables, LifeCycleStatesEnum lifeCycleStatesEnum, Boolean resourceNameInAudit) throws Exception {
+		RestResponse restResponse;
+		
+		if(componentInstance != null) {
+			restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfComponentInstanceOnAsset(resourceDetails, sdncModifierDetails, componentInstance, artifactUUID);
+		} else {
+			restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfTheAsset(resourceDetails, sdncModifierDetails, artifactUUID);
+
+		}
+		
+		// validate response code
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+				
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_DELETE_BY_API;
+				
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+//		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		
+		responseArtifact.setUpdaterFullName("");
+		responseArtifact.setUserIdLastUpdater(sdncModifierDetails.getUserId());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditFailure(assetTypeEnum, action, responseArtifact, resourceDetails.getUUID(), errorInfo, variables);
+		expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getName());
+		expectedExternalAudit.setRESOURCE_TYPE(resourceDetails.getComponentType().getValue());
+		expectedExternalAudit.setARTIFACT_DATA(null);
+		expectedExternalAudit.setCURR_ARTIFACT_UUID(artifactUUID);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, responseCode.toString());
+		if(componentInstance != null) {
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getComponentInstances().get(0).getNormalizedName());
+			expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + resourceDetails.getComponentInstances().get(0).getNormalizedName() + "/artifacts/" + artifactUUID);
+			expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getComponentInstances().get(0).getNormalizedName());
+		} else {
+			expectedExternalAudit.setRESOURCE_URL(expectedExternalAudit.getRESOURCE_URL() + "/" + artifactUUID);
+			if((errorInfo.getMessageId().equals(ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name()).getMessageId())) || 
+					errorInfo.getMessageId().equals(ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name()).getMessageId()) ||
+					(lifeCycleStatesEnum == LifeCycleStatesEnum.STARTCERTIFICATION)) {
+				if(resourceNameInAudit) {
+					expectedExternalAudit.setRESOURCE_NAME(resourceDetails.getName());
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+				} else {
+					expectedExternalAudit.setRESOURCE_NAME("");
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+				}
+			} else {
+				if(resourceNameInAudit) {
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+				} else {
+					expectedExternalAudit.setRESOURCE_NAME("");
+					body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+				}
+			}
+		}
+		
+//		getExtendTest().log(LogStatus.INFO, "Audit Action: " + AuditingActionEnum.ARTIFACT_DELETE_BY_API.getName());
+//		body.forEach((k,v)->getExtendTest().log(LogStatus.INFO,"key : " + k + " value : " + v));
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_DELETE_BY_API.getName(), body);
+		
+		return restResponse;
+	
+	}
+	
+	
+	// Happy flow - get chosen life cycle state, artifact type and asset type
+	// delete artifact via external API + check audit & response code
+	protected Component deleteArtifactOnAssetViaExternalAPI(Component component, ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState) throws Exception {
+		String artifactName = null;
+		component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
+			
+		// get updated artifact data
+		String artifactUUID = null;
+		int moduleTypeArtifact = 0;
+		Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		
+		for (String key : deploymentArtifacts.keySet()) {
+			if (key.startsWith("ci")  && StringUtils.isNotEmpty(deploymentArtifacts.get(key).getArtifactUUID())) {
+				artifactName = key;
+				artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
+				
+				if (deploymentArtifacts.get(key).getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA)){
+					moduleTypeArtifact = 1; 
+				}
+				break;
+			}
+		}
+			
+		
+		String componentVersionBeforeDelete = component.getVersion();
+		int numberOfArtifact = deploymentArtifacts.size();
+		
+			
+				
+		// create component/s & upload artifact via external api
+		if(ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
+			deleteArtifactOfRIIncludingValiditionOfAuditAndResponseCode(component, component.getComponentInstances().get(0), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, 200);
+		} else {
+			deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, 200);
+		}	
+				
+		component = getNewerVersionOfComponent(component, chosenLifeCycleState);
+			
+		// Get list of deployment artifact + download them via external API
+		deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
+		if(deploymentArtifacts.get(artifactName) != null) {
+			Assert.assertTrue(false, "Expected that deleted artifact will not appear in deployment artifact list.");
+		}
+		if((LifeCycleStatesEnum.CERTIFICATIONREQUEST.equals(chosenLifeCycleState)) && (ComponentTypeEnum.RESOURCE_INSTANCE.equals(componentTypeEnum)) && (!component.getComponentType().toString().equals(ComponentTypeEnum.RESOURCE.toString()))) {
+			Assert.assertEquals(numberOfArtifact - 1 - moduleTypeArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact (one deleted and one vfmodule) will decrease by two.");
+		} else {
+			Assert.assertEquals(numberOfArtifact - 1, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will decrease by one.");
+		}
+		
+
+		if(chosenLifeCycleState == LifeCycleStatesEnum.CHECKOUT) {
+			Assert.assertEquals(componentVersionBeforeDelete, component.getVersion(), "Expected that check-out component will not change version number.");
+		} else {
+			Assert.assertEquals(String.format("%.1f", (Double.parseDouble(componentVersionBeforeDelete) + 0.1)), component.getVersion(), "Expected that non check-out component version will increase by 0.1.");
+		}
+		
+		downloadResourceDeploymentArtifactExternalAPI(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, componentTypeEnum);
+		
+		return component;
+	}
+	
+	// Delete artifact via external API + Check auditing for upload operation + Check response of external API
+	protected RestResponse deleteArtifactOfRIIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, ComponentInstance componentInstance, User sdncModifierDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
+		RestResponse restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfComponentInstanceOnAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getComponentInstances().get(0), artifactUUID);
+		
+		// Check response of external API
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_DELETE_BY_API;
+		
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, componentInstance.getNormalizedName());
+		
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+//		expectedExternalAudit.setRESOURCE_URL(expectedExternalAudit.getRESOURCE_URL()+ "/" + artifactUUID);
+		expectedExternalAudit.setRESOURCE_NAME(componentInstance.getNormalizedName());
+		expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetTypeEnum.getValue() + "/" + resourceDetails.getUUID() + "/resourceInstances/" + componentInstance.getNormalizedName() + "/artifacts/" + artifactUUID);
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_DELETE_BY_API.getName(), body);
+		
+		return restResponse;
+	}
+	
+	
+	// Delete artifact via external API + Check auditing for upload operation + Check response of external API
+	protected RestResponse deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component resourceDetails, User sdncModifierDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
+		RestResponse restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfTheAsset(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID);
+		
+		// Check response of external API
+		Integer responseCode = restResponse.getErrorCode();
+		Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
+		
+		
+		// Check auditing for upload operation
+		ArtifactDefinition responseArtifact = getArtifactDataFromJson(restResponse.getResponse());
+		
+		AuditingActionEnum action = AuditingActionEnum.ARTIFACT_DELETE_BY_API;
+		
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+		
+		AssetTypeEnum assetTypeEnum = AssetTypeEnum.valueOf((resourceDetails.getComponentType().getValue() + "s").toUpperCase());
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalArtifactAuditSuccess(assetTypeEnum, action, responseArtifact, resourceDetails);
+		expectedExternalAudit.setRESOURCE_URL(expectedExternalAudit.getRESOURCE_URL()+ "/" + artifactUUID);
+		AuditValidationUtils.validateExternalAudit(expectedExternalAudit, AuditingActionEnum.ARTIFACT_DELETE_BY_API.getName(), body);
+		
+		return restResponse;
+	}
+	
+	
+	
+	// download deployment via external api + check response code for success (200) + get artifactReqDetails and verify payload + verify audit
+	protected RestResponse downloadResourceDeploymentArtifactExternalAPI(Component resourceDetails, User sdncModifierDetails, String artifactUUID, ComponentTypeEnum componentTypeEnum) throws Exception {
+		RestResponse restResponse;
+		
+		if(componentTypeEnum == ComponentTypeEnum.RESOURCE_INSTANCE) {
+			restResponse = ArtifactRestUtils.getComponentInstanceDeploymentArtifactExternalAPI(resourceDetails.getUUID(), resourceDetails.getComponentInstances().get(0).getNormalizedName(), artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getComponentType().toString());
+		} else {
+			restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceDetails.getUUID(), artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), resourceDetails.getComponentType().toString());
+		}
+		
+		Integer responseCode = restResponse.getErrorCode();
+		Integer expectedCode = 404;
+		Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
+		
+		
+		//TODO - including body - resourceDetails.getName()
+//			// Verify audit
+//			String auditAction = "DownloadArtifact";
+//			
+//			Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+//			body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, responseCode.toString());
+//			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
+//			
+//			ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
+//			expectedResourceAuditJavaObject.setAction(auditAction);
+//			expectedResourceAuditJavaObject.setResourceType(resourceDetails.getComponentType().getValue());
+//			expectedResourceAuditJavaObject.setStatus("200");
+//			expectedResourceAuditJavaObject.setDesc("OK");
+//			expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
+//			
+//			if(componentTypeEnum == ComponentTypeEnum.RESOURCE_INSTANCE) {
+//				expectedResourceAuditJavaObject.setResourceName(resourceDetails.getComponentInstances().get(0).getName());
+//				String resource_url = String.format("/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s", resourceDetails.getUUID(), resourceDetails.getComponentInstances().get(0).getNormalizedName(), artifactDefinition.getArtifactUUID());
+//				expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+//					
+//				AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+//			} else {
+//				expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName());
+//				String resource_url = String.format("/sdc/v1/catalog/services/%s/artifacts/%s", resourceDetails.getUUID(), artifactDefinition.getArtifactUUID());
+//				expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
+//			}
+//			
+//			AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
+			
+		return restResponse;
+			
+	}
+	
+	
+	
+	
+	public Component getComponentInTargetLifeCycleState(String componentType, UserRoleEnum creatorUser, LifeCycleStatesEnum targetLifeCycleState, ResourceTypeEnum resourceTypeEnum) throws Exception {
+		Component resourceDetails = null;
+		
+		if((componentType.toLowerCase().equals("vf")) || (componentType.toLowerCase().equals("resource"))){
+			if(resourceTypeEnum==null) {
+				resourceTypeEnum = ResourceTypeEnum.VF;
+			}
+			Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(resourceTypeEnum, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, creatorUser, true);
+			resourceDetails = createdResource.left().value();
+			resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, creatorUser, targetLifeCycleState, true).getLeft();
+		} else {
+			Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(creatorUser, true);
+			resourceDetails = createdResource.left().value();
+			// Add artifact to service if asked for certifcationrequest - must be at least one artifact for the flow
+			if((LifeCycleStatesEnum.CERTIFICATIONREQUEST == targetLifeCycleState) || (LifeCycleStatesEnum.STARTCERTIFICATION == targetLifeCycleState)) {
+						AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetails, UserRoleEnum.DESIGNER, true, true).left().value();
+			}
+			resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, creatorUser, targetLifeCycleState, true).getLeft();
+		}
+		
+		return resourceDetails;
+	}
+	
+	
+	
+	
+	
+	protected String createUploadArtifactBodyJson() {
+		Map<String, Object> jsonBody = new HashMap<String, Object>();
+		jsonBody.put("artifactName", UPLOAD_ARTIFACT_NAME);
+		jsonBody.put("artifactDisplayName", "configure");
+		jsonBody.put("artifactType", "SHELL");
+		jsonBody.put("mandatory", "false");
+		jsonBody.put("description", "ff");
+		jsonBody.put("payloadData", UPLOAD_ARTIFACT_PAYLOAD);
+		jsonBody.put("artifactLabel", "configure");
+		return gson.toJson(jsonBody);
+	}
+	
+	protected ArtifactDefinition getArtifactDataFromJson(String content) {
+		JsonObject jsonElement = new JsonObject();
+		ArtifactDefinition resourceInfo = null;
+		
+		try {
+			Gson gson = new Gson();
+			jsonElement = gson.fromJson(content, jsonElement.getClass());
+			JsonElement artifactGroupValue = jsonElement.get(Constants.ARTIFACT_GROUP_TYPE_FIELD);
+			if (artifactGroupValue != null && !artifactGroupValue.isJsonNull()) {
+				String groupValueUpper = artifactGroupValue.getAsString().toUpperCase();
+				if (!ArtifactGroupTypeEnum.getAllTypes().contains(groupValueUpper)) {
+					StringBuilder sb = new StringBuilder();
+					for (String value : ArtifactGroupTypeEnum.getAllTypes()) {
+						sb.append(value).append(", ");
+					}
+					log.debug("artifactGroupType is {}. valid values are: {}", groupValueUpper, sb.toString());
+					return null;
+				} else {
+					jsonElement.remove(Constants.ARTIFACT_GROUP_TYPE_FIELD);
+					jsonElement.addProperty(Constants.ARTIFACT_GROUP_TYPE_FIELD, groupValueUpper);
+				}
+			}
+			String payload = null;
+			JsonElement artifactPayload = jsonElement.get(Constants.ARTIFACT_PAYLOAD_DATA);
+			if (artifactPayload != null && !artifactPayload.isJsonNull()) {
+				payload = artifactPayload.getAsString();
+			}
+			jsonElement.remove(Constants.ARTIFACT_PAYLOAD_DATA);
+			String json = gson.toJson(jsonElement);
+			ObjectMapper mapper = new ObjectMapper();
+			mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+			mapper.configure(Feature.FAIL_ON_EMPTY_BEANS, false);
+			mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+			
+			resourceInfo = mapper.readValue(json, ArtifactDefinition.class);
+			resourceInfo.setPayloadData(payload);
+
+		} catch (Exception e) {
+			BeEcompErrorManager.getInstance().processEcompError(EcompErrorName.BeArtifactInformationInvalidError, "Artifact Upload / Update");
+			BeEcompErrorManager.getInstance().logBeArtifactInformationInvalidError("Artifact Upload / Update");
+			log.debug("Failed to convert the content {} to object.", content.substring(0, Math.min(50, content.length())), e);
+		}
+
+		return resourceInfo;
+	}
+	
+	protected HttpGet createGetRequest(String url) {
+		HttpGet httpGet = new HttpGet(url);
+		httpGet.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		httpGet.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		httpGet.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		return httpGet;
+	}
+	
+	protected String getArtifactUid(HttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		String artifactId = (String) responseMap.get("uniqueId");
+		return artifactId;
+	}
+	
+	protected String getArtifactEsId(HttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		String esId = (String) responseMap.get("EsId");
+		return esId;
+	}
+	
+	protected ArtifactDefinition addArtifactDataFromResponse(HttpResponse response, ArtifactDefinition artifact) throws HttpResponseException, IOException, ParseException {
+		//String responseString = new BasicResponseHandler().handleResponse(response);
+		HttpEntity entity = response.getEntity();
+		String responseString = EntityUtils.toString(entity);				
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		artifact.setEsId((String)responseMap.get("esId"));
+		artifact.setUniqueId((String) responseMap.get("uniqueId"));
+		artifact.setArtifactGroupType(ArtifactGroupTypeEnum.findType((String) responseMap.get("artifactGroupType")));
+		artifact.setTimeout(((Long) responseMap.get("timeout")).intValue());
+		return artifact;
+	}
+	
+	protected String getLifecycleArtifactUid(CloseableHttpResponse response) throws HttpResponseException, IOException, ParseException {
+		String responseString = new BasicResponseHandler().handleResponse(response);
+		JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
+		responseMap = (JSONObject) responseMap.get("implementation");
+		String artifactId = (String) responseMap.get("uniqueId");
+		return artifactId;
+	}
+	
+	protected HttpDelete createDeleteArtifactRequest(String url) {
+		HttpDelete httpDelete = new HttpDelete(url);
+		httpDelete.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		httpDelete.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		return httpDelete;
+	}
+	
+	protected HttpPost createPostAddArtifactRequeast(String jsonBody, String url, boolean addMd5Header) throws UnsupportedEncodingException {
+		HttpPost httppost = new HttpPost(url);
+		httppost.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
+		httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
+		httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		if (addMd5Header) {
+			httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody));
+		}
+		StringEntity input = new StringEntity(jsonBody);
+		input.setContentType("application/json");
+		httppost.setEntity(input);
+		log.debug("Executing request {}" , httppost.getRequestLine());
+		return httppost;
+	}
+	
+	protected String createLoadArtifactBody() {
+		Map<String, Object> json = new HashMap<String, Object>();
+		json.put("artifactName", "install_apache2.sh");
+		json.put("artifactType", "SHELL");
+		json.put("description", "ddd");
+		json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
+		json.put("artifactLabel", "name123");
+		
+		String jsonStr = gson.toJson(json);
+		return jsonStr;
+	}
+	
+	protected void checkDeleteResponse(RestResponse response) {
+		BaseRestUtils.checkStatusCode(response, "delete request failed", false, 204, 404);
+	}
+	
+	protected ArtifactUiDownloadData getArtifactUiDownloadData(String artifactUiDownloadDataStr) throws Exception {
+		
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			ArtifactUiDownloadData artifactUiDownloadData = mapper.readValue(artifactUiDownloadDataStr, ArtifactUiDownloadData.class);
+			return artifactUiDownloadData;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java
new file mode 100644
index 0000000..91a7b12
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java
@@ -0,0 +1,428 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.io.FileUtils;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.common.util.ZipUtil;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import org.yaml.snakeyaml.Yaml;
+
+import com.aventstack.extentreports.Status;
+
+
+
+
+
+
+
+public class DeploymentValiditaion extends ComponentBaseTest{
+
+
+	
+	
+	@Rule
+	public static TestName name = new TestName();
+
+	public DeploymentValiditaion() {
+		super(name, DeploymentValiditaion.class.getName());
+	}
+	
+	protected final static String categoryFilterKey = "category";
+	protected final static String subCategoryFilterKey = "subCategory";
+	protected  String attVersionStr ;
+	
+	
+	 public static List<File> listf(String directoryName) {
+	        File directory = new File(directoryName);
+
+	        List<File> resultList = new ArrayList<File>();
+
+	        // get all the files from a directory
+	        File[] fList = directory.listFiles();
+	        resultList.addAll(Arrays.asList(fList));
+	        for (File file : fList) {
+	            if (file.isFile()) {
+	                System.out.println(file.getAbsolutePath());
+	            } else if (file.isDirectory()) {
+	                resultList.addAll(listf(file.getAbsolutePath()));
+	            }
+	        }
+	        //System.out.println(fList);
+	        return resultList;
+	    } 
+	@BeforeTest
+	public void beforeTest() throws Exception{
+		RestResponse attVersion = CatalogRestUtils.getOsVersion();
+		attVersionStr = ResponseParser.getVersionFromResponse(attVersion);
+	}
+	
+	
+	@Test
+	public void pasrseNormativies() throws Exception{
+		
+		
+		String path = "//apps//asdc_kits//catalog-be-" + attVersionStr + "//import//tosca//normative-types";
+		String path2 = "//apps//asdc_kits//catalog-be-" + attVersionStr + "//import//tosca//heat-types";
+				
+//		String path = "C:\\Git_work\\Git_UGN\\d2-sdnc\\catalog-be\\src\\main\\resources\\import\\tosca\\normative-types";
+//		String path2 = "C:\\Git_work\\Git_UGN\\d2-sdnc\\catalog-be\\src\\main\\resources\\import\\tosca\\heat-types";
+
+		
+		List<File> yamlList1 = getYamlFilesList(path);		
+		List<String> nodeNamesFromYamlList1 = getNodeNamesFromYamlList(yamlList1);
+		List<File> yamlList2 = getYamlFilesList(path2);		
+		List<String> nodeNamesFromYamlList2 = getNodeNamesFromYamlList(yamlList2);
+		
+		
+		List<String> expectedList = new ArrayList<String>();
+		expectedList.addAll(nodeNamesFromYamlList1);
+		expectedList.addAll(nodeNamesFromYamlList2);
+		System.out.println("list of normatives from files:::::::::::");
+		expectedList.forEach(System.out::println);
+		getExtendTest().log(Status.INFO, "list of normatives from files:");
+		getExtendTest().log(Status.INFO,expectedList.toString());
+		
+		
+		String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory(), subCategoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getSubCategory() };
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES);
+		Map<String, String> resourceAssetList = AssetRestUtils.getResourceAssetMap(assetResponse);
+		Map<String, String> resourceListFiltteredByWholeVersion = AssetRestUtils.getResourceListFiltteredByWholeVersion(resourceAssetList);
+		List<String> resourceToscaNamesList = AssetRestUtils.getResourceObjectByNameAndVersionToscaNamesList(resourceListFiltteredByWholeVersion);
+		System.out.println("list of normatives from APIs:::::::::::");
+		resourceToscaNamesList.forEach(System.out::println);
+		getExtendTest().log(Status.INFO, "list of normatives from APIs:");
+		getExtendTest().log(Status.INFO, resourceToscaNamesList.toString());
+		
+		boolean good = true;
+		List<String> missingNormatives =  new ArrayList<>();
+
+		for (int i = 0; i < expectedList.size(); i ++) {
+		    if (!resourceToscaNamesList.contains(expectedList.get(i))) {
+		        good = false;
+		        missingNormatives.add(expectedList.get(i));
+		        
+		        
+		    }
+		}
+		
+		System.out.println("<<<<<<<<<MISSING NORMATIVES>>>>>>");
+		missingNormatives.forEach(System.out::println);
+		getExtendTest().log(Status.INFO, "MISSING NORMATIVES:");
+		getExtendTest().log(Status.INFO, missingNormatives.toString());
+		
+		assertTrue("missing normatives ",  good);
+		
+	}
+
+
+	public List<String> getNodeNamesFromYamlList(List<File> yamlList) throws IOException {
+		List<String> nodeNameList = new ArrayList<String>();
+
+		for (File file : yamlList) {
+		    String content = new String(Files.readAllBytes(Paths.get(file.getPath())), StandardCharsets.UTF_8);
+			Yaml yaml = new Yaml();
+			Map<String, Object> load = (Map<String, Object>) yaml.load(content);
+			Map<String, Object> topology_template = (Map<String, Object>) load.get("node_types");
+//			String string = topology_template.keySet().toString().replaceAll("tosca.nodes.", "");
+			String string = topology_template.keySet().iterator().next().toString();
+			System.out.println(string +" -----> "  +file.getPath());
+			nodeNameList.add(string);
+		}
+		return nodeNameList;
+	}
+
+
+	public List<File> getYamlFilesList(String path) throws IOException {
+		List<File> yamlList = new ArrayList<File>();
+		File dir = new File(path);
+		String[] extensions = new String[] { "yml" };
+		System.out.println("Getting all .yml files in " + dir.getCanonicalPath()
+				+ " including those in subdirectories");
+		List<File> files = (List<File>) FileUtils.listFiles(dir, extensions, true);
+		for (File file : files) {
+			System.out.println("file: " + file.getCanonicalPath());
+			yamlList.add(file);
+		}
+		return yamlList;
+	}
+	
+
+	
+	
+
+	
+	@Test (enabled=false)
+	public void testYaml() throws IOException{
+		
+		System.out.println("");
+		
+		File file = new File("\\\\Comp-1\\FileIO\\Stop.txt");
+		
+		
+		//read file
+
+
+		Map<String, byte[]> readZip = null;
+		Path path = Paths.get("C:\\Users\\ys9693\\Documents\\csar\\attributesWithProporties\\attributesWithProporties.csar");
+		byte[] data = Files.readAllBytes(path);
+		if (data != null && data.length > 0) {
+			readZip = ZipUtil.readZip(data);
+
+		}
+
+		byte[] artifactsBs = readZip.get("Definitions/VF_RI2_G6.yaml");
+		String str = new String(artifactsBs, StandardCharsets.UTF_8);
+		
+				
+
+		
+		Yaml yaml = new Yaml();
+		Map<String, Object> load = (Map<String, Object>) yaml.load(str);
+		Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
+		Map<String, Object> node_templates = (Map<String, Object>) topology_template.get("node_templates");
+		
+		Set<String> keySet = node_templates.keySet();
+	}
+	
+	
+	
+	@Test
+	public void pasrseDataTypes() throws Exception{
+		
+//		String path = "C:\\Git_work\\Git_UGN\\d2-sdnc\\catalog-be\\src\\main\\resources\\import\\tosca\\data-types\\dataTypes.yml";
+		String path = "//apps//asdc_kits//catalog-be-" + attVersionStr + "//import//tosca//data-types//dataTypes.yml";
+		
+	    String content = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
+		
+				
+		Yaml yaml = new Yaml();
+		Map<String, Object> load = (Map<String, Object>) yaml.load(content);
+		List<String> listOfDataTypes = new ArrayList<String>();
+		listOfDataTypes.addAll(load.keySet());
+		System.out.println("<<<<<<<< List of Data Types >>>>>>>>>");
+		listOfDataTypes.forEach(System.out::println);
+		getExtendTest().log(Status.INFO, "List of Data Types:");
+		getExtendTest().log(Status.INFO, listOfDataTypes.toString());
+				
+		Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		PropertyReqDetails defaultProperty = ElementFactory.getDefaultListProperty();
+		
+//		SchemaDefinition schemaDefinition = new SchemaDefinition();
+		
+		
+		
+	
+		defaultProperty.setPropertyDefaultValue(null);
+//		defaultProperty.setSchema(schemaDefinition);
+		
+		
+//		listOfDataTypes.remove("tosca.datatypes.Root");
+		for (String dataType : listOfDataTypes) {
+//			if (dataType.equals("map") ||  dataType.equals("list")){ 
+			defaultProperty.setPropertyType(dataType);
+			defaultProperty.setName(dataType);
+			System.out.println("Adding proporty with data type: ----> " + dataType);
+			getExtendTest().log(Status.INFO, "Adding proporty with data type: ----> " + dataType);
+			AtomicOperationUtils.addCustomPropertyToResource(defaultProperty, resource, UserRoleEnum.DESIGNER, true);
+//			}
+		}
+
+		
+		listOfDataTypes.forEach(System.out::println);
+	
+	}
+		
+
+
+
+
+
+	@Test
+	public void pasrseCategories() throws Exception{
+		
+//		String path = "C:\\Git_work\\Git_UGN\\d2-sdnc\\catalog-be\\src\\main\\resources\\import\\tosca\\categories\\categoryTypes.yml";
+		String path = "//apps//asdc_kits//catalog-be-" + attVersionStr + "//import//tosca//categories//categoryTypes.yml";
+		
+	    String content = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
+		
+		List<String> serviceCategories = new ArrayList<String>();
+		List<String> resourceCategories = new ArrayList<String>();
+				
+		Yaml yaml = new Yaml();
+		Map<String, Object> load = (Map<String, Object>) yaml.load(content);
+		Map<String, Map> services = (Map<String, Map>) load.get("services");
+		Map<String, Map> resources = (Map<String, Map>) load.get("resources");
+		
+		Map<String, List<String>> resourcesListFromFile = new HashMap<String, List<String>>() ;
+				
+		//retrieve subcategories
+		for ( String resourceCategoryName : resources.keySet()) {
+			Map<String, Map> subcategory = (Map) resources.get(resourceCategoryName).get("subcategories");
+				
+			resourceCategories = new ArrayList<String>();
+			for (String subcategoryName : subcategory.keySet()) {	
+				String name = (String) subcategory.get(subcategoryName).get("name");
+//				resourceCategories.add(name.replaceAll("\\s",""));
+				resourceCategories.add(name);
+							
+			}
+			resourcesListFromFile.put(resources.get(resourceCategoryName).get("name").toString(), resourceCategories);	
+		}		
+		
+			System.out.println(resourcesListFromFile.toString());
+			getExtendTest().log(Status.INFO, "Expected categories:");
+			getExtendTest().log(Status.INFO, resourcesListFromFile.toString());
+			
+		//retrieve service categories 	
+//		for ( String serviceCategoryName : services.keySet()) {
+//			String name = (String) services.get(serviceCategoryName).get("name");
+//			serviceCategories.add(name);
+//				}	
+//		serviceCategories.forEach(System.out::println);
+			
+			
+			//retrieve resource list from URL
+			
+			Map<String, List<CategoryDefinition>> categoriesMap = getCategories();
+			List<CategoryDefinition> resourceSubCategories = categoriesMap.get(ComponentTypeEnum.RESOURCE_PARAM_NAME);
+			List<SubCategoryDefinition> subcategories;
+			for (CategoryDefinition categoryDefinition : resourceSubCategories) {
+				subcategories =  categoryDefinition.getSubcategories();
+			}
+//			subcategories.stream().collect(toMap(i -> i, i -> items.get(i)));
+			
+//			resourceSubCategories.stream().collect(
+//	                Collectors.groupingBy(CategoryDefinition::getName, Collectors.groupingBy(SubCategoryDefinition::getName)));
+			
+//			resourceSubCategories.stream().filter(p->p.getSubcategories()).map(m->m.getName()).collect(Collectors.toList()).collect(Collectors.toMap(CategoryDefinition::getName,m));
+			
+			
+			Map<String, List<String>> resourceMapFromUrl = resourceSubCategories.stream().collect(Collectors.toMap( e -> e.getName() , e -> e.getSubcategories().stream().map(e1 -> e1.getName()).collect(Collectors.toList())));
+			
+			getExtendTest().log(Status.INFO, "Actual categories:");
+			getExtendTest().log(Status.INFO, resourceMapFromUrl.toString());
+			
+			
+			assertTrue("missing categories ", resourceMapFromUrl.keySet().containsAll(resourcesListFromFile.keySet()));
+			
+			
+
+			
+			
+
+	}
+	
+	
+	public Map<String, List<CategoryDefinition>> getCategories() throws Exception {
+		
+		User defaultAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+		
+		Map<String,List<CategoryDefinition>> map = new HashMap<String,List<CategoryDefinition>>();
+				
+		
+		RestResponse allResourceCategories = CategoryRestUtils.getAllCategories(defaultAdminUser, ComponentTypeEnum.RESOURCE_PARAM_NAME);
+		RestResponse allServiceCategories = CategoryRestUtils.getAllCategories(defaultAdminUser, ComponentTypeEnum.SERVICE_PARAM_NAME);
+
+		List<CategoryDefinition> parsedResourceCategories = ResponseParser.parseCategories(allResourceCategories);
+		List<CategoryDefinition> parsedServiceCategories = ResponseParser.parseCategories(allServiceCategories);
+		
+		map.put(ComponentTypeEnum.RESOURCE_PARAM_NAME, parsedResourceCategories);
+		map.put(ComponentTypeEnum.SERVICE_PARAM_NAME, parsedServiceCategories);
+		
+		return map;
+	}
+	
+
+
+	@Test (enabled=false)
+	public void pasrseCategoriesClass2() throws IOException{
+		
+		String path = "C:\\Git_work\\Git_UGN\\d2-sdnc\\catalog-be\\src\\main\\resources\\import\\tosca\\categories\\categoryTypes.yml";
+
+		FileReader reader = new FileReader(path);
+		Yaml yaml=new Yaml();
+		
+		
+		Map<?, ?> map = (Map<?, ?>) yaml.load(reader);
+		
+		Collection<Map> values = (Collection<Map>) map.values();
+		for (Map map2 : values) {
+			Collection values2 = map2.values();
+			for (Object object : values2) {
+				
+				
+			}
+		}
+			
+		{
+			
+		}
+		List<Object> collect = values.stream().map(e -> e.get("name")).collect(Collectors.toList());
+		
+//		resourcesArrayList.stream().filter(s -> s.getName().toLowerCase().startsWith("ci") && !s.getName().toLowerCase().equals("cindervolume")).map(e -> e.getUniqueId()).collect(Collectors.toList()).forEach((i)
+		
+		
+		
+		
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java
new file mode 100644
index 0000000..90dd3a4
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java
@@ -0,0 +1,343 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+
+public class GetAssetServlet extends ComponentBaseTest {
+
+	protected User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+	protected User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+	protected ConsumerDataDefinition consumerDataDefinition;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetAssetServlet() {
+		super(name, GetAssetServlet.class.getName());
+	}
+
+	Gson gson = new Gson();
+
+//	@BeforeMethod
+//	public void setup() throws Exception {
+//
+//		AtomicOperationUtils.createDefaultConsumer(true);
+//
+//	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetSuccess() throws Exception {
+
+//		CassandraUtils.truncateAllKeyspaces();
+		List<String> expectedAssetNamesList = new ArrayList<>();
+
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+		resourceDetails.setName("ciResource1");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		expectedAssetNamesList.add(resource.getName());
+
+		resourceDetails.setName("ciResource2");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		expectedAssetNamesList.add(resource.getName());
+		expectedAssetNamesList.add(resource.getName());
+
+		resourceDetails.setName("ciResource3");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails,
+				ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		expectedAssetNamesList.add(resource.getName());
+
+		resourceDetails.setName("ciResource4");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		expectedAssetNamesList.add(resource.getName());
+
+		resourceDetails.setName("ciResource5");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		expectedAssetNamesList.add(resource.getName());
+
+		resourceDetails.setName("ciResource6");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
+		expectedAssetNamesList.add(resource.getName());
+
+		resourceDetails.setName("ciResource7");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createResource);
+		resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+		expectedAssetNamesList.add(resource.getName());
+		expectedAssetNamesList.add(resource.getName());
+
+		System.out.println("7 VF resources were created");
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ResourceAssetStructure> resourceAssetList = AssetRestUtils.getResourceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getResourceNamesList(resourceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		AssetRestUtils.checkComponentTypeInObjectList(resourceAssetList, ComponentTypeEnum.RESOURCE);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_ASSET_LIST);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_LIST.getName(), body);
+
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetSuccess() throws Exception {
+
+//		CassandraUtils.truncateAllKeyspaces();
+		List<String> expectedAssetNamesList = new ArrayList<>();
+		ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
+
+		ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+		serviceDetails.setName("ciService1");
+		RestResponse createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		Service service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		expectedAssetNamesList.add(service.getName());
+
+		serviceDetails.setName("ciService2");
+		createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+		BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		expectedAssetNamesList.add(service.getName());
+		expectedAssetNamesList.add(service.getName());
+
+		serviceDetails.setName("ciService3");
+		createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+		BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		expectedAssetNamesList.add(service.getName());
+
+		serviceDetails.setName("ciService4");
+		createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		expectedAssetNamesList.add(service.getName());
+
+		serviceDetails.setName("ciService5");
+		createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		expectedAssetNamesList.add(service.getName());
+
+		serviceDetails.setName("ciService6");
+		createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+		BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
+		expectedAssetNamesList.add(service.getName());
+
+		serviceDetails.setName("ciService7");
+		createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+		BaseRestUtils.checkCreateResponse(createService);
+		service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+		addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+		BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+		expectedAssetNamesList.add(service.getName());
+		expectedAssetNamesList.add(service.getName());
+
+		System.out.println("7 Services were created");
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_ASSET_LIST);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_LIST.getName(), body);
+
+	}
+
+	@Test
+	public void getToscaModelSuccess() throws Exception {
+
+		CloseableHttpClient httpclient = HttpClients.createDefault();
+		ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
+//		resourceDetails.setName("ciResource11");
+		resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+		RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
+		BaseRestUtils.checkCreateResponse(createResource);
+		Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+		HttpResponse assetResponse = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		String artId = resource.getToscaArtifacts().get("assettoscacsar").getEsId();
+		String url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), resource.getUniqueId(), artId);
+		HttpGet httpGet = createGetRequest(url);
+		HttpResponse response = httpclient.execute(httpGet);
+		InputStream inputStream = response.getEntity().getContent();
+		ArtifactUiDownloadData artifactUiDownloadData = getArtifactUiDownloadData(IOUtils.toString(inputStream));
+		assetResponse = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		inputStream = assetResponse.getEntity().getContent();
+		int len = (int) assetResponse.getEntity().getContentLength();
+		byte[] res = new byte[len];
+		inputStream.read(res, 0, len);
+		byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
+		assertEquals(Base64.encodeBase64(res), fromUiDownload);
+		String fileName = assetResponse.getFirstHeader(Constants.CONTENT_DISPOSITION_HEADER).getValue();
+		assertEquals(fileName, new StringBuilder().append("attachment; filename=\"")
+				.append(artifactUiDownloadData.getArtifactName()).append("\"").toString());
+	}
+
+	private HttpGet createGetRequest(String url) {
+		HttpGet httpGet = new HttpGet(url);
+		httpGet.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
+		return httpGet;
+	}
+
+	private ArtifactUiDownloadData getArtifactUiDownloadData(String artifactUiDownloadDataStr) throws Exception {
+
+		ObjectMapper mapper = new ObjectMapper();
+		try {
+			ArtifactUiDownloadData artifactUiDownloadData = mapper.readValue(artifactUiDownloadDataStr,
+					ArtifactUiDownloadData.class);
+			return artifactUiDownloadData;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java
new file mode 100644
index 0000000..6acc54b
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java
@@ -0,0 +1,262 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static org.testng.AssertJUnit.assertEquals;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.api.Urls;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.common.api.Constants;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+import com.google.gson.Gson;
+
+import fj.data.Either;
+
+public class GetCSARofVF extends ComponentBaseTest {
+
+//	protected User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+//	protected User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+//	protected ConsumerDataDefinition consumerDataDefinition;
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetCSARofVF() {
+		super(name, GetCSARofVF.class.getName());
+	}
+
+//	Gson gson = new Gson();
+
+	@BeforeMethod
+	public void setup() throws Exception {
+
+//		AtomicOperationUtils.createDefaultConsumer(true);
+//		CassandraUtils.truncateAllKeyspaces();
+		
+
+	}
+	
+	@Test
+	public void getResourceToscaModelCheckOutState() throws Exception {
+
+
+		Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		
+//		HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.RESOURCES, resource.getUUID());
+		
+		// validate tosca structure  
+		validateCsarContent(resource, toscaModelCsarFile);
+	
+		// Validate audit message
+		validateAudit(resource);
+		
+		
+		
+	}
+
+
+	
+	@Test
+	public void getResourceToscaModelCheckInState() throws Exception {
+		
+		Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		
+		AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		
+//		HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.RESOURCES, resource.getUUID());
+		
+		// validate tosca structure  
+		validateCsarContent(resource, toscaModelCsarFile);
+	
+		// Validate audit message
+		validateAudit(resource);
+		
+		
+		
+	}
+	
+	@Test
+	public void getRsourceToscaModelCertifyState() throws Exception {
+		
+		Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		
+		AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		
+//		HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.RESOURCES, resource.getUUID());
+		
+		// validate tosca structure  
+		validateCsarContent(resource, toscaModelCsarFile);
+	
+		// Validate audit message
+		validateAudit(resource);
+		
+		
+	}
+	
+	
+	@Test
+	public void getServiceToscaModelCheckOutState() throws Exception {
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		
+//		HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
+		
+		// validate tosca structure  
+		validateCsarContent(service, toscaModelCsarFile);
+	
+		validateAudit(service);
+		
+		
+		
+	}
+	
+	@Test
+	public void getServiceToscaModelCheckInState() throws Exception {
+		
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		
+		AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
+		
+//		HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
+		
+		// validate tosca structure  
+		validateCsarContent(service, toscaModelCsarFile);
+	
+		validateAudit(service);
+		
+		
+	}
+	
+	@Test
+	public void getServiceToscaModelCertifyState() throws Exception {
+		
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, service, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
+		
+//		HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
+		File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
+		
+		// validate tosca structure  
+		validateCsarContent(service, toscaModelCsarFile);
+	
+		validateAudit(service);
+		
+	}
+	
+	
+
+	
+	
+
+	public void validateCsarContent(Component resource, File toscaModelCsarFile) throws ZipException, IOException {
+		ZipFile zipFile = new ZipFile(toscaModelCsarFile);
+		Enumeration<? extends ZipEntry> entries = zipFile.entries();
+		while(entries.hasMoreElements()){
+			ZipEntry nextElement = entries.nextElement();
+			if (!(nextElement.getName().contains("Artifacts")||nextElement.getName().contains("csar.meta"))){
+				assertTrue("missing file in csar template", (nextElement.getName().equals("TOSCA-Metadata/TOSCA.meta") || 
+						nextElement.getName().equals("Definitions/"+ resource.getComponentType().getValue().toLowerCase()+"-"+ resource.getSystemName()+"-template.yml")) ||
+						nextElement.getName().equals("Definitions/"+ resource.getComponentType().getValue().toLowerCase()+"-"+ resource.getSystemName()+"-template-interface.yml"));
+				}
+			}
+	}
+	
+	public void validateAudit(Component resource) throws Exception {
+		ExpectedExternalAudit expectedAudit = null;
+		if (resource.getComponentType().equals(ComponentTypeEnum.RESOURCE)){
+		expectedAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_TOSCA_MODEL, ("/" + resource.getUUID() + "/toscaModel"));
+		}
+		else expectedAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_TOSCA_MODEL, ("/" + resource.getUUID() + "/toscaModel"));
+		expectedAudit.setRESOURCE_NAME(resource.getName());
+		expectedAudit.setSERVICE_INSTANCE_ID(resource.getUUID());
+		expectedAudit.setRESOURCE_TYPE(resource.getComponentType().getValue());
+//		AuditValidationUtils.validateExternalAudit(expectedAudit, AuditingActionEnum.GET_TOSCA_MODEL.getName(),	null);
+
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, expectedAudit.getRESOURCE_NAME());
+        AuditValidationUtils.validateExternalAudit(expectedAudit, AuditingActionEnum.GET_TOSCA_MODEL.getName(), body);
+
+	}
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java
new file mode 100644
index 0000000..008cdbb
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java
@@ -0,0 +1,712 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.Utils;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class GetFilteredAssetServlet extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(GetAssetServlet.class.getName());
+	protected final static String categoryFilterKey = "category";
+	protected final static String subCategoryFilterKey = "subCategory";
+	protected final static String distributionStatusFilterKey = "distributionStatus";
+	protected final static String serviceKey = "service";
+	protected final static String resourceKey = "resource";
+	protected final static String resourceType = "resourceType";
+	protected final static String validFilterParameters = "[" + resourceType + ", "+ subCategoryFilterKey + ", " + categoryFilterKey + "]";
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetFilteredAssetServlet() {
+		super(name, GetFilteredAssetServlet.class.getName());
+	}
+
+//	@BeforeMethod
+//	public void setup() throws Exception {
+//		AtomicOperationUtils.createDefaultConsumer(true);
+//	}
+
+	// RESOURCE
+	// Success
+
+	@Test // (enabled = false)
+	public void getResourceAssetBySpecifiedCategory() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory() };
+		List<String> expectedAssetNamesList = new ArrayList<>();
+
+		Resource resource1 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(resource1.getName());
+		Resource resource2 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.DATABASE, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(resource2.getName());
+		Resource resource3 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.NETWORK_CONNECTIVITY_CON_POINT, UserRoleEnum.DESIGNER, true).left().value();
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ResourceAssetStructure> resourceAssetList = AssetRestUtils.getResourceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getResourceNamesList(resourceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+
+	}
+
+	// 2 resources has the same category and different subcategory
+	@Test // (enabled = false)
+	public void getResourceAssetBySpecifiedCategoryAndSubCategory() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory(), subCategoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getSubCategory() };
+		// String[] filter2 = {categoryFilterKey + "=" +
+		// ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS.getCategory(),
+		// subCategoryFilterKey + "=" +
+		// ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS.getSubCategory()};
+		List<String> expectedAssetNamesList = new ArrayList<>();
+
+		Resource resource1 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(resource1.getName());
+		Resource resource2 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.DATABASE, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER, true).left().value();
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetBySpecifiedSubCategoryAndCategory() throws Exception {
+		String[] filter = { subCategoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory(), categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), };
+		List<String> expectedAssetNamesList = new ArrayList<>();
+
+		Resource resource1 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.DATABASE, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(resource2.getName());
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	// Failure
+	@Test // (enabled = false)
+	public void getResourceAssetCategoryNotExists() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + "NotExistingCategory" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(resourceKey, categoryFilterKey, "NotExistingCategory");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetSubCategoryNotExists() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory(), subCategoryFilterKey + "=" + "NotExistingSubCategory" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList("Resource", "NotExistingSubCategory", ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory());
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetCategoryNotExistsSubCategoryExists() throws Exception {
+		String[] filter = { subCategoryFilterKey + "=" + ResourceCategoryEnum.NETWORK_L2_3_GETEWAY.getSubCategory(), categoryFilterKey + "=" + "NotExistingCategory" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(resourceKey, categoryFilterKey, "NotExistingCategory");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetInvalidFilterKey() throws Exception {
+		String[] filter = { subCategoryFilterKey + "1=" + ResourceCategoryEnum.NETWORK_L2_3_GETEWAY.getSubCategory(), categoryFilterKey + "=" + "NotExistingCategory" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FILTER_KEY.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(subCategoryFilterKey + "1", validFilterParameters);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FILTER_KEY.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	// ---------------------------------------------------------------------------------------------------------
+	// SERVICE
+	// Success
+	@Test // (enabled = false)
+	public void getServiceAssetBySpecifiedCategory() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue() };
+		List<String> expectedAssetNamesList = new ArrayList<>();
+
+		Service service1 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(service1.getName());
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetBySpecifiedCategoryAndDistributionStatus() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue(), distributionStatusFilterKey + "=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED };
+		List<String> expectedAssetNamesList = new ArrayList<>();
+		ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
+
+		Service service1 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(service1.getName());
+		Service service2 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service2.getUniqueId());
+		BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+		service2 = (Service) AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		expectedAssetNamesList.add(service2.getName());
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetByDistributionStatus() throws Exception {
+		String[] filter = { distributionStatusFilterKey + "=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED };
+		List<String> expectedAssetNamesList = new ArrayList<>();
+		ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
+
+		Service service1 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		expectedAssetNamesList.add(service1.getName());
+		Service service2 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
+		RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service2.getUniqueId());
+		BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+		service2 = (Service) AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		ServiceRestUtils.approveServiceDistribution(service2.getUniqueId(), UserRoleEnum.GOVERNOR.getUserId());
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+		List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
+		Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	// Failure
+	@Test // (enabled = false)
+	public void getServiceAssetCategoryNotExists() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + "NotExistingCategory" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(serviceKey, categoryFilterKey, "NotExistingCategory");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetInvalidDistributionStatus() throws Exception {
+		String[] filter = { distributionStatusFilterKey + "=" + "NotExistingDistributionStatus" };
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(serviceKey, distributionStatusFilterKey, "NotExistingDistributionStatus");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetCategoryExitsDistributionStatusInvalid() throws Exception {
+		String[] filter = { categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue(), distributionStatusFilterKey + "=" + "NotExistingDistributionStatus" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(serviceKey, distributionStatusFilterKey, "NotExistingDistributionStatus");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetCategoryNotExistsDistributionStatus() throws Exception {
+		String[] filter = { distributionStatusFilterKey + "=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, categoryFilterKey + "=" + "NotExistingCategory" };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(serviceKey, categoryFilterKey, "NotExistingCategory");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetInvalidFilterKey() throws Exception {
+		String[] filter = { distributionStatusFilterKey + "1=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue() };
+
+		RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FILTER_KEY.name());
+
+		assertNotNull("check response object is not null after create resouce", assetResponse);
+		assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
+		assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
+
+		List<String> variables = Arrays.asList(distributionStatusFilterKey + "1", "[" + categoryFilterKey + ", " + distributionStatusFilterKey + "]");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FILTER_KEY.name(), variables, assetResponse.getResponse());
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
+		expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
+		expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
+		expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+
+	}
+	
+	@Test
+	public void getFilteredResourceAssetCategoryNotFound() throws Exception {
+
+		String query = "category=Application%20L3%2B";
+		RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.RESOURCES, query);
+		BaseRestUtils.checkErrorResponse(assetResponse, ActionStatus.COMPONENT_CATEGORY_NOT_FOUND, "resource", "category", "Application L3+");
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getFilteredAssetListAuditCategoryNotFound(AssetTypeEnum.RESOURCES, "?" + query, "Application L3+");
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+
+	}
+	
+		@Test
+		public void getFilteredResourceAssetSuccess() throws Exception {
+
+			List<String> expectedAssetNamesList = new ArrayList<>();
+
+			ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.APPLICATION_L4_APP_SERVER);
+//			resourceDetails.setName("ciResource11");
+			resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+			RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createResource);
+			Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+			expectedAssetNamesList.add(resource.getName());
+
+			resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.APPLICATION_L4_BORDER);
+//			resourceDetails.setName("ciResource22");
+			resourceDetails.setResourceType(ResourceTypeEnum.VFC.name());
+			createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createResource);
+			resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+			resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE);
+//			resourceDetails.setName("ciResource33");
+			resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+			createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createResource);
+			resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+			resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.APPLICATION_L4_FIREWALL);
+//			resourceDetails.setName("ciResource44");
+			resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
+			createResource = ResourceRestUtils.createResource(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createResource);
+			resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			expectedAssetNamesList.add(resource.getName());
+
+			log.debug("4 resources created");
+			String query = "category=Application%20L4%2B";
+			RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.RESOURCES, query);
+			BaseRestUtils.checkSuccess(assetResponse);
+
+			List<ResourceAssetStructure> resourceAssetList = AssetRestUtils.getResourceAssetList(assetResponse);
+			List<String> getActualAssetNamesList = AssetRestUtils.getResourceNamesList(resourceAssetList);
+			Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+//			Andrey L. This condition can not be checked in case resources list has two or ore different resource types
+//			AssetRestUtils.checkResourceTypeInObjectList(resourceAssetList, ResourceTypeEnum.VF);
+
+			// Validate audit message
+			ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultFilteredAssetListAudit(AssetTypeEnum.RESOURCES, "?" + query);
+			Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+	        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+	        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+
+		}
+
+		@Test
+		public void getFilteredServiceAssetInformationalSuccess() throws Exception {
+
+			List<String> expectedAssetNamesList = new ArrayList<>();
+			ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
+			artifactDetails.setArtifactGroupType(ArtifactGroupTypeEnum.INFORMATIONAL.getType());
+
+			ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+			serviceDetails.setName("ciService111");
+			RestResponse createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			Service service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+
+			serviceDetails.setName("ciService222");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+			BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+			ServiceReqDetails certifyService = new ServiceReqDetails(service);
+			LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+			AtomicOperationUtils.distributeService(service, false);
+			expectedAssetNamesList.add(service.getName());
+
+			serviceDetails.setName("ciService333");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+			BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			certifyService = new ServiceReqDetails(service);
+			LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+			AtomicOperationUtils.distributeService(service, false);
+			expectedAssetNamesList.add(service.getName());
+
+			serviceDetails.setName("ciService444");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+			serviceDetails.setName("ciService555");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+			String query = "distributionStatus=Distributed";
+			RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.SERVICES, query);
+			BaseRestUtils.checkSuccess(assetResponse);
+
+			List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+			List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
+			Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+			// Validate audit message
+			ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultFilteredAssetListAudit(AssetTypeEnum.SERVICES, "?" + query);
+			Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+	        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+	        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+
+		}
+		
+		@Test
+		public void getFilteredServiceAssetDeploymentSuccess() throws Exception {
+
+			List<String> expectedAssetNamesList = new ArrayList<>();
+			ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
+
+			ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
+			serviceDetails.setName("ciService666");
+			RestResponse createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			Service service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+
+			serviceDetails.setName("ciService777");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+			BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+			ServiceReqDetails certifyService = new ServiceReqDetails(service);
+			LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+			AtomicOperationUtils.distributeService(service, false);
+			expectedAssetNamesList.add(service.getName());
+
+			serviceDetails.setName("ciService888");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
+			BaseRestUtils.checkSuccess(addInformationalArtifactToService);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+			certifyService = new ServiceReqDetails(service);
+			LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTION_APPROVED);
+			AtomicOperationUtils.distributeService(service, false);
+			expectedAssetNamesList.add(service.getName());
+
+			serviceDetails.setName("ciService999");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+			serviceDetails.setName("ciService000");
+			createService = ServiceRestUtils.createService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
+			BaseRestUtils.checkCreateResponse(createService);
+			service = ResponseParser.parseToObjectUsingMapper(createService.getResponse(), Service.class);
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+			service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+
+			String query = "distributionStatus=Distributed";
+			RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.SERVICES, query);
+			BaseRestUtils.checkSuccess(assetResponse);
+
+			List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
+			List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
+			Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
+
+			// Validate audit message
+			ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultFilteredAssetListAudit(AssetTypeEnum.SERVICES, "?" + query);
+			Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+	        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+	        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+
+		}
+		
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java
new file mode 100644
index 0000000..2cb307c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java
@@ -0,0 +1,447 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceDetailedAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceDetailedAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
+import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class GetSpecificAssetMetadataServlet extends ComponentBaseTest {
+
+	@Rule
+	public static TestName name = new TestName();
+
+	public GetSpecificAssetMetadataServlet() {
+		super(name, GetSpecificAssetMetadataServlet.class.getName());
+	}
+
+//	@BeforeMethod
+//	public void setup() throws Exception {
+//		AtomicOperationUtils.createDefaultConsumer(true);
+//	}
+
+	// get specific asset metadata
+
+	// Resource
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataWithResourceInstancesSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		resourceVF = ResponseParser.parseToObjectUsingMapper(ResourceRestUtils.getResource(resourceVF.getUniqueId()).getResponse(), Resource.class);
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory
+				.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataWithNonCertifiedResourceInstancesSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
+
+		// certify resource2 and add to VF(VF with resource2 0.1, 1.0 and 1.1
+		// versions)
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		resourceVF = ResponseParser.parseToObjectUsingMapper(ResourceRestUtils.getResource(resourceVF.getUniqueId()).getResponse(), Resource.class);
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataWithResourceInstancesVfInSubmitForTestingSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
+
+		// certify resource2 and add to VF(VF with resource2 1.0, 2.0 and 3.0
+		// versions)
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataWithResourceInstancesVfInStartCertificationSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER,	true);
+
+		// certify resource2 and add to VF(VF with resource2 1.0, 2.0 and 3.0
+		// versions)
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataWithResourceInstancesCertifiedVFSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER,	true);
+
+		// certify resource2 and add to VF(VF with resource2 1.0, 2.0 and 3.0
+		// versions)
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getResourceAssetMetadataWithNonCertifiedResourceInstancesAndArtifactsSuccess() throws Exception {
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+		Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
+		resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER,	true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER,	true);
+
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = ResponseParser.parseToObjectUsingMapper(ResourceRestUtils.getResource(resourceVF.getUniqueId()).getResponse(), Resource.class);
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
+		AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.RESOURCES, resourceVF);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	// Import CSAR
+
+	// Service
+	@Test // (enabled = false)
+	public void getServiceAssetMetadataSuccess() throws Exception {
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
+		AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.SERVICES, service);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetMetadataWithResourceInstancesSuccess() throws Exception {
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+		service = ResponseParser.parseToObjectUsingMapper(ServiceRestUtils.getService(service.getUniqueId(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)).getResponse(),Service.class);
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
+		AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.SERVICES, service);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetMetadataWithNonCertifiedResourceInstancesWithArtifactsSuccess() throws Exception {
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+		Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF2, UserRoleEnum.DESIGNER, true, true);
+		resourceVF2 = (Resource) AtomicOperationUtils.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
+		resourceVF = (Resource) AtomicOperationUtils
+				.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+
+		// service with 0.1, 0.1 and 1.0 RIs versions
+		service = ResponseParser.parseToObjectUsingMapper(ServiceRestUtils.getService(service.getUniqueId(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)).getResponse(), Service.class);
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
+		AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.SERVICES, service);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetMetadataWithCertifiedResourceInstancesAndArtifactsOnRIsAndServiceSuccess()
+			throws Exception {
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF2, UserRoleEnum.DESIGNER, true, true);
+		resourceVF2 = (Resource) AtomicOperationUtils.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+
+		// service with resourceVF 1.0(1 art), 2.0(2 art) versions and
+		// resourceVF2 1.0(1 art), service 1 artifact version
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, service, UserRoleEnum.DESIGNER, true, true);
+		service = ResponseParser.parseToObjectUsingMapper(ServiceRestUtils.getService(service.getUniqueId(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)).getResponse(), Service.class);
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
+		AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.SERVICES, service);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetMetadataWithResourceInstancesServiceInSubmitForTestingSuccess() throws Exception {
+
+		Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
+
+		Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF2, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, resourceVF, UserRoleEnum.DESIGNER, true, true);
+		resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+		AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
+
+		// service with resourceVF 1.0(1 art), 2.0(2 art) versions and
+		// resourceVF2 1.0(1 art), service 1 artifact version
+		AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, service, UserRoleEnum.DESIGNER, true, true);
+		service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
+		BaseRestUtils.checkSuccess(assetResponse);
+
+		ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
+		AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
+
+		// Validate audit message
+		ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(AssetTypeEnum.SERVICES, service);
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+        body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
+        AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
+	}
+
+	@Test // (enabled = false)
+	public void getServiceAssetMetadataServiceNotFound() throws Exception {
+
+		String serviceUuid = "notExistingServiceUuid";
+		RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, serviceUuid);
+
+		// Validate audit message
+		ArrayList<String> variables = new ArrayList<>();
+		variables.add(serviceUuid);
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), variables, assetResponse.getResponse());
+	}
+
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java
new file mode 100644
index 0000000..ca7c5ae
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java
@@ -0,0 +1,329 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import org.json.simple.parser.JSONParser;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.category.CategoryDefinition;
+import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.SearchCriteriaEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+
+public class SearchFilterCategoryExternalAPI extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+	protected Gson gson = new Gson();
+	protected JSONParser jsonParser = new JSONParser();
+
+//	@BeforeMethod
+//	public void init() throws Exception{
+//		AtomicOperationUtils.createDefaultConsumer(true);
+//	}
+	
+	;
+	@Rule 
+	public static TestName name = new TestName();
+
+	public SearchFilterCategoryExternalAPI() {
+		super(name, SearchFilterCategoryExternalAPI.class.getName());
+
+	}
+	
+	// Search for invalid resourceType
+	@Test
+	public void searchWithInvalidFilter() throws Exception {
+		RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "invalid", ResourceTypeEnum.VFC.toString());
+		
+		Integer expectedResponseCode = 400;
+		Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+		
+		List<String> variables = Arrays.asList("resourceTypeinvalid", "[resourceType, subCategory, category]");
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FILTER_KEY.name(), variables, restResponse.getResponse());
+
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "invalid=" + ResourceTypeEnum.VFC.toString());
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FILTER_KEY.name());
+		expectedExternalAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		expectedExternalAudit.setSTATUS("400");
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+		AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+	
+	@DataProvider(name="searchForResourceTypeNegativeTest", parallel=true) 
+	public static Object[][] dataProviderSearchForResourceTypeNegativeTest() {
+		return new Object[][] {
+			{"invalidResourceType"},
+			{""}
+			};
+	}
+	
+	// Search for invalid resourceType
+	@Test(dataProvider="searchForResourceTypeNegativeTest")
+	public void searchForResourceTypeNegativeTest(String resourceType) throws Exception {
+		RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), resourceType);
+		
+		Integer expectedResponseCode = 400;
+		Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+		
+		List<String> variables = Arrays.asList();
+		ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables, restResponse.getResponse());
+
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + resourceType);
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
+		expectedExternalAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		expectedExternalAudit.setSTATUS("400");
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+		AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+	}
+	
+	// Searching for resource filter incorrect resource type using external API
+	@Test
+	public void searchingForResouceFilterIncorrectResouceTypeUsingExternalAPI() throws Exception {
+		Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+		List<String> createdResoucesName = new ArrayList<String>();
+		createdResoucesName.add(resource.getName());
+		
+		for(ResourceTypeEnum resourceTypeEnum: ResourceTypeEnum.values()) {
+			// Create resource for each type so it will not return 404
+			AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(resourceTypeEnum, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+
+			RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), resourceTypeEnum.toString());
+			
+			Integer expectedResponseCode = 200;
+			Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+			if(resourceTypeEnum == ResourceTypeEnum.VF) {
+				validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
+			} else {
+				validateJsonContainResource(restResponse.getResponse(), createdResoucesName, false);
+			}
+			
+			
+			ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + resourceTypeEnum.toString());
+			Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+			AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+		}
+	}
+	
+	// Searching for several resource types using external API
+	@Test
+	public void searchingForSeveralResouceTypesUsingExternalAPI() throws Exception {
+		performClean();
+		for(ResourceTypeEnum resourceTypeEnum: ResourceTypeEnum.values()) {
+			List<String> createdResoucesName = new ArrayList<String>();
+			Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(resourceTypeEnum, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+			createdResoucesName.add(resource.getName());
+			
+			RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), resourceTypeEnum.toString());
+			
+			Integer expectedResponseCode = 200;
+			Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+			validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
+			
+			ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + resourceTypeEnum.toString());
+			Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
+			AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
+		}
+	}
+	
+	// Searching for several resources of type VFCMT using external API
+	@Test
+	public void searchingForSeveralResourcesOfTypeVFCMTUsingExternalAPI() throws Exception {
+		performClean();
+		Random random = new Random();
+ 		int numberOfResouceToCreate = random.nextInt(5) + 1;	
+		List<String> createdResoucesName = new ArrayList<String>();
+		
+		for(int i=0; i<numberOfResouceToCreate; i++) {
+			
+			Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFCMT, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
+			createdResoucesName.add(resource.getName());
+		}
+		
+		RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), ResourceTypeEnum.VFCMT.toString());
+		
+		Integer expectedResponseCode = 200;
+		Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+		validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
+		
+		ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + ResourceTypeEnum.VFCMT.toString());
+		AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), null);
+	}
+	
+	
+	
+	@DataProvider(name="normativeResourceCategory", parallel=true) 
+	public static Object[][] dataProviderNormativeResourceCategory() {
+		return new Object[][] {
+			{ResourceCategoryEnum.ALLOTTED_RESOURCE},
+			{ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE},
+			};
+	}
+	
+	// Verify exist of normative resource category from data provider
+	@Test(dataProvider="normativeResourceCategory")
+	public void normativeResourceCategory(ResourceCategoryEnum resourceCategoryEnum) throws Exception {
+		RestResponse restResponse = CategoryRestUtils.getAllCategories(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "resources");
+		validateJsonContainResourceCategory(restResponse.getResponse(), resourceCategoryEnum);
+		
+		Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, resourceCategoryEnum, UserRoleEnum.DESIGNER, true).left().value();
+		List<String> createdResoucesName = new ArrayList<String>();
+		createdResoucesName.add(resource.getName());
+		
+		restResponse = ResourceRestUtils.getResourceListFilterByCategory(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), resourceCategoryEnum.getCategory());
+		
+		Integer expectedResponseCode = 200;
+		Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+		validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
+	}
+	
+	// Verify search filter by sub-category
+	@Test
+	public void validateFilterBySubcategory() throws Exception {
+		ResourceCategoryEnum resourceCategoryEnum = getRandomCategoryFromResourceCategoryEnum();
+		
+		Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, resourceCategoryEnum, UserRoleEnum.DESIGNER, true).left().value();
+		List<String> createdResoucesName = new ArrayList<String>();
+		createdResoucesName.add(resource.getName());
+		
+		RestResponse restResponse = ResourceRestUtils.getResourceListFilterBySubCategory(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), resourceCategoryEnum.getSubCategory());
+		
+		Integer expectedResponseCode = 200;
+		Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
+		validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
+	}
+	
+	
+	protected ResourceCategoryEnum getRandomCategoryFromResourceCategoryEnum() throws Exception {
+		Random random = new Random();
+		int randint = random.nextInt(ResourceCategoryEnum.values().length);
+		int i = 0;
+		for(ResourceCategoryEnum resourceTypeEnum: ResourceCategoryEnum.values()) {
+			if(randint == i) {
+				return resourceTypeEnum;
+			}
+			i++;
+		}
+		return null;
+	}
+	
+	protected CategoryDefinition getRandomCategory() throws Exception {
+		Random random = new Random();
+		
+		RestResponse restResponse = CategoryRestUtils.getAllCategories(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "resources");
+		Gson gson = new Gson();
+		JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
+		JsonArray jsonArray = jelement.getAsJsonArray();
+		
+		CategoryDefinition categoryDefinition = gson.fromJson(jsonArray.get(random.nextInt(jsonArray.size())), CategoryDefinition.class);
+		
+		return categoryDefinition;
+	}
+	
+	protected void validateJsonContainResource(String json, List<String> resourceNameList, Boolean willBeFound) {
+		int lenResourceNameList = resourceNameList.size();
+		Gson gson = new Gson();
+		JsonElement jsonElement = new JsonParser().parse(json);
+		JsonArray jsonArray = jsonElement.getAsJsonArray();
+		for(JsonElement jElement: jsonArray) {
+			ResourceReqDetails jResource = gson.fromJson(jElement, ResourceReqDetails.class);
+			
+			if(resourceNameList.contains(jResource.getName())) {
+				resourceNameList.remove(jResource.getName());
+			}
+		}
+		
+		if(resourceNameList.size() != 0 && willBeFound) {			
+			Assert.assertTrue(false, "Created resource not found on search filtered by category.");
+		} else if (lenResourceNameList != resourceNameList.size() & !willBeFound) {
+			Assert.assertTrue(false, "Some of the resources found when expect that no resource will be found.");
+		}
+	}
+	
+	
+	
+	protected void validateJsonContainResourceCategory(String json, ResourceCategoryEnum resourceCategoryEnum) {
+		Gson gson = new Gson();
+		JsonElement jelement = new JsonParser().parse(json);
+		JsonArray jsonArray = jelement.getAsJsonArray();
+		for(JsonElement jsonElement : jsonArray){
+			CategoryDefinition categoryDefinition = gson.fromJson(jsonElement, CategoryDefinition.class);
+			
+			if(categoryDefinition.getName().equals(resourceCategoryEnum.getCategory())) { 
+				for(SubCategoryDefinition subcategory: categoryDefinition.getSubcategories()) {
+					if(subcategory.getName().equals(resourceCategoryEnum.getSubCategory())) {
+						return;
+					}
+				}
+			}
+			
+		}
+		
+		Assert.assertTrue(false, "Category and subcategory not found in categories list.");
+	}
+
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
new file mode 100644
index 0000000..ceafe20
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
@@ -0,0 +1,556 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.portalsdk.core.restful.domain.EcompRole;
+import org.openecomp.portalsdk.core.restful.domain.EcompUser;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.EcompUserRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+public class UserAPIs extends ComponentBaseTest {
+	
+	@Rule
+	public static TestName name = new TestName();
+
+	public UserAPIs() {
+		super(name, UserAPIs.class.getName());
+	}
+
+	public User adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
+
+	
+	@Test
+	public void createUserAllPosibleRolesThenDeactivate() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		
+		List<EcompRole> allRoles = getAllRoles();
+	
+		for (EcompRole ecompRole2 : allRoles) {
+			try {
+				
+				///get list of users
+				List<EcompUser> allusersList = getAllusersList();
+				int sizeBeforeChange = allusersList.size();
+	
+				//create user
+				ecompUser.setLoginId(getUser());
+				ecompRole.setId((long) ecompRole2.getId());
+				ecompRole.setName(ecompRole2.getName());
+				System.out.println(ecompRole2.getName());
+				Set<EcompRole> setRoles = new HashSet<EcompRole>();
+				setRoles.add(ecompRole);
+				ecompUser.setRoles(setRoles);
+				RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+				BaseRestUtils.checkSuccess(pushUser);
+				
+				///get list of users verify list size changed
+				allusersList = getAllusersList();
+				int sizeAfterChange = allusersList.size();
+				
+				Assert.assertEquals(sizeBeforeChange + 1, sizeAfterChange, "Expected that list will change.");
+				sizeBeforeChange = sizeAfterChange;
+				pushUser = EcompUserRestUtils.pushUser(ecompUser);	
+				
+				//deactivate user
+				ecompRole = new EcompRole();;
+				List<EcompRole> list= new ArrayList<EcompRole>();
+				list.add(ecompRole);
+				
+				RestResponse deactivateUserResponse = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+				BaseRestUtils.checkSuccess(deactivateUserResponse);
+				
+				///get list of users verify list size changed
+				allusersList = getAllusersList();
+				sizeAfterChange = allusersList.size();
+				Assert.assertEquals(sizeBeforeChange, sizeAfterChange + 1, "Expected that list will change.");
+				
+			} finally {
+				deleteUser(ecompUser.getLoginId());
+			}
+							
+			}
+					
+	}
+	
+	@Test
+	public void createSameUserTwiceTest() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		try {
+			
+			///get list of users
+			List<EcompUser> allusersList = getAllusersList();
+			int sizeBeforeChange = allusersList.size();
+
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			///get list of users verify list size changed
+			allusersList = getAllusersList();
+			int sizeAfterChange = allusersList.size();
+					
+			assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
+			pushUser = EcompUserRestUtils.pushUser(ecompUser);	
+			
+		} finally {
+			deleteUser(ecompUser.getLoginId());
+		}
+		
+	}
+	
+	@Test
+	public void createSameUserTwiceDiffrentDataTest() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		try {
+			///get list of users
+			List<EcompUser> allusersList = getAllusersList();
+			int sizeBeforeChange = allusersList.size();
+
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			///get list of users verify list size changed
+			allusersList = getAllusersList();
+			int sizeAfterChange = allusersList.size();
+					
+			assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
+			
+			//update role
+			ecompRole.setId((long) 2);
+			ecompRole.setName("DESIGNER");
+			setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			
+			pushUser = EcompUserRestUtils.pushUser(ecompUser);	
+			
+		} finally {
+			deleteUser(ecompUser.getLoginId());
+		}
+		
+	}
+	
+	@Test
+	public void updateUserRoleTest() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		try {
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			List<EcompRole> userRolesBefore = getUserRoles(ecompUser);
+			
+			//update role
+			ecompRole = new EcompRole();
+			ecompRole.setId((long) 2);
+			ecompRole.setName("DESIGNER");
+			List<EcompRole> list= new ArrayList<EcompRole>();
+			list.add(ecompRole);
+			
+			EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+			
+			List<EcompRole> userRolesAfter = getUserRoles(ecompUser); 
+			
+			assertFalse("role wasn't changed", userRolesBefore.equals(userRolesAfter));
+		} finally {
+			deleteUser(ecompUser.getLoginId());
+		}
+		
+	}
+
+	@Test
+	public void addUserCreateResource() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		Resource resource = new Resource();
+		
+		try {
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 2);
+			ecompRole.setName("DESIGNER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
+			resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+			
+		} finally {
+			ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
+			deleteUser(ecompUser.getLoginId());
+		}
+		
+	}
+	
+	// First try update to Tester and verify it not success
+	// Then try to deactivate and verify it not success
+	@Test
+	public void changeUserRoleWithCheckOutResourceThenDeactivate() throws Exception {
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		Resource resource = new Resource();		
+		try {
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 2);
+			ecompRole.setName("DESIGNER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
+			resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+			
+			int sizeBeforeChange = getAllusersList().size();
+			
+			//update role
+			ecompRole = new EcompRole();
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			List<EcompRole> list= new ArrayList<EcompRole>();
+			list.add(ecompRole);
+			
+			RestResponse pushUserRoles = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+			Assert.assertEquals(pushUserRoles.getErrorCode(), (Integer)BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR, "Not correct response code");
+			
+			//deactivate user
+			ecompRole = new EcompRole();;
+			list= new ArrayList<EcompRole>();
+			list.add(ecompRole);
+			
+			RestResponse deactivateUserResponse = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+			Assert.assertEquals(deactivateUserResponse.getErrorCode(), (Integer)BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR, "Not correct response code");
+			
+			///get list of users verify list size changed
+			int sizeAfterChange = getAllusersList().size();
+			Assert.assertEquals(sizeBeforeChange, sizeAfterChange, "Expected that list will not change.");
+			
+		} finally {
+			ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
+			deleteUser(ecompUser.getLoginId());
+		}
+	}
+	
+	@Test
+	public void deactivateUserRoleWithStartTestingResource() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		Resource resource= new Resource();
+
+		try {
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 2);
+			ecompRole.setName("DESIGNER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			int sizeBeforeChange = getAllusersList().size();
+			UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
+			
+			resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+			AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true);
+			
+			
+			//update role
+			ecompRole = new EcompRole();
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			List<EcompRole> list= new ArrayList<EcompRole>();
+			list.add(ecompRole);
+			
+			RestResponse pushUserRoles = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+			BaseRestUtils.checkSuccess(pushUserRoles);
+			
+			UserRoleEnum.TESTER.setUserId(ecompUser.getLoginId());
+			AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.TESTER, LifeCycleStatesEnum.STARTCERTIFICATION, true);
+			
+			//deactivate user
+			ecompRole = new EcompRole();;
+			list= new ArrayList<EcompRole>();
+			list.add(ecompRole);
+			
+			RestResponse deactivateUserResponse = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+			Assert.assertEquals(deactivateUserResponse.getErrorCode(), (Integer)BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR, "Not correct response code");
+			
+			///get list of users verify list size changed
+			int sizeAfterChange = getAllusersList().size();
+			Assert.assertEquals(sizeBeforeChange, sizeAfterChange, "Expected that list will not change.");
+			
+		} finally {
+			ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
+			deleteUser(ecompUser.getLoginId());
+		}
+	}
+	
+	@Test
+	public void changeUserRoleWithStartTestingResource() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		Resource resource= new Resource();
+
+		try {
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompRole.setId((long) 2);
+			ecompRole.setName("DESIGNER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
+			
+			resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
+			AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true);
+			
+			
+			//update role
+			ecompRole = new EcompRole();
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			List<EcompRole> list= new ArrayList<EcompRole>();
+			list.add(ecompRole);
+			
+			RestResponse pushUserRoles = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
+			BaseRestUtils.checkSuccess(pushUserRoles);
+			
+		} finally {
+			ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
+			deleteUser(ecompUser.getLoginId());
+		}
+	}
+	
+	@Test
+	public void fillAllEcompFields() throws Exception {
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		try {
+
+			///get list of users
+			List<EcompUser> allusersList = getAllusersList();
+			int sizeBeforeChange = allusersList.size();
+
+			//create user
+			ecompUser.setLoginId(getUser());
+			ecompUser.setOrgId((long) 123);
+			ecompUser.setManagerId("ci4321");
+			ecompUser.setFirstName("firstName");
+			ecompUser.setMiddleInitial("middleInitial");
+			ecompUser.setLastName("lastName");
+			ecompUser.setPhone("phone");
+			ecompUser.setEmail("email@email.com");
+			ecompUser.setHrid("hrid");
+			ecompUser.setOrgUserId("orgUserId");
+			ecompUser.setOrgCode("orgCode");
+			ecompUser.setOrgManagerUserId("ci1234");
+			ecompUser.setJobTitle("jobTitle");
+			ecompUser.setActive(true);
+			
+			
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			///get list of users verify list size changed
+			allusersList = getAllusersList();
+			int sizeAfterChange = allusersList.size();
+					
+			assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
+			
+		} finally {
+			
+			deleteUser(ecompUser.getLoginId());
+		}
+	}
+	
+	@Test
+	public void missingMandatoryFieldRole() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		try {
+			///get list of users
+			List<EcompUser> allusersList = getAllusersList();
+			int sizeBeforeChange = allusersList.size();
+
+			//create user
+			ecompUser.setLoginId(getUser());
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			BaseRestUtils.checkSuccess(pushUser);
+			
+			///get list of users verify list size changed
+			allusersList = getAllusersList();
+			int sizeAfterChange = allusersList.size();
+					
+			assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
+			
+		} finally {
+			deleteUser(ecompUser.getLoginId());
+		}
+	}
+	
+	@Test
+	public void missingMandatoryFieldATTid() throws Exception {
+		
+		EcompUser ecompUser = new EcompUser();
+		EcompRole ecompRole = new EcompRole();
+		try {
+			
+			//create user
+			ecompUser.setLoginId("");
+			ecompRole.setId((long) 1);
+			ecompRole.setName("TESTER");
+			Set<EcompRole> setRoles = new HashSet<EcompRole>();
+			setRoles.add(ecompRole);
+			ecompUser.setRoles(setRoles);
+			RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
+			assertTrue("wrong response code :" , pushUser.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
+			
+		} finally {
+			deleteUser(ecompUser.getLoginId());
+		}
+		
+		
+	}
+
+	private List<EcompRole> getUserRoles(EcompUser ecompUser) throws IOException {
+		RestResponse userRoles = EcompUserRestUtils.getUserRoles(ecompUser.getLoginId());
+		Type listType = new TypeToken<List<EcompRole>>() {}.getType();
+		List<EcompRole> roleList = new Gson().fromJson(userRoles.getResponse(), listType);
+		return roleList;
+	}
+
+	private void deleteUser(String userId) throws IOException {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		defaultUser.setUserId(userId);
+		
+		UserRestUtils.deleteUser(defaultUser, adminUser, true);
+	}
+	
+	private  List<EcompUser> getAllusersList() throws IOException {
+		RestResponse allUsers = EcompUserRestUtils.getAllUsers();
+		
+		Type listType = new TypeToken<List<EcompUser>>() {}.getType();
+		List<EcompUser> usersList = new Gson().fromJson(allUsers.getResponse(), listType);
+		
+		return usersList;
+	}
+	
+	private  List<EcompRole> getAllRoles() throws IOException {
+		RestResponse allRoles = EcompUserRestUtils.getAllAvailableRoles();
+		
+		Type listType = new TypeToken<List<EcompRole>>() {}.getType();
+		List<EcompRole> availableRoles = new Gson().fromJson(allRoles.getResponse(), listType);
+		
+		return availableRoles;
+	}
+	
+	private String getUser() {
+		int nextInt = rnd.nextInt(8999) + 1000;
+//		String returnMe = "ci"+ new BigInteger(getRandomNumber(4));
+		String returnMe = "ci"+ nextInt;
+		System.out.println(returnMe);
+		
+		
+		return returnMe;
+	}
+	
+	private static Random rnd = new Random();
+
+	public static String getRandomNumber(int digCount) {
+	    StringBuilder sb = new StringBuilder(digCount);
+	    for(int i=1; i <= digCount; i++){
+	        sb.append((char)('0' + rnd.nextInt(10)));
+	    }
+	    return sb.toString();
+	}
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java
new file mode 100644
index 0000000..f939585
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java
@@ -0,0 +1,396 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.externalApis;
+
+import static java.util.Arrays.asList;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.json.simple.parser.JSONParser;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
+import org.openecomp.sdc.be.model.User;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
+import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
+import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.SearchCriteriaEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
+import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
+import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtilsExternalAPI;
+import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
+import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.SkipException;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+
+public class VFCMTExternalAPI extends ComponentBaseTest {
+
+	private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
+	protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
+	protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
+
+	protected Config config = Config.instance();
+	protected String contentTypeHeaderData = "application/json";
+	protected String acceptHeaderDate = "application/json";
+
+
+
+	protected Gson gson = new Gson();
+	protected JSONParser jsonParser = new JSONParser();
+
+
+	protected String serviceVersion;
+	protected ResourceReqDetails resourceDetails;
+	protected User sdncUserDetails;
+	protected ServiceReqDetails serviceDetails;
+	
+
+//	@BeforeMethod
+//	public synchronized void init() throws Exception{
+//		AtomicOperationUtils.createDefaultConsumer(true);
+//	}
+	
+	
+	@Rule 
+	public static TestName name = new TestName();
+
+	public VFCMTExternalAPI() {
+		super(name, VFCMTExternalAPI.class.getName());
+
+	}
+	
+	// Create VFCMT - validate response + search external api + retrieve metadata via external api  - success flow
+	@Test
+	public void createVfcmt() throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
+		
+		RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
+		ResourceAssetStructure parsedCreatedResponse = gson.fromJson(restResponse.getResponse(), ResourceAssetStructure.class);
+
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CREATE_RESOURCE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultCreateResourceExternalAPI(parsedCreatedResponse.getName());	
+		AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// search for vfcmt via external api - validate created resource exist
+		RestResponse searchResult = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), ResourceTypeEnum.VFCMT.toString());
+		JsonArray listSearchResult = gson.fromJson(searchResult.getResponse(), JsonArray.class);
+		boolean found = false;
+		for(JsonElement result: listSearchResult) {
+			ResourceAssetStructure parsedResult  = gson.fromJson(result, ResourceAssetStructure.class);
+			if(parsedResult.getName().equals(defaultResource.getName())) {
+				found = true;
+			}
+		}
+		Assert.assertEquals(found, true);
+		
+		// get created vfcmt metadata via external api - validate data
+		RestResponse resourceMetadata = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, parsedCreatedResponse.getUuid());
+		ResourceAssetStructure parsedMetadata  = gson.fromJson(resourceMetadata.getResponse(), ResourceAssetStructure.class);
+		
+		Assert.assertEquals(parsedCreatedResponse.getUuid(), parsedMetadata.getUuid());
+		Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), parsedMetadata.getInvariantUUID());
+		Assert.assertEquals(parsedCreatedResponse.getName(), parsedMetadata.getName());
+		Assert.assertEquals(parsedCreatedResponse.getVersion(), parsedMetadata.getVersion());
+		Assert.assertEquals(parsedCreatedResponse.getCategory(), parsedMetadata.getCategory());
+		Assert.assertEquals(parsedCreatedResponse.getSubCategory(), parsedMetadata.getSubCategory());
+		Assert.assertEquals(parsedCreatedResponse.getResourceType(), parsedMetadata.getResourceType());
+		Assert.assertEquals(parsedCreatedResponse.getLifecycleState(), parsedMetadata.getLifecycleState());
+		Assert.assertEquals(parsedCreatedResponse.getLastUpdaterUserId(), parsedMetadata.getLastUpdaterUserId());
+		Assert.assertEquals(parsedCreatedResponse.getLastUpdaterFullName(), parsedMetadata.getLastUpdaterFullName());
+		Assert.assertEquals(parsedCreatedResponse.getToscaResourceName(), parsedMetadata.getToscaResourceName());
+	}
+	
+	
+	
+	// Create two VFCMT with same name - validate error + audit - failure flow
+	@Test
+	public void createTwoVfcmtWithSameName() throws Exception {
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
+		
+		// create vfcmt
+		RestResponse firstTryToCreate = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
+		ResourceAssetStructure parsedCreatedResponse = gson.fromJson(firstTryToCreate.getResponse(), ResourceAssetStructure.class);
+
+		// auditing verification
+		AuditingActionEnum action = AuditingActionEnum.CREATE_RESOURCE_BY_API;
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultCreateResourceExternalAPI(parsedCreatedResponse.getName());	
+		AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);
+		
+		// try to create another vfcmt wit same name
+		RestResponse secondTryToCreate = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
+		Assert.assertEquals((int)secondTryToCreate.getErrorCode(), 409);
+		
+		body.put(AuditingFieldsKeysEnum.AUDIT_STATUS, "409");
+		ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name());
+		List<String> variables = asList(ComponentTypeEnum.RESOURCE.getValue(), defaultResource.getName());
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		expectedResourceAuditJavaObject.setStatus("409");
+		AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);
+	}
+	
+	
+	
+	@DataProvider(name="createVfcmtVariousFailureFlows", parallel=true) 
+	public static Object[][] dataProviderCreateVfcmtVariousFailureFlows() {
+		return new Object[][] {
+			{"name_missing"},
+			{"name_to_long"},
+			{"name_with_invalid_char"},
+			{"description_missing"},
+			{"description_to_long"},
+			{"description_with_invalid_char"},
+			{"resource_type_missing"},
+			{"resource_type_invalid"},
+			{"category_type_missing"},
+			{"category_type_invalid"},
+			{"subcategory_type_missing"},
+			{"subcategory_type_invalid"},
+			{"vendor_name_missing"},
+			{"vendor_name_to_long"},
+			{"vendor_name_with_invalid_char"},
+			{"vendor_release_missing"},
+			{"vendor_release_to_long"},
+			{"vendor_release_with_invalid_char"},
+			{"tags_missing"},
+			{"tags_to_long"},
+			{"tags_invalid"},
+			{"icon_missing"},
+			{"user_contact_missing"},
+			{"user_contact_invalid"},
+			};
+	}
+	
+	// Various failure flows
+	@Test(dataProvider="createVfcmtVariousFailureFlows")
+	public void createVfcmtVariousFailureFlows(String flow) throws Exception {
+		
+		if(flow.equals("resource_type_missing") || flow.equals("resource_type_invalid")) {
+			throw new SkipException("TC require repairs");			
+		}	
+		
+		User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
+		ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
+		
+		ErrorInfo errorInfo = null;
+		List<String> variables = null;
+		AuditingActionEnum action = AuditingActionEnum.CREATE_RESOURCE_BY_API;
+		ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultCreateResourceExternalAPI(defaultResource.getName());	
+		Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
+		body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, defaultResource.getName());
+		
+		switch (flow) {
+		case "name_missing":
+			defaultResource.setName("");
+			List<String> resourceTags = defaultResource.getTags();
+			resourceTags.add("");
+			defaultResource.setTags(resourceTags);
+			expectedResourceAuditJavaObject.setResourceName("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_COMPONENT_NAME.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, "");
+			break;
+		case "name_to_long":
+			defaultResource.setName("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
+			expectedResourceAuditJavaObject.setResourceName("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");	
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue(), "1024");
+			
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, "asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
+			break;
+		case "name_with_invalid_char":
+			defaultResource.setName("!@#$%^&*(");
+			expectedResourceAuditJavaObject.setResourceName("!@#$%^&*(");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_COMPONENT_NAME.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, "!@#$%^&*(");
+			break;
+		case "description_missing":
+			defaultResource.setDescription("");
+			expectedResourceAuditJavaObject.setDesc("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "description_to_long":
+			defaultResource.setDescription("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
+			expectedResourceAuditJavaObject.setDesc("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue(), "1024");
+			break;
+		case "description_with_invalid_char":
+			defaultResource.setDescription("\uC2B5");
+			expectedResourceAuditJavaObject.setDesc("t");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_DESCRIPTION.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		// TODO: defect on the flow - need to get error instead create VFC
+		case "resource_type_missing":
+			defaultResource.setResourceType("");
+			expectedResourceAuditJavaObject.setResourceType("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		// TODO: in audit RESOURCE_NAME is empty
+		case "resource_type_invalid":
+			defaultResource.setResourceType("invalid");
+			expectedResourceAuditJavaObject.setResourceType(ComponentTypeEnum.RESOURCE.getValue());
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "category_type_missing":
+			defaultResource.setCategory("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		// TODO: not correct response code in this flow - 500 instead 400
+		case "category_type_invalid":
+			defaultResource.setCategory("invalid");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_CATEGORY.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "subcategory_type_missing":
+			defaultResource.setSubcategory("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_SUBCATEGORY.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		// TODO: not correct error - it not missing it not correct
+		case "subcategory_type_invalid":
+			defaultResource.setSubcategory("invalid");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_SUBCATEGORY.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "vendor_name_missing":
+			defaultResource.setVendorName("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_NAME.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "vendor_name_to_long":
+			defaultResource.setVendorName("asdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdff");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT.name());
+			variables = asList("25");
+			break;
+		case "vendor_name_with_invalid_char":
+			defaultResource.setVendorName("!@#$*()&*^%$#@");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_VENDOR_NAME.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "vendor_release_missing":
+			defaultResource.setVendorRelease("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_RELEASE.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "vendor_release_to_long":
+			defaultResource.setVendorRelease("asdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdff");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT.name());
+			variables = asList("25");
+			break;
+		case "vendor_release_with_invalid_char":
+			defaultResource.setVendorRelease("!@#$*()&*^%$#@");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_VENDOR_RELEASE.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "tags_missing":
+			defaultResource.setTags(asList(""));
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FIELD_FORMAT.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue(), "tag");
+			break;
+		case "tags_to_long":
+			defaultResource.setTags(asList("asdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdff"));
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name());
+			variables = asList("1024");
+			break;
+		case "tags_invalid":
+			defaultResource.setTags(asList("asfdg"));
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "icon_missing":
+			defaultResource.setIcon("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_ICON.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "user_contact_missing":
+			defaultResource.setContactId("");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CONTACT.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		case "user_contact_invalid":
+		default:
+			defaultResource.setContactId("abcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfd");
+			errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_CONTACT.name());
+			variables = asList(ComponentTypeEnum.RESOURCE.getValue());
+			break;
+		}
+			
+		// create vfcmt
+		RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
+		
+		expectedResourceAuditJavaObject.setStatus("400");
+		expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
+		AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);
+		
+	}
+	
+
+
+	
+	
+	
+	
+	
+	
+
+	
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java b/test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java
new file mode 100644
index 0000000..5e9e02c
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.post;
+
+import java.io.File;
+
+import org.openecomp.sdc.be.dao.DAOTitanStrategy;
+import org.openecomp.sdc.be.dao.titan.TitanGraphClient;
+import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
+
+public class Install {
+	public static void main(String[] args) {
+
+		if (args == null || args.length == 0) {
+			System.out.println("Usage: org.openecomp.sdc.post.Install path_to_titan.properties");
+			System.exit(1);
+		}
+		String titanPropsFile = args[0];
+
+		if (!isFileExists(titanPropsFile)) {
+			System.exit(2);
+		}
+
+		if (!createTitanSchema(titanPropsFile)) {
+			System.exit(3);
+		}
+
+		System.exit(0);
+	}
+
+	private static boolean createTitanSchema(String titanPropsFile) {
+		TitanGraphClient titanGraphClient = new TitanGraphClient(new DAOTitanStrategy());
+		TitanOperationStatus status = titanGraphClient.createGraph(titanPropsFile);
+		if (TitanOperationStatus.OK == status) {
+			System.out.println("Titan schema ,indexes and default values created successfully.");
+			return true;
+		} else {
+			System.out.println(
+					"Problem while creating titan schema ,indexes and default values. (" + status.name() + ")");
+			return false;
+		}
+	}
+
+	private static boolean isFileExists(String titanPropsFile) {
+		File f = new File(titanPropsFile);
+		if (!f.exists()) {
+			System.out.println(titanPropsFile + " not found");
+			return false;
+		}
+		return true;
+	}
+}
diff --git a/test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml b/test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml
new file mode 100644
index 0000000..5d1a3e1
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml
@@ -0,0 +1,12 @@
+packages:
+ - org.openecomp.sdc.ci.tests.execute.general
+ - org.openecomp.sdc.ci.tests.execute.user
+ - org.openecomp.sdc.ci.tests.execute.property
+ - org.openecomp.sdc.ci.tests.execute.lifecycle
+ - org.openecomp.sdc.ci.tests.execute.resource
+ - org.openecomp.sdc.ci.tests.execute.service
+ - org.openecomp.sdc.ci.tests.execute.artifacts
+ - org.openecomp.sdc.ci.tests.execute.imports
+ - org.openecomp.sdc.ci.tests.execute.category
+ - org.openecomp.sdc.ci.tests.execute.distribution  
+ - org.openecomp.sdc.ci.tests.execute.product
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/attsdc.yaml b/test-apis-ci/src/main/resources/ci/conf/attsdc.yaml
new file mode 100644
index 0000000..7273344
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/attsdc.yaml
@@ -0,0 +1,93 @@
+outputFolder: target
+reportName: index.html
+catalogBeHost: behost
+catalogFeHost: fehost
+esHost: eshost
+disributionClientHost: disClient
+catalogFePort: 8181
+catalogBePort: 8080
+disributionClientPort: 8181
+isDistributionClientRunning: true
+esPort: 9200
+neoHost: neoHost
+neoPort: 7474
+neoDBusername: neo4j	
+neoDBpassword: 123456
+windowsDownloadDirectory: "c:\\apache-ftpserver-1.1.0\\res\\home"
+
+resourceConfigDir: src/test/resources/CI/tests
+componentsConfigDir: src/test/resources/CI/components
+importResourceConfigDir: ../catalog-be/src/main/resources/import/tosca/capability-types
+importResourceTestsConfigDir: src/test/resources/CI/importResourceTests
+errorConfigurationFile: ../catalog-be/src/main/resources/config/error-configuration.yaml
+configurationFile: ../catalog-be/src/main/resources/config/configuration.yaml
+importTypesConfigDir: src/test/resources/CI/importTypesTest
+
+
+titanPropertiesFile: src/main/resources/ci/conf/titan.properties
+cassandraHost: 127.0.0.1
+cassandraAuthenticate: false
+cassandraUsername: koko
+cassandraPassword: bobo
+cassandraSsl: false
+cassandraTruststorePath : /path/path
+cassandraTruststorePassword : 123123
+cassandraAuditKeySpace: sdcaudit
+cassandraArtifactKeySpace: sdcartifact
+url: http://localhost:8181/sdc1/proxy-designer1#/dashboard
+
+
+stopOnClassFailure: false
+
+#List of non-abstract resources to keep during titan cleanup between tests
+#Only 1.0 version will be kept
+resourcesNotToDelete:
+     - Compute
+     - Database
+     - ObjectStorage
+     - BlockStorage
+     - LoadBalancer
+     - Port
+     - Network
+     - Root
+     - ContainerApplication
+     - ContainerRuntime
+     - DBMS
+     - SoftwareComponent
+     - WebApplication
+     - WebServer
+     - CinderVolume
+     - ContrailVirtualNetwork
+     - NeutronNet
+     - NeutronPort
+     - NovaServer
+     - AbstractSubstitute
+     - ContrailAbstractSubstitute
+     - ContrailCompute
+     - ContrailNetworkRules
+     - ContrailPort
+     - ContrailV2NetworkRules
+     - ContrailV2VirtualMachineInterface
+     - ContrailV2VirtualNetwork
+     - ContrailVirtualNetwork
+     - VL ELINE
+     - SecurityRules
+     - VL
+
+#Resource categories to keep (including all their subcategories)
+resourceCategoriesNotToDelete:
+     - Generic
+     - Network L2-3
+     - Network L4+
+     - Application L4+
+     - Network Connectivity
+     - DCAE Component
+     - Template
+     - Allotted Resource
+
+#Service categories to keep
+serviceCategoriesNotToDelete:
+     - Mobility
+     - Network L1-3
+     - Network L4+
+     - VoIP Call Control
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/extent-config.xml b/test-apis-ci/src/main/resources/ci/conf/extent-config.xml
new file mode 100644
index 0000000..ab04b26
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/extent-config.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extentreports>
+    <configuration>
+        <!-- report theme -->
+        <!-- standard, dark -->
+        <theme>standard</theme>
+    
+        <!-- document encoding -->
+        <!-- defaults to UTF-8 -->
+        <encoding>UTF-8</encoding>
+        
+        <!-- protocol for script and stylesheets -->
+        <!-- defaults to https -->
+        <protocol>https</protocol>
+        
+        <!-- title of the document -->
+        <documentTitle>ASDC Automation Report</documentTitle>
+        
+        <!-- report name - displayed at top-nav -->
+        <reportName> ASDC Automation Report </reportName>
+        
+        <!-- report headline - displayed at top-nav, after reportHeadline -->
+        <reportHeadline></reportHeadline>
+        
+        <!-- global date format override -->
+        <!-- defaults to yyyy-MM-dd -->
+        <dateFormat>yyyy-MM-dd</dateFormat>
+        
+        <!-- global time format override -->
+        <!-- defaults to HH:mm:ss -->
+        <timeFormat>HH:mm:ss</timeFormat>
+        
+        <!-- custom javascript -->
+        <scripts>
+            <![CDATA[
+                $(document).ready(function() {
+                    $('.logo-container').prepend("<span><img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ4AAAB7CAYAAACFKW5jAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABaAAAAWgBwI7h9AAAAB3RJTUUH3wwXFAQf1clFIAAANNxJREFUeNrtnXeYXVXV/z+n3To101ImvZFGQiCANKUoSBEFebEj1hcb2MWC+lpAbGD5CaKoiL2ggIgoRUIgQAohJCG9TTLJ9Dszt52y9++PfSeZTO6duXfmTkk4n+eZJ5Nbztn7zNnrrL32Wt8NPj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+PgOjjXYDhpX7WgkZMD2qY2qQFtDlSkSvjlsaGJpGUIeQAS1pyb60hMurRrv1Pj5jFnO0G1As9PvbmBiEDkeS8CSmpuEhCOi6FTW0sAYhiTRNTTM8JBoaGmDpSEODoK65EQM7YpLCCCVC97ciAUODuSU6UpO88Jpxo91NH58xwTHtcSx6vJ2DKUlTSlBVVqKVesnqlrSosaWcFTa0eXFX1nmSmrChjTc1qoCIKwlJ1W8NkDoITUPokAQ6U0I2uYL9FZZ+UNfYnvDkhoWlRnNdhIMP7HWcsqDOonKDsK7znzPLRvsS+PiMCsec4VjwWDvNaUFTh8eS8VbFvpSc4Qh5esJjKbBASDnDlZTqGmEpQQ7yPLoGSGxdIx4xtEZbyhdrA/pGIVk+ParveEt9qOH69d3i1AqTcbg8eE71aF8aH58RY8wbjresjbGiCTzpsb/JYUF9oKwpJZekhLzQkfJMIVnkCMoBY7BGIl90DQyNeEjXdhsaz4UN7V9TwvozK88p31Pzzza5uNykOqDzh2Wlo33ZfHyGlTFrOC58opMGT9DuCG6YGdG/ty0xxxby4pTgEkfKpa6gYrgNRX9ogKHhBHVta4WlPR4xtPtmRPXn/7U73XlGfYCoAf8+o2K0L6OPz7AwJg3H/Mc6aEoLFpUawe0J79RuV76525WXuYLpYrQblwUNCOh0Rk3tuQpL/119WHv4yS3O/lNnBji53OQnS6Kj3UQfn6IypgzHOcvb2ZWQnFRpWavbnDM6XfmelJCXOIKq0fQuCsHScKOmtqbE1H41K2r89Yl9qQPvmh3hnqX+9MXn+GHMGI4TH+vgX2eEtLOXJ09sscUHEx5XOUJWHysGoy+mhltmas9OCOl3/E998O9rO9yub82PMLf0uFkB93kFM+qG44HGNF/dnCSoU7s9Lt4bc+UHUp6cdqwajL6EdS01OaI/eOY469t3nxR9PuFJGTX10W6Wj8+QGFXDIaUE0M5d0XnW+k73pg5HnutJjNG+KMVG12Ba2NjzwWnB2z89O/xLDdoANG3U7baPz6AYlUeflLLHaES++nLius1d3m/bbHnB8Wg0AISEnXFvyv0H7Fu2x727gaU918HH51hkxA1Hr8EyrdkW31vZ7n67MSXqj/chJDXY3O1Zrba8HPgN8DYg2MuI+vgcM4yo4eg1QM4B7m1Kyw++2OlFRvsijEznoTaoMyGkA5wA/AT4IlDR59r4+Ix5Rsxw/L4hBWAAbwF+AZz5SprhmzpcPSnIpNChS14GfBa4HZjSYgu+uTkx2s308cmLETEc5yzvoMrSw2khrwN+AMwAmBrROXPc8b88qQNXTQxy3bQgxpHW0gLeCdxZFdAXfn5jguWtzmg318dnQIbdcLz26U7Chla+KuZ+xRbcAtT0vBc1NL4wJ8yp48zBV6ONZSSUmxrXzwzx/UURaoJZL7cGXPTPg/Yvrq4PvursPzT50xafMc+wGo4LVnRQH9LKG5LiyxNC+g0lpnZU7vXicpO7TyrhqkkBwoZ2fBgQCRFD47xai7uXlnDz/Ah1wf4v9ZOt7ikr2pw73v+qstO1n+z3jYfPmGbYwgyvf6aTqREt+uAB58uTw/rH/rSsNNhrfn8Una7kvkabn+5KsabDJeUNdwuLTGacjwtonFppcs3kIBfWBai0Bu5AhyO58rkuHm92mFFirHltrfXedTH3hWfOqRjtXvn4ZGVYhuWtWxK80CmsZ9rsT+9JiC9+bGYo/J2F0bzcm4NpwWPNDvc12qxsd9mXEoieyraxZER6OQSllsacEoPzqi0uGW+xtNyk1MyvsRL4xZ40H30xTsKT6BrMiBj/vaQu8J7tCXfHg6eXj3ZPfXyOouhD8SMvdHLj3BL99c90XrM17t2edGXpdxZG+OSscEHHSQvJ1m7Bs+0uT7Q4rIm57E4IEp7kCC9+JIxJn/OFdI1JYZ1ZUZ1lFSbnVFssLjOoCeoFN+fxFof3v9DN9m5xqC+mBnNLjL9cNSn4walhvfXaqaER6KSPT/4UdUlDSon221bWd3WdtyfpfS3pSVUSOojBHdQ1FpYZLCwzuGZKkH0pwY64x/pOj7Uxl21xwYGUoDktSAiJK6CYYQFNU0uoYV2jOqgxKaQzM2qwoFT9zIoa1Id1FZcZJI81O1y/Pn6E0QBwJWxPiDf+p9nZ8+mZoS883+4ml1Ue/6tPPscORX1ev3ZFDFfI2eu7vN+12PJkACR8dk6Ym+dHinYyiYoLtNmCVluyJynYkxQcTAmaMq/FHElaSBwJXsagmErBK/OvRkCHgK5haRDQIWRolJka5abGuIDG1IjBlLBOVUCjOqBTbmlF6UNaSP683+amTUl2xL2cf4VKS+u+bHzg479aWvJzQPq1LT5jhaLdiQ812fx2T7r0v63OHftT4m09gxUJ59da/PXUUsrynPcPlZQnSQpwhcRD1YqAKjbTAV3T0FEehaH1/CgDMtzsSgh+uCPJz3eniTmy37+ABiwsM3Z+aW7kf66aGFjlGw6fsULR/N/X11jaFzcm3tmUFld6fWICz7e7PN7icPn4wIh0KmRohIzMyccIHY7k/gM2P9ihVo1kHs2TwM6EmL4z7n0RuFZK2e4bD5+xQFHyOKSUfH5jYv7BlPh4WhDs+36nI7llS5It3d5gDn9ME3PUtOStq7r433VxVre7BaWqdDuS3UlxkSO4llGqZvbx6UuxbsRQxNA+1u7IWVnf1WBlu8snNyTYmxyLqqHF50Ba8Ku9af5nVRfXrOnm4YMOSU8OygnalxLBtJAfBZb4iWE+Y4EhT1UyN/IFC8uM/xnolv7HAZuPAN9eEGFOyfEnvZEW8HKXy0NNDvftt1nX6WJ7HN7+aZBICbrGNOB64DopZcKfsviMJkMyHBmjUQVcf3qlWbGk3OCZVjfnIJHA/QdsmtKCr5wQ4fwaixGKlw4bnoQ9ScEzbQ4PHHBY3uqwLyVUZ4doMHqYEtYJ6RrAG4G/PN5s3z/a/fZ5ZTOk2zpjON4P/BAIPnDA5n0vxGlKif6PLKEmpPOeKUHeOzXI7Oix5X2khVoCXtPh8Z9mm+WtLjsSHk6Pd1FEgrrGL5eW8JZJKrAsJI90OOLqXzekO26Y+cqQMvEZewz6Ns8YjQnAfcBpoJ6+9+xNc+PGBAcHMh4ZTigxuHpSgCsmBplXYmCNwfCfI6HdFmzu9lgT81je6rA25tGQ9NRUZEhXsh8kLKs0+ftppT0CQOxLitSdu1Mf+sbWxC/EG2qGeAIfn8ExVMPxQZS+xqF1Vk/CAwdsvrgpwYZOb+AzZFz6yWGdc6stLqixOL3SHHJW5mAREuKepM2WbI17bOzyeCHmsibmsjchaHN6bUg7zM0L6Ro/PjHKtVODh061Nuby4RfjK84cZ17+7QXRVj/W4TMaDCrGkTEa1cDb6WU0QCVTvXFCgFlRg1u2Jrmv0Sbh9rOakHl9b0Jwz540v9+XZmJI56Ryk6UVJovKDE4oMai0NEpMjUiRjIktIOFJ4p6kOS3ZnfTYHvfY1i3YFvfYnvBoSUs63SyGYgTGqga8tT7AVZMCR5zuYFqytds7pdLSzr9xY+KPw98SnwLp+XMd18tfgxoCpz3Zwcqzy98M3APkrF7rdiV/O2Dz4x0pVnW4uCLPM/a65BFTo9zSmBDUmRLRmRDUqQ3q1AY1qgIapaZOqan0L/Q+9R62kKQ96HKVAYi5klZb0pxWaelNaUFDStBqC5KeMiSMdAFdDi6tC/DjxVGmhI+cu31ra5IvbExwQqnxt1sXRt92SV0gOXqt9EEJUy0CFgNTgCjqzkkCDcALmZ+m0W5oMSnY45BS8udGO5ry5NUhQ+u35LXE1HhHfZDzqi3+2mhz7940L8Rc0gMFEXu9l/AkCU/SmBSs6Tj8uqEfrjnpSSXv7bXLjA0QEjzAkxJPcrhEP8f5RjXZVIKlw5snBbl5XuQoo9HpSh5rcfAkHEzLs//YkF4spFypj73pylnANeTOE4qjAupbBzjOFcAlo9D+DuA2YG8/n5kEvBV4MzAfKCH73dMNbAR+B/yW/AxIFfAZlFc/0vwX5RD0S8GG4/vbkzzR6i4bH9Bee1aVldd3JoZ0PjI9xJsnBHik2eEP+2yebXdoTWce7/nc930+4x0qXivQIxxzYyyDhPEhnQ/PCPGh6SHGZSmc+W+Lw8o2tdzd4YhxOxPiMg1WjnbT+2AC1wLvGeBzu4DvDfCZU/M4znDQDPya7IZDQ6n0fw04k4GTKEsy/VgKXAx8HliVx3feBtSPQt8FeRiOgtcw6sO6tqXLu+jZdrdghZnxIZ13TQ7yh1NK+PtpZXx+bpjTxvUSvTmuZ4U5kFBmalw1KcDvl5Vw4+xwVqPRlBb8YEeKTkddJE+i7Ut5F/xkZ2qsLa1MQw2sgbgYGGgn7tGqUXDIfTe+Dvg5cDaFjR8TeC1wF5kNuQbAHaW+53XNC/Y4VnV445psce7L3R5CZTQWTImpceY4kzPHmdwwQ/Bip8cTLQ6rOlw2dnkcSIvDy5wwdr2EwZJZSaoL6rym2uTt9UHOrbYoyZENlxZw+44UT7Q4h66FBNpsuWBlu7tESvnvMbS68mpgah6fOwkVF3hqtBtcADOAbwIzh3CMJShv5RqgZbQ7NFgKMhxSSi5d2XWiLZi3ocuj3ZFUBYZ2w9YEdc6v0Tm/xiLuSfYkBC/EXFbHPF7qVII9TWml/OX1jU+MmbEy0IU7/GvU1JhbYvC6WovLJwRYUm70ZIVmxZFw1+4UP9qRwu3zDOz2ZKTZFucD/x7tLmaIoDyJfOaw44CLgBUcG76mAbwbNfD7w830p79rcAFwGWp/oWOSgj2Odke8KunJ0p78hvNr8otz5EPU0JhXajCv1OCt9Wo1pNVWS6Uvd3lsjwt2Jz12JQSNKUG3K0l6kBIy96030salTztChlr9mVdqsKzC5Owqi5MqDMYHB/Zy0wLu3JXiKy8n1BSlT19cgbY/KZa91OWVA7ER7mk25gJnFPD516HygMbaikO2u6YOuJzc05O9wN+A9aipzhzgysy/fQmgAr9/AHLtwjVaj8W8zluQ4eh2ZUBDe5WUELMlv99nc1aVRR5jYFCUmhqlpsa0iM6rM4HYlJDEXYi5ksaUoCEp2J8SHEyrn6a04GBaJXAlPUlSqFUZZ5hny4aupmAlhkZtUGdmVGdeqcGiMpOFpQaTwnpBQkZtjuS27Ulu256iK4fgj1QrRgufb3enoG7Y0URDGYLaAr6zABU4fDDH+w65B1Y2LLI/6QWQJj/Ppmcpta9/Ox8Vv8lGM/BR4IE+3/s3Ksg6Kct3FqKCn1uyvCcz/U7m2WYdCJJ90DuZn3zQADufDxZkODQYb2rMEJn//L0xzVsmBYrqdQxESNcIBaAqoDEjcqTFcgTYUmILiLuSFlvSYgtabEGbncnhyEgLdjoqt6PLzUgMCnCkxJXZtUsNDayMzGDE0KiwlCcxIaQzMaQf+ndSSOWZRA3lbQyG9Z0e/7c5wd8bbZyeYrkcpDwqyi1toZRy/SjHOcpRU49sj5Fu1I3d90aJoJZb/0n2oNwfgLV5nl+ilkffkuW9PcD/AW15HiuV+U5vJpM7mPtQ5qevsfkvagn201m+U0luw9GCqoTOtxipFvgy2Q3Ub1CeUD5owM58PliQ4Qga2vSpEX0KLeoUzWnJzVuTzC81DtVSjCaWDhYaUQMqLY36MKip6WGEVMlhQspMfgekPUlKQNKTpAXILEY+oGvKaBlKwNjSD8sNDiZAnI1OV4n+fHdbko35pOsDZaYWmBU1lgC/Z3RjBUtRAc++eMAvUUHTRVnePxeVOJXtht2U+cmXE3O83okyTgeG0L8w2f8iHvAI2Z/qAvgPyhvpK1UfILdhSFBY3Koe+DjZDccG4O9D6HdW8jYcmTTzBadVmtF796bp8TqeaHb45pYkN8+P5FwVGEvoGqh4bq+2jnK7XQkr2xxu25HioQOFCf5MDutMi+jzUDdhfJS6oKO8jWxL9C3Ar1BP8WyGYwZqaTOvJ90Q2jdU7Zl0jtcFcLCf7+WaJLvkOS3Is3+5GBZ5/ELdhPkX1lra3FLj0LPNA362O8XXtyTpco+F4PjYQUhY3eHy0RfjXPV8N3/ZZ5MU+RsNTYMl5QZlpjYDKBvFrtShchSysQp4CfXEzxbAtVDTlWJsHpPrBtQZerAxRvaBbgCz+vnePDhaThM1fWsuQp9BGa/++l50CjloGJg5I2rw3inBI8rfU0JllH755YSqHvXpF1eqKtcbNyZ403Nd3LEzxYF0fjIEvSm3tJ74Uh2FBSWLzRmoFZW+COBfKG9jTeYnG2cCs4vQjly6lMWQVNpDdsOno+IqdVneOxGV+Zrt3Ps4Oo4yWCRj2HBUAHUa8O4pIS6sDRzRVFvAj3akuO6F7lekKHE+JDzJ8laHD63r5rKVXdy6LcneROEGAwAJZ42zWFJugjLqkwZxlGLQ4zFkq1tqRAUIQQ26B8nuuo9H5TYMlVyGoxgex2ZUvCAbZwEf43CluI6K3fyM7HEfULGPjiL0GTJlWf30vegUctByMkU3VQGNr84Ls7DMOMJ4OBL+uN/mHau7efCAjfPK0CUekIak4J69ad62ups3PdfFXbvS7OsRbR7k7Rw2Nd45OUipqZEWMrSy3c0nW3M4mIYKfGbjOQ6vGkhUEHF/ls8ZqBjJUKdbw+lxdAJ/JHsQ1AQ+hMrbqEMVqN0DLMtxrPWoZdpiPWFHfKpSSOCkDLWEBMDScpPvLYpy3bo427uPXAF4vt3l3Wu6efvkIB+eHjouhYkHIuZIVnW4/KvJ4ZEmh03dxREuBkDC62stLqpTq5vb48K4ZWuyLiEkkWIt8eTPa1CrIn3xgIdR05QetgJPonRc+nIKKni6YghtGU6PQ6LU7q4mu6GsAG5GTUFOJffY2g18FlUxWyxGfKpSiOGooM86/GtrLH6wKMr16+Ns6208NGh1JD/YkeLRZof3TA1x9aQAk8bAku1wEvckW7o9Hm12+GeTw+oOl5jdqwK4GGNawpSIzqdmhQ8llD3V6vBsmzsupDaoG0k/LwxcSvb7qAFY3ue1NCpJ6kqODoZWoryOpxn8snJ/+cPFuPoHgFuAE8ge05hK/3U661FG4+EitKVvv8es4ajM1oiL6ywiRpRPvpRgTcfRCucbOj0+syHO7xrSvL0+yOUTLKZHjh8PpMuVbO72+G+Ly2MtNms6PA6mhUoiK9bt2ouoqfG52WFOy2xCnfQkDx100DRqV7d7AY58wg83C8jozWZhJbA9y+tPoeIFi/u83pN5+gMGv9ownB5HD0+jvIW6Ar7johLEvgS8WKR29O33mDUc0VyNeE21xT0nl/ClTQkeOGAfWYylqSSrVe1Kt/Onuw3eNCHApXUBFpUZx0TuR2+UiI5gQ5fHilaHFW0uL3Z6NPc2FjAslQaWBh+eEeLdU4KHks7WxjxWtLlEDMpXxdyR3tL+tWRfzXFRy6/Zli8bUSstJ2a5SvNRbv4/Btme4Yxx9PAqVLp4vhwEfgz8P6C1SG3oy9j1OJrSIloTzK01taDU4K4lJdyxK8WPd6Ro7Ktyrqm8hU2dHpu6kvx0V4qlFSavrw1w5jiTuaXGiG1KXQieVBmd2+IeL8Y8VrSpKciOhCqyY5iNRQ+WBh+YFuLG2eFDIs4pIbl7T4qWtGBaVA82pcVIzgUrUZWw2Xq9m9yxCoFaXXk/vWJmGUqA16MMy2D0KIbT4wijYjM3ouQC82U5SrCov+S8bHUmWqY/NgNP3cau4bi3IV37jvqgXttPRVtVQLnRZ44zuX1HikeanKOFijO/t9iSRw6qwGFtUOeEEoNXjTM5rdJkYZnBhKB+lI7ocONJNRjbbMmOuMembo+1MY91MZedCXHYq+jVj2GvYZQQNuBDM0J8cU6Eil4iP/886PCX/XZPM4wRaE1vlpI7xXsFynjkYh3wPGpq0pfzUEvL/X2/n6uVlaF6HJUog/EhlOddCK8D3gXcSXbDthRVZ1KSpc0vomIiafpnIMOhUeRyhLwNx0MHHX121OCyAXacNzQ1dVlaYfLgAZuf7U7zTJtLKlsadeb/TWlBU0rwZItDyNAYH9KYHjFYVGYwt8RgWkRnWsSgKqDqRYIGBLTBGZWeQri0p4KZB9OCPQnBrqRge9xjc7fHnoQqjGvPthXCSA5NCXUhnU/NCnHd9BDRXkVz2+IeX9+SpMOWPdNBGfdGLPlOR+VuZFs+TaOCf/1VZHaigqQXcPQTsScFfTCGo2eu3/evNBSPoxK1WvJeBpe+XYaKbexGxTl6EwA+ALwhx3e3kp/nJRjhPI68L8TBtLAfOODw+rpAXqUdZabG2+qDXFgb4OEmJVT8dJt7SPoulxFJCcmuuGRXXPB4s1K8KsmU15ebGnUhnbqgRpWlUxXQKLNUKXuJqR3RLg9whTpetyuJe9DhqCrZNlsZjGZbEHeh25Mk+6bLj4ah6CGjrPaqKpMvzInwulqL3oW2bbbkpk1J1vYKRnsS1xUjVuQ2ETg/x3s7UQHEgfgPKnNyWp/Xgyij9CcGftL2JZfhGKzHEUZ5Gv0ZjRZUwPfUzHXJxgTUakwjR1b7LiC30WhGCRznk+sxdqcqpkb838223NAV1BaX5W94qwIab68Pctn4AM+0udzXaPNYi8OuuHc4QSyHEemh25V0O5JG4OWuo6+jnlE813p9USJ79CoQ/V3W0TQQfcm0cWpU592Tg7xvWoj6PkvYcU/yrW1J/rw/fUSXBHRPCGkjpVOZK8Uc4AnyS6XeDDxGdjHiM1H1HxvyOE5vih3jeBNwHbnHyUvAF1BG8ApULCNX/GMR8K1Mfxsyr12Eyprti4fSNc3HAMNYNhwBXduzJ+m59+61rYXzTQqVmigzNS6stTi/xmJvUvB4i8M/Dtisjrk0JMVhWcABNm7KhpBgD6R4PhYMQy4yzR4f0nnDhAD/Oy3I4jLzqKlYypN8d1uKH25P0bckKOnJfcsqzZFYig2gcjeyFW45KKOxkPz28NuMcsX73oeTULGOQg1HrgE0GI9jMvAJjo499LAWZVSezfz/d6j4x80cHfTt4Xzgq6gS+HJUPku2dq1AbR+Rb/Xs2F2OnR4x9u+IC/c3DWnryokBTq8c3MqfqcH0iM70KUHeXh9kR1ztxfpYi8MLMY/dCXGkFOBYHvBDJeNUT4noXFwX4JopQU4uN7Pun9vlSm7ZmuT27SlVQdsLS4fqgN68LuaORPLXdFQMIhsmKt36E3key6SvYIqiJ4byC1QVab7kGkCD8Tgu5+hckx52ATdw2GiA8hLuRhmPr5Ld4OjAO1Bp92Vk1y9NAneQPTU/F2M3OPrxmaFYY0p0PdnihL+7LcnPTyoZ8vJpUOeQxui1U0M0JAWbulye7/BY1eGyucujISWUPsXxYkgyxqLM1FhcbnJxncWldQHmlRo5vbiDacHXNif52e4U6SymIaRr4txqs/VjM8JcP/w9OI/c+31oqAzjYnAyyr1/poDvFCuPowS11JxtfLiovIzlWd5zUPkapcDnyC4VEOCwIlg2o7kJeLzAazV2pyqnVZqxyycEmp9td2ofPODw891pPjYjVPCUJRdWjycSCXBxnRLqbUh6bI0L1sVcNnR57Ih77E4q6b+UJ4+W+BuLRiXTRkOHSktnQanB2VUm59VYLC4zGTeASvyGLo8vbkrwQKOdPUomoT6kpy4dH9g1AtKB/Q2oYlMNXEjhhiOXx1EItSgdjWw0oVZHcg3UFPAdlOdxPX32Vs4QzPHdNCq2Uah489idqgAdb54YaL6/0ea/zQ63bk0yp0TnkrpAAYfIn6AOM6MGM6MGF9VaCAntjtIM3ZUQbOry2JXwaEwJ9qWUYHGrrfRD7VyXcTjHVZ/zBQyosHRmZ0SLT64wWVZhMiOqNtAeCEfAPw7afOXlBOtiuWUEdQ1eV2slLqix9g540KEzn9wp5sPBhcCPyH//kWLlcZSTO07RRP+KX6CSvb6BUmX7IPmPs3+gYiWFTjlHvKy+EMPRNSWs7/7YzBBrYy4HUoLPbEgwztJ51bjhfwDpmlqhqQqo3esvqlX1drZQmZ2drlI835sUHEgppfOmzJJrU1qJFic9JUjsCCWm4wglTlzw7C+zV62pKy3SoK4EjCeGdKZFdGZGDeaXGiwoNZkc1hkX0Aq6a3cmPH68M8Uvdqdps/tRBJMwOapz9aRgU8TQBrqZh4qGGsgjuZ/pIlTVbL5FYcWKcVj0e9XzIsbhxK53MvAAPgB8F2gf5LUaiTqdQxQy4iWw+ZI6i/dPC/H9jKDuR9fHuWNxlFMqRrpMQhHQoTqgUR0wmNGneM6VaiUiJSQpT+VrxDLq5j0q5zFHbZ9gS4ntKU0RL4vMuaFphA2lsh42lGhxmalRFdAZZ2lUB3XKTY0SE4KDTHeNOUqs+Ec7k6yLeeoO7edQmgZXTwxySoW5A5VUNZz0bKCUrUVp8pfgz9oV1NO577GjqCDpI+T3FO7P1yzkj5Ikd/5EBdlFi7LRisr8DKFWUPobJLsYeBPugfqejdH1ODRNQ0r5UlDX7E/NDAU2dXk8dMBmdbvL/66Lc9vCKGdVjY7xyNm5TPJYyZgMfhwm7kmebHH4ya40/25ysmfZ9kXCnFKDa5WM4yYK239kMJxC9uIuG7Ut4vMM/skWROVDnJzlvXNRwdh8ckP6C44WMoC6Uepc2aYrFaiktYY8j3UQ+CkqqNxfjcti4COo5dzBLKuPTcORYSvQOD6kT/32gggxR7Ci1WV1u8t71nbztXkRrpyYX2apj0pse7zF4Zd70jza4ijtjjyfjRFT45OzQswtNWzgBYZ3awQDVXyWLcV8F0rFfDAp4r05EVW30bf3s1HSfL/N4xjFyuNoz/Rnepb3ylGJYc+RX57FKcBXgKoBPhdGLWN3A7dRuAc3ZqUDQVnZ7QDzSw1uXxTl5Ew+x9Zujw+t6+abW5JqXu6Tk/0pwa8zUoLvXN3NX/fbxJw8vIwMGvCW+gBvqw8CtKcFw70Z00Rya4I+g1K9GipPkn26FUBNV4J5HKNYqwud5N4ISkeloL+H/h+8Zqbdd5P/zvYlwOdRe9QWIlozpjVHQVnDQ8tjJ1eY3LWkhFdXW6CpGoqvb05wzdpunm5zEb79OETCkzzX7vLVlxNc9mwX73uhmwcabWJu/gYDAKmKCL80J0JY13iyxdl/w/p4sWT2c3EW2Xdod1Dp1sVIdV8PvFzg+fvSXxykkHtdoAKyXTneL0dNzz6BynLtPciDqCnXt1EJbIsojArg68BVFHZnjNngaA9PoebTEYCTyg3uOinKjRszWxYKeLDR5oWYy3unBHn3lBDTIsNi9MY8CU+yMyF4qtXhHwcdnm13aVJbxQ0uCVrCSRUm310YYVpEZ1WHy81bk+v+tTmV73LlYOh54mdLZtrDkdmTQ6EN5XVkW+7tSUEfSKezv+BooTfhSlQtzeU53q8EvobKBH0eZfQqUbKCp5G74I1MG7ei0tqzBVprgVtRD+oHyY+xG+PIBEjXoZSrl/S8PjtqcOfiEuaVJPnRzhQdtqQhobId/9po8+4pQa6aGGRy+Pg3IDFHif482ery72aHlzpd9qcytThDKaiTsLDc4EcnRjmp3KQ5Lbh5S9Le0OU9EqwLuIWWkRbATNQTPxvPoWIcxUCgMiav4+h07Z4Yy6/I7QX0HCMXhd58ncD3UTGKXFtPBFAeRaFexUvA+1Cxkk+QPUlscub8CZQBy+f6FaPfeTEYj+Mgaq+MJb1frApo3DQ3wsIyg1u3plgTU1OV9TGPz25IcO9emysnBrhsfIB5JUbWeoxjkbgn2Z8UrImpNPnn2l1e7vaOFv0ZirMo4eRKk9sWRjljnIkj4Ac7UjzR6uycV2o83XB2xXB2MVeKuYfa33Qoy7B9WQtsI3sNx6moMvSV/V+pomZQLkd5FbdQvFT6nagVpOdQRX4VKDW0bDGNWcDtqJjKcwP0e8wbjp7dud5LnyeDpcPVk4KcXGFy2/YUv21I026rJKu1HS5rYy4/3ZXi3BqLi2pVoVx9WD+mVmE6XaXlsbHTY3XMZW2Hx0tdLo0pSbq3kE6RVC414Nwai+8sjHBSuYmQ8Mu9aX60M0W5pT16UXVw71D2ExiAKKoSNttNvZfC0sHzoRk1FV6S5b1xKDWtZ8ltHIo5Vek53t2ZY97E0Da9kqjB/3kO16LEUCI/JcDbcrRxIapS9n2oOFB/bc3G2DAcmenKs6inQ9YqyVlRg+8ujHJxXYAf7kjyeItDOpNOsych+NXuNL9vsJkW0TljnKrbOKXCZEpYyQWOFWwBLbbKSN3QpSQEN3UrlbCmdB/xn2IrmksIGWrTpS/ODTMlrKuNPRptbtqUICXoPiGk/21n0hvOitglwOk53lsN7Cjy+TyUW/4Bjnbfeypmf0JuFXRJdiNnUNgqRW8c4C7U9PwzqH1k8k0A62E/aoOmn3L05totqIK4EuCNOb5/Kqqw7v0oL6UQ+suCHTSDzdhq73bl/WFDO9PQslu0oK62Tji90uS+Rpu796RY1XF4U6K0kGzu8tjc5XFvQ5rxQZ0Ty0xOrTQ5vdJkdonB+KB2SJh3OJFApyNpslW6+ta4qoXZFvfYmRDsSXh0uZIjitaHYeuD3g2aEVV7p7xzcpASU0MCf2+0+eRLcQ6kBOND+qolZdbzdywpVAKzIKaSe6XjTxRvt/XePIcKCGYLLnZlXs9lONpQXlCkz+tphpZZK1ECRS+i0u6vQsU+xtNnr6FeJFCKX4+jCteeJ3c26j7gk6iM1Z7ckd5ygE6mDZeg8kv6JohJVFVttmncywxDjs+gbn0pJbdsSS4+s8p86Kwqa2I+BzmYFjx00OHXe9M81+4S73la9/5yZrUhYmhMDuvMiOrMLzWYX2oyI6JTG9SpDmiUWxpmRnN0oHMLUEpgUq1yxBxJW0ZCsCEl2BH32BEX7EkKGlKCgymlB+L1NRIjgVSJXZeNt/jkrDDLMmn8noQ/7U/z6ZcSNCQFloE3t8T4yEuNyTt4+8QhnrRfguQeGP2lZQ8FDbWCk8tDSJF7+dfIfLfvX0xmvles9oZQ8Yc5KI3U8ahSeoHyIPagPIvdqOBxvnGg3tfbI/v0I5fqeYjcMgBFF3ga9JCI3t8SvGJS8Ccfnxm69qTy/B2XNlvydJvDn/crCcF9SaHyPbL9qXsaqamNiKosjXEBncqARnVAoyagU2YqvdHenokjJEkhibtk6lFU5WwsU6PS4ajfU57kKOGwUdIYNXU4rdLkuukhLh8fOLTfTMKT3Lkrzc1bEjSnVc5HpaWtP63SvOT2RaV755YeJ1HmY5+eO+cVkb00+GFy135OnxM5a0bU+MvXTgjXzogWNoV0BGzu9ni0xeGxZofnO1TF7VHbD/RmIN3QfD47tF4XF6nK70+uMHlHfZArJwao67X9xL6U4Ftbk/xsd1rFUzSwdLy5UeNzvz+57DsLK46fHfF8ji2GNITu3Jm07tmb/t7EkP6R7y6MDjpPI+FJNnV5PN7i8Eyby+qYy/6kyC1mfCyTMWhllsaZ40yumhTk4jrrCIMhJDze4vDVzUlWtDpH+KuTQvraC2oCb6gL6g23LowUdm4fnyIxpCF5yTMxrpgYXHTXrtR99WF95m0Lo0waYpJX0pPsTgqebXd5ts1lVYfL9oSn6l+OVfnATLutjDjR+TUWl45XO9iV9lmLbkwJ7t6T5ic7U+xLHrkbXoWlpS+osT72p2WlPx0BtS8fn5wM+e6TUmq/3pv+1Pe2p745Oayb318YYWaB05ZcCAltjlp9WRVzWdXusr7TY19K0GqLI6UDx9I46tWusKkCvadVmpxfbXF2tcnU8NH6oklP8kizw/e2pVjR5hyZaYrSAXldrfXgh6eH3vly3O24fobvbfiMHkMebq6QGBoT/rjP/sPnNyXOnhTSuW2RSlYqNraAmCPYFld5FS9ktEj3JQVNtlAVpiNtTPqcL2JoTMgogZ1WqeQCl5SbTAzpBLI4Y46AZ9odfrorzT8O2od2ZuuNDlwxMdD8iZnht57x345HuaKQrUt9fIpPUYbWj3cm+dC00KV/3Gff8/GX4pXVAY1b5ke4sDYwrHu/isxer01pya6E2utV5V8I9ic9mjK7ttkiy+rJEK+anjES1QGNuqCSC1xYarC43GRuic6EUP/JbLaAtTGXe/am+ct+m4N9N+nOoANvmhjwbpwdvvXkCvPLgONPU3xGm6LcgVLNGQKe5Na/N9ofveGluJ7y4OMzQ7xvapCa4MgtGUrUU7zNOaw9ui8l2J3w2JPRI+12JUkBtpBZS/91DSxdI9Dzb0ZTtNzUqA4qQzElrDMprFMbUEai1NTyUnzvdiXPdbjcuzfNPw86HMhhMHr+OFdODPCNeZGn55QYb5GwV/eNhs8YoGh3YcZ4TJbwm4ebnLM/+VKcLV0e59ZYfGJmmPNrrKyu+kjSY1SSGR1SR2TPsOkRIrY0DUtXWzcE9PwSzrIhJOxNCh5tcfjrfptn2pz+RYhRm3e/tT7IN+ZFmqaE9WuE5GFjON03H58CKOqdmDEe5wG/Xt3hTvzcxgT/aXKoDGhcOTHA+6eGWFphHlNFbUOh2Zas7nB5+KDNv5sdtnZn9svtr/+Z7NEPTAvyhTlhpzqgfwP4hqaN2L6wPj4DMhyGQ0cVKX27ISlKbt2W5O7daeKOZGJE500TAry1PsjJFQah4+wJKiQ02YJ1MY8nWx0ebXbY2OXR5WRJr896AWFCSOezc8J8YGqQsKH9Fvgo0ObHNXzGEkW/GzPGI4ySP7s+5Unjj/ttvrMtyfqYKhWoCemcX23x5okBzqoyj0h+OtbodlUMZU2Hy1NtLk+3uWyPF2AsenFqpcn/nRDhtTUWmsYzmtqPY7tvNHzGGsNyR2aMRxVKhORtgLa52+OHO1L8fl+a1rQaVGFTY1GpwWtrLc6ttlhUZlA7xo1IzJEcSAu2dHs835HJLelSwj090gGFaoiWWRrvmBzkU7PCTIvo7E6IXZ2ueNeJZeZy32j4jEWG7a7MGI+pqJ23LwQ0W8CTrQ4/3ZXikSZH5V1kWlFqapxQYnBKhcmrxqnch0lhnUqrsF3QikmXq3aD259SZfYvdqrl3q1xj+bM/rWDzmaVavVmWaXJJ2aGuXyChY7GYy1O2+Mtzg3fumnXvfLP86VvOHzGIsNtOECVH98BnN/zQtyTPNXq8puGNI80OSqHoRemDjVBnRkRnRNKDRaXmcwtMRgf0qkNaoyzdEx96NJGErXbW7crabMFzbakISnYHle5IDsSHnsSgsa0IOX1KrUf6lWTMDWic+3UEO+ZorRYW23Jr/amuh466Hzu0fWpO9+9IOj9cnglAX18Bs2wPs56GY95KPmz83u/nxbwQszlj/tUTsO2hIfT293vcUgyy6FVmWSr2qDap7U6oFNhqbL6qKERMVS+RTCHupArJUlP5Xg0ppSR2J8StNhKn6PZFnS5Eq+vcmWxrpKE2pDOFRMCfGBa8FB27eoOl9t3pGKrO9ybtnaJn9RHDGfn6yqG80/j4zMkht0P7uN53A5cfNRngN0JwdNtDvc12qxoU9sIZH3C903Y0o78VdNU/kXfBRuJ2hPW65270c+xincBVJsmhnQuHR/gXZODLKswsXQVL/ndvjS/2JNubk6LL0wKa7+IpTV3/QUVw/K38PEpFiM2gc4YkCmo1Za3kkO2MOlJtsUFK1od/tXs8Hy7y8G0OCzbdyxM+TMGKWhozCs1eNOEAG8Yb7GgVBkMV8LTbQ7f357iuXZ32+SwfuMPFkf/+vEXu8XT51QO7dw+PiPAiA7DjPEYB3xWwHW6klvLSc+GRk+3uSxvdVjV4bI3oVLGR6cH/XVO/WPoMCmkc8Y4i8vGW7y62mJS6PDEaVOXx527Uvxxv40j5PMLy8xPPn5m2fIbXopz+6KSQZ7cx2dkGfFhJ6Uk4cnQupj3fk9y04Iyo7rSGrgZjlC6pes6XVa2uazucNkSFzSnBZ3u6FbFllqqIvbkCpNXV5mcXWUxI6ofSnCTqL11/7DP5t69afYkPbcupP9lbtS46ZGNiS3fObeCT80qVDjbx2f0GJXntSMk1p2N5gUnRi+dXWJ86dVV5tLzqq2CiuHinqTVlmzp9lgbUzodW7o9DqQELY5UYsi5dtjojwEqaDWl+UlNUGdOZvn41EqThaUGNUGd3l1IC8mLnR5/2mfzt0ab7XGPkKG1zIzqt79hQuD/PdbktN04O8QbJobw8TmWGDVH/9KVncyMaDzc5M60dD5bH9LfcnFdoPSiOouZEaPgcnxHqKlNY1qwOyHYm1QVsbuT6vd2R9Ltqp90piq2x0bomlraNTRVCRvQVVVsMFMVW2oqj2JmRJXPT4voTIsY1AS1o9LmJdCQFDzT5nL/ASXI3JgU6BqyOqivnB7Rv/G3ZSX//MLmpLj7pNLCOunjM0YY1QjBOU910pj0uKDGDD3a4l7W5crPVFraKa+psrh4vMXJFSodfSiN9KQqn+92JR0ZlfOUUEuzPQs+hga6pmFqaj+YoK6WdMO6UlcP6sqo5CrO8yQcSAtejHk83KSMxdZuoXZ206DE1JprgvrP5kb1Hz+8Pbnvo4tL+OGJfjzD59hl1EOLUkres6abX+xIcuXU0ORn2933tdry3YbGlDlRg7OqTM6qsjixzGBKWB+RDZoGQkg1VdqVEKyNufy3Ram0b48LEr32iwkbWrzS0v45Oaz/6OdLS5766Lq4d2qFxbd8kWGfY5zRH4UZ3vp8FwlP8rfTSrXTnoydtDsh3t9qiytcSa2lQ31IZ26JwbJKkxPLTKZHdCaHlYBOQM9PRGcwOEKpjLU5kt0Jj5e7PdbFPF6MuezOJJD1zjfRgJChpSstbfnUiH7XKZXmQw802t03zApz/fQQfgq5z/HAmLuLr9/QzQP7Hc6uMq2Vbe7p7Y54R6fDJSkhJ/UEJQIGjLN0qgIaUyMG0yNK43NCSCly1QQ1yjIGxeonNV2gJPxSQpL2VIxEbeCkpjX7kmqnt+0Jj8aUSkvvcGRWkWQdCBlavNzSnpoS1n89r9T4x1/22x1XTArwKz+W4XOcMeYMRw9nLu9gS7fHOyYHzYcOOItabXlFSshL00LOcwTBbKsflg5hQ+3qFtBV7MLsJzbhSBXr8DJbRLpCrYTYmbiI6CsPluU4GVnBhgpLe3xqxPjz7Kj+xIMHnM4zq0z+cmrZaF9GH59hYcwajh5e/VQH2+OChguf4pQnzpnQ5ohXdzjy9SmPM1wpp9oiy96mgxUlzvNqBFQA9WCJqa2psLR/zY7qj15dH9zy9c1Je3ZU5++nlflTEp/jmmPm7j5neSfNtkeXC5fWBaw1Mbu+xZanJ1zOTgq51BZM9aSsdYSamRRR0BxDBTq7TJ09tQF9o6nxxLSI8Vx9SN9457Z44uzxQWZGDX651J+S+LwyOGYMRw/jH9jH1LIoaaG2PvjdyaXGDRsSEUtjzr6kNytsaEsTnlzQbMvagMYENCpTHkFbSKOnv7n2t5YgLA0R0LUEcCBssH9CSN8LPDcxpG8aH9I3XjUx2HrpEx326yar2dIZ5QG+utDP+vR5ZXHMGY7enL68i1Jd0JiWVFoaqztc4peO47MbEta6Lq+kxNDqW21RtS3uhbtdWV1uaVODulZqaRi9Ku/TmqZ1t9ui5UBatpQYxKdFjXh9SG8I6TT+YVmpo922z3v96aWMD+lIqXFulck1U/1sT59XLse04ejLHTuSbOwSrIo5TI4YmEBTWvByt8fedhfWxeHmBmAb8CJQAcZ58I4aOKMcakyqQio7dGZER5OSoKlzTrXFtVN8Q+Hj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+PzSuP/AzE1e5ONHe7vAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTEyLTIzVDIwOjA0OjMxKzAwOjAwHarZDQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0xMi0yM1QyMDowNDozMSswMDowMGz3YbEAAABNdEVYdHNvZnR3YXJlAEltYWdlTWFnaWNrIDYuOS4yLTcgUTE2IHg4Nl82NCAyMDE1LTEyLTAyIGh0dHA6Ly93d3cuaW1hZ2VtYWdpY2sub3Jnbo4WPwAAAEp0RVh0c3ZnOmJhc2UtdXJpAGZpbGU6Ly8vdG1wL3ZpZ25ldHRlL2MxZDQ0ZGY2LWM1ZDYtNDkwMC04ZDBhLWQ0OWVmMzBiZGE3MS5zdmd90CehAAAAGHRFWHRUaHVtYjo6RG9jdW1lbnQ6OlBhZ2VzADGn/7svAAAAGHRFWHRUaHVtYjo6SW1hZ2U6OkhlaWdodAAyNjLFg9PDAAAAF3RFWHRUaHVtYjo6SW1hZ2U6OldpZHRoADU3Mz0hlMwAAAAZdEVYdFRodW1iOjpNaW1ldHlwZQBpbWFnZS9zdme/73BOAAAAF3RFWHRUaHVtYjo6TVRpbWUAMTQ1MDkwMTA3McPsyX0AAAAPdEVYdFRodW1iOjpTaXplADBCQpSiPuwAAABIdEVYdFRodW1iOjpVUkkAZmlsZTovLy90bXAvdmlnbmV0dGUvYzFkNDRkZjYtYzVkNi00OTAwLThkMGEtZDQ5ZWYzMGJkYTcxLnN2Z4N+SbEAAAAASUVORK5CYII=' style='display: block; margin-left: auto; margin-right: auto; margin-top: 7px; width: 70%; height: 70%;'/></span>");
+                    $('.logo-content' ).remove();
+                    $('.charts div:nth-child(2)').remove();  
+                });
+            ]]>
+        </scripts>
+        
+        <!-- custom styles -->
+        <styles>
+            <![CDATA[
+                .report-name {padding-top: 1px; font-size: 15px; font-weight: bold;}
+            ]]>
+        </styles>
+    </configuration>
+</extentreports>
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j.properties b/test-apis-ci/src/main/resources/ci/conf/log4j.properties
new file mode 100644
index 0000000..d313e92
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/log4j.properties
@@ -0,0 +1,34 @@
+# Define the root logger with appender file
+log4j.rootLogger = INFO, FILE, stdout
+
+# Define the file appender
+log4j.appender.FILE=org.apache.log4j.RollingFileAppender
+log4j.appender.FILE.File=${targetlog}logs/ci-log.out
+
+# Define the layout for file appender
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+
+# Set the maximum file size before rollover
+log4j.appender.FILE.maxFileSize=5MB
+
+# Set the the backup index
+log4j.appender.FILE.maxBackupIndex=10
+
+
+#############################################################
+
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+
+log4j.logger.org.apache.cassandra.service.StorageProxy=INFO
+log4j.logger.com.thinkaurelius.titan.diskstorage.cassandra.CassandraTransaction=INFO, FILE, stdout
+
+log4j.logger.org.openecomp.sdc.ci.tests.utils=INFO, FILE, stdout
+log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
+
+
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j.xml b/test-apis-ci/src/main/resources/ci/conf/log4j.xml
new file mode 100644
index 0000000..6db233a
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/log4j.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+	debug="false">
+
+	<appender name="fileAppender" class="org.apache.log4j.FileAppender">
+
+		<param name="Threshold" value="INFO" />
+
+		<param name="File" value="logfile.log" />
+
+		<layout class="org.apache.log4j.PatternLayout">
+
+			<param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
+
+		</layout>
+
+	</appender>
+
+	<root>
+
+		<level value="INFO" />
+
+		<appender-ref ref="fileAppender" />
+
+	</root>
+	
+	
+
+</log4j:configuration>
diff --git a/test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml b/test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml
new file mode 100644
index 0000000..aa390dc
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="lifeCycle" parallel="none">
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_cerificationCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceResourceLCSTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_UndoCheckOutCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_UndoCheckOutCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_StartCertificationCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_CheckinCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_CheckOutCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceCertWithResourceInstances"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CrossCheckOutTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CertifyVFWithNotCertRIs"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_request4CerCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CleanupIntermediateReources"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_CheckOutCIT"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_cerificationCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CertifyServiceWithNotCertRI"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_CheckInCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_request4CerCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_StartCertificationCITest"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- lifeCycle -->
diff --git a/test-apis-ci/src/main/resources/ci/conf/titan.properties b/test-apis-ci/src/main/resources/ci/conf/titan.properties
new file mode 100644
index 0000000..42e1998
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/titan.properties
@@ -0,0 +1,8 @@
+storage.backend=cassandra
+#storage.hostname=cassandrahost
+storage.hostname=localhost
+storage.port=9160
+
+cache.db-cache = false
+
+
diff --git a/test-apis-ci/src/main/resources/ci/conf/truststore b/test-apis-ci/src/main/resources/ci/conf/truststore
new file mode 100644
index 0000000..bdec93d
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/conf/truststore
Binary files differ
diff --git a/test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh b/test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
new file mode 100644
index 0000000..0d494d9
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+function help_usage ()
+{
+	echo "$0 -ip <ip> -f <userToAdd_file>"
+	echo "for example: -ip 127.0.0.1 -f /var/tmp/userToAdd.txt"
+	exit
+}
+
+function check_file_existance ()
+{
+echo "check_file_existance $1"
+if [ $1 == "" ]; then
+        echo "Please provide full path to user file"
+        exit;
+elif [ -f $1 ]; then
+        source $1
+	USERS=("${USER_LIST[@]}")
+        echo "file exist" $1
+else
+        echo "Provided user file does not exist"
+        exit
+fi
+}
+
+function check_ip_existance ()
+{
+if [ $1 == "" ]; then
+        echo "Please provide ip address"
+        exit;
+fi
+}
+
+function addUser ()
+{
+	#for user in "${USER_LIST[@]}"; do
+	for user in "${USERS[@]}"; do
+		PING=`ping -c 1 $IP  > /var/tmp/ping.log`
+		pattern1='100% packet loss'
+		pattern2='Host Unreachable'
+		COUNT=`egrep -c "$pattern1|$pattern2" /var/tmp/ping.log`
+		if [ $COUNT -eq 0 ]; then
+		#	curl -i -X post -d '{ "userId" : "kk1123", "role" : "ADMIN" }'  -H "Content-Type: application/json" -H "USER_ID: jh0003" http://192.168.111.9:8080/sdc2/rest/v1/user
+			userId=`echo $user|awk '{print $1}'`
+			role=`echo $user|awk '{print $2}'`
+			curl -i -X post -d '{ "userId" : "'${userId}'", "role" : "'${role}'" }'  -H "Content-Type: application/json" -H "USER_ID: jh0003" http://${IP}:8080/sdc2/rest/v1/user
+		else
+			echo "Host" $IP "Is Unreachable"
+		fi
+	done
+}
+
+#main
+[ $# -eq 0 ] && help_usage
+while [ $# -ne 0 ]; do
+	case $1 in
+		"-f")
+			USER_FILE=$2
+			shift 1
+			shift 1
+		;;	
+		-ip)
+			IP=$2
+			shift 1
+			shift 1
+		;;
+		*)
+#			help_usage
+		;;
+	esac
+done
+
+check_file_existance $USER_FILE
+check_ip_existance $IP
+addUser
diff --git a/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh b/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
new file mode 100644
index 0000000..30094fe
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+REPORT_NAME=$1
+VERSION=$2
+ENV=$3
+IP=$4
+
+if [ -z "$REPORT_NAME" ]
+ then
+        source ExtentReport/versions.info
+        now=$(date -d '+7 hour' "+%Y-%m-%d_%H_%M")
+        REPORT_NAME="${now}"
+        VERSION="${osVersion}"
+                if [[ $env == *"DEV20"* ]]
+                        then
+                                ENV="Nightly"
+                        else
+                                ENV=""
+                        fi
+
+ fi
+
+/usr/bin/expect  << EOF
+spawn ssh admin@${IP} mkdir -p -m 775 /home/admin/reports/${ENV}/${VERSION}/APIs/
+
+expect {
+  -re ".*es.*o.*" {
+    exp_send "yes\r"
+    exp_continue
+  }
+  -re ".*sword.*" {
+    exp_send "Aa123456\r"
+  }
+}
+
+expect eof
+
+spawn scp -r ExtentReport admin@${IP}:/home/admin/reports/${ENV}/${VERSION}/APIs/${REPORT_NAME}/
+
+expect {
+  -re ".*es.*o.*" {
+    exp_send "yes\r"
+    exp_continue
+  }
+  -re ".*sword.*" {
+    exp_send "Aa123456\r"
+  }
+}
+
+expect eof
+
+spawn ssh admin@${IP} chmod -R 775 /home/admin/reports/${ENV}/${VERSION}/APIs/${REPORT_NAME}/
+
+expect {
+  -re ".*es.*o.*" {
+    exp_send "yes\r"
+    exp_continue
+  }
+  -re ".*sword.*" {
+    exp_send "Aa123456\r"
+  }
+}
+
+expect eof
+
+EOF
diff --git a/test-apis-ci/src/main/resources/ci/scripts/sendMail.sh b/test-apis-ci/src/main/resources/ci/scripts/sendMail.sh
new file mode 100644
index 0000000..4c23a79
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/scripts/sendMail.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+now=$(date +'%Y%-m%d%H%M')
+
+REPORT_NAME=$1
+VERSION=$2
+ENV=$3
+
+RECIPIENTS1="dl-sdcqa@intl.att.com,ml636r@intl.att.com,bl5783intl.att.com,ak314p@intl.att.com,el489u@intl.att.com,hk096q@intl.att.com,bs5719@intl.att.com"
+RECIPIENTS2="dl-asdcqa@intl.att.com"
+
+source ExtentReport/versions.info
+if [ -z "$REPORT_NAME" ]
+ then
+        now=$(date -d '+7 hour' "+%Y-%m-%d_%H_%M")
+        REPORT_NAME="${now}"
+        VERSION="${osVersion}"
+fi
+
+if [[ $env == *"DEV20"* ]]
+    then
+       ENV="Nightly"
+       RECIPIENTS=$RECIPIENTS1
+    else
+       ENV=""
+       RECIPIENTS=$RECIPIENTS2
+fi
+
+
+#REPORT_ZIP_FILE=ExtentReport_${now}.zip
+REPORT_FOLDER='ExtentReport'
+REPORT_HTML_FILE=${REPORT_FOLDER}/*Report.html
+BODY_MESSAGE='Hello, \n\n Please find automation results on following link: \n\n http://asdc-srv-210-45.tlv.intl.att.com/'${ENV}'/'${VERSION}'/APIs/'${REPORT_NAME}'/SDC_CI_Extent_Report.html \n\nThanks, \nSDC QA Team\n\n '
+
+#OLD_FILE=$(find ./ -type f -name ${REPORT_ZIP_FILE} -print)
+#if [ ! -z ${OLD_FILE} ]
+#then
+#        rm -f ${REPORT_ZIP_FILE}
+#        echo "Removing old zip file............"
+#fi
+
+#echo "Creating new zip file"
+#zip -r ${REPORT_ZIP_FILE} ./${REPORT_FOLDER}
+
+
+echo -e ${BODY_MESSAGE} | mail -s 'External APIs Automation '$ENV' results - ASDC '$VERSION -r 'ASDC@Automation.team' $RECIPIENTS
diff --git a/test-apis-ci/src/main/resources/ci/scripts/startTest.sh b/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
new file mode 100644
index 0000000..d3c1502
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
@@ -0,0 +1,153 @@
+#!/bin/bash
+REMOTE_DEBUG=false
+RERUN=false
+JAVA_OPTION=""
+debug_port=8000
+TEST_SUITES=testSuites
+fileName=testng-failed.xml
+
+function help_usage ()
+{
+	echo
+	echo "$0 (<jar_file_name> <suite file name>) [-r/rerun <true/false> -d/debug <true/false>]"
+	echo "nohup ./startTest.sh ui-ci-1707.0.5-SNAPSHOT-jar-with-dependencies.jar extendedSanity.xml -r false -d true &"
+	echo "by default rerun is true and remote debug is false."
+	echo
+	exit 2
+}
+
+function isBoolean ()
+{
+	PARAM_NAME=$1
+	VALUE=$2
+	if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
+		echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
+	        help_usage
+	fi	
+}
+
+function prepareFailedXmlFile ()
+{	
+	echo "1="$1 "2="$2 "fileName="${fileName}
+	PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
+	sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
+    sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
+}
+
+#main
+[ $# -lt 2 ] && help_usage
+
+JAR_FILE=$1
+SUITE_FILE=$2
+
+while [ $# -ne 0 ]; do
+	case $1 in
+		-r|rerun)
+			RERUN=$2
+            		isBoolean $1 ${RERUN}
+			shift 1
+			shift 1
+		;;
+		-d|debug)
+			REMOTE_DEBUG=$2
+           		isBoolean $1 ${REMOTE_DEBUG}
+			shift 1
+			shift 1
+		;;		
+		*)
+			shift 1
+		;;
+	esac
+done
+
+CURRENT_DIR=`pwd`
+BASEDIR=$(dirname $0)
+
+if [ ${BASEDIR:0:1} = "/" ]
+then
+        FULL_PATH=$BASEDIR
+else
+        FULL_PATH=$CURRENT_DIR/$BASEDIR
+fi
+LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
+#############################################
+TARGET_DIR=${FULL_PATH}/target
+CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
+
+DEBUG=true
+MainClass=org.openecomp.sdc.ci.tests.run.StartTest
+
+TESTS_DIR=/opt/app/sdc/ci/resources/tests
+COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
+
+
+TARGET_LOG_DIR="${TARGET_DIR}/"
+
+######ADD USERS################
+
+BE_IP=`cat conf/attsdc.yaml | grep catalogBeHost| awk '{print $2}'`
+
+ADD_USERS_SCRIPT="addUsersFromList_new.sh"
+USER_LIST="userList.txt"
+chmod +x ${ADD_USERS_SCRIPT}
+echo "add users..."
+`./${ADD_USERS_SCRIPT} -ip ${BE_IP} -f ${USER_LIST}`
+
+
+
+if [ ${REMOTE_DEBUG} == "true" ]; then
+    echo "Debug mode, Listen on port $debug_port";
+    JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;
+fi  
+
+cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &" 
+
+
+if [ $DEBUG == "true" ]
+then
+	$cmd
+else
+	$cmd >> /dev/null
+fi
+
+if [ ${RERUN} == "true" ]; then
+    if [ -f ${TARGET_DIR}/${fileName} ]; then
+        echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
+        prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
+        SUITE_FILE=${fileName};
+	cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
+        $cmd;
+    fi
+fi
+
+status=`echo $?`
+
+source ExtentReport/versions.info
+now=$(date +'%Y-%m-%d_%H_%M')
+REPORT_NAME=${now}
+VERSION=${osVersion}
+
+if [[ $env == *"DEV20"* ]]
+then
+        MYENV="Nightly"
+else
+	MYENV=""
+fi
+
+COPY_REPORT_SCRIPT="copyToStorage.sh"
+chmod +x ${COPY_REPORT_SCRIPT}
+echo "copy report to storage..."
+sh ./${COPY_REPORT_SCRIPT} ${REPORT_NAME} ${VERSION} ${MYENV}
+
+
+MAILING_SCRIPT_NAME="sendMail.sh"
+chmod +x ${MAILING_SCRIPT_NAME}
+echo "Sending report via mail..."
+`./${MAILING_SCRIPT_NAME} ${REPORT_NAME} ${VERSION} ${MYENV}`
+
+
+echo "##################################################"
+echo "################# status is ${status} #################" 
+echo "##################################################"
+
+exit $status
diff --git a/test-apis-ci/src/main/resources/ci/scripts/userList.txt b/test-apis-ci/src/main/resources/ci/scripts/userList.txt
new file mode 100644
index 0000000..a132659
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/scripts/userList.txt
@@ -0,0 +1 @@
+export USER_LIST=( "m99121 DESIGNER" "cs0008 DESIGNER" "kb0004 TESTER" "af0006 OPS" "ah0002 GOVERNOR" "m08740 DESIGNER" "m99124 TESTER" "m08743 TESTER" "m99123 OPS" "m08742 OPS" "m99125 GOVERNOR" "m08744 GOVERNOR" "m99122 ADMIN" "m08741 ADMIN" "m99126 PRODUCT_STRATEGIST" "m08745 PRODUCT_STRATEGIST" "m99127 PRODUCT_MANAGER" "m08746 PRODUCT_MANAGER" "md9897 DESIGNER" "m08748 DESIGNER" "m08749 TESTER" "be0695 DESIGNER" "er434w DESIGNER" "ya107f DESIGNER" "ds200p DESIGNER" "ak0333 ADMIN" "th0695 DESIGNER" "al714h DESIGNER" "ys9693 DESIGNER" "ss8214 DESIGNER" "bt750h DESIGNER" "rp955r DESIGNER" "ez6451 DESIGNER" "ia901h DESIGNER" "ah7840 DESIGNER" "ea394r DESIGNER" "ms656r DESIGNER" "ml636r DESIGNER" "it1721 DESIGNER" "sg473v DESIGNER" "sa997j DESIGNER" "az2497 DESIGNER" "ys189e DESIGNER" "ig642y DESIGNER" )
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml b/test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml
new file mode 100644
index 0000000..e53da8d
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2"  parallel="tests" thread-count="10">
+
+  <test name="Test">
+    <classes>
+      <class 
+      name="org.openecomp.sdc.ci.tests.execute.devCI.CRUDExternalAPI">
+   			   <methods>
+					<include name="uploadArtifactOnVFViaExternalAPI" />
+					<include name="uploadArtifactOnServiceViaExternalAPI" />
+					<include name="uploadArtifactOnRIViaExternalAPI" />
+					<include name="uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI" />
+					<include name="uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset" />
+					<include name="uploadArtifactOnAssetWhichNotExist" />
+					<include name="uploadArtifactOnAssetWhichInInvalidStateForUploading" />
+					
+					
+					<include name="updateArtifactForServiceViaExternalAPI" />
+					<include name="updateArtifactForVFViaExternalAPI" />
+					<include name="updateArtifactOnRIViaExternalAPI" />
+					<include name="updateArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset" />
+					<include name="updateArtifactOnAssetWhichNotExist" />
+					<include name="updateArtifactOnAssetWhichInInvalidStateForUploading" />
+					<include name="updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI" />
+					
+					
+					<include name="deleteArtifactForServiceViaExternalAPI" />
+					<include name="deleteArtifactForVFViaExternalAPI" />
+					<include name="deleteArtifactOnRIViaExternalAPI" />
+					<include name="deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset" />
+					<include name="deleteArtifactOnAssetWhichNotExist" />
+					<include name="deleteArtifactOnAssetWhichInInvalidStateForUploading" />
+				</methods>
+      
+      </class>
+      
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- Suite -->
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml b/test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml
new file mode 100644
index 0000000..40c462a
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2"  parallel="tests" thread-count="10">
+
+  <test name="Test">
+    <classes>
+      <class 
+      name="org.openecomp.sdc.ci.tests.execute.devCI.SearchFilterCategoryExternalAPI">
+   			   <methods>
+
+					<include name="searchWithInvalidFilter" />
+					<include name="searchForResourceTypeNegativeTest" />
+					<include name="searchingForResouceFilterIncorrectResouceTypeUsingExternalAPI" />
+					<include name="searchingForSeveralResouceTypesUsingExternalAPI" />
+					<include name="searchingForSeveralResourcesOfTypeVFCMTUsingExternalAPI" />
+					<include name="normativeResourceCategory" />		
+				</methods>
+      
+      </class>
+      
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- Suite -->
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml b/test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml
new file mode 100644
index 0000000..24229b8
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Artifacts" >
+	<test name="Artifacts">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.DownloadComponentArt" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ArtifactServletTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ValidateHeatArtFieldsTypes" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.PlaceHolderValidations" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ValidateArtResponse" />
+			<class name="org.openecomp.sdc.ci.tests.execute.artifacts.CrudArt" />
+		</classes>
+	</test>
+</suite> <!-- Artifacts -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/category.xml b/test-apis-ci/src/main/resources/ci/testSuites/category.xml
new file mode 100644
index 0000000..f2a0b37
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/category.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="category" >
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.category.CategoriesTests"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.category.GroupingTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.category.SubCategoriesTest"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- category -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml b/test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml
new file mode 100644
index 0000000..26a85fd
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="ciFull" configfailurepolicy="continue" verbose="2">
+	<test name="Category">
+		<classes>
+			<class name="org.openecomp.sdc.ci.tests.execute.category.ElementsApiTest" />
+			<class name="org.openecomp.sdc.ci.tests.execute.category.CategoriesTests">
+				<methods>
+					<exclude name="importCategories" />
+					<exclude name="getServiceCategoryHierarchySuccessFlow" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.category.CatalogDataApiTest" />
+			<class name="org.openecomp.sdc.ci.tests.execute.category.GroupingTest" >
+				<methods>
+					<exclude name="createProductGroupForNonExistingCategory" />
+					<exclude name="createProductGroupForNonExistingSunCategory" />
+					<exclude name="getProductCategoryHierarchySuccessFlow" />
+				</methods>
+			</class>
+			
+			<class name="org.openecomp.sdc.ci.tests.execute.category.SubCategoriesTest">
+				<methods>
+					<exclude name="createProductSubCategoryForNonExistingCategory" />
+					<exclude name="createResourceSubCategoryForNonExistingCategory" />
+					<exclude name="getResourceCategoryHierarchySuccessFlow" />
+				</methods>
+			</class>
+		</classes>
+	</test> <!-- Test -->
+	<test name="Distribution">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.distribution.AuthanticationTests" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.distribution.DistributionDownloadArtifactTest">
+				<methods>
+					<exclude name="downloadServiceArtifact_ServiceVersionNotFound" />
+				</methods>
+			</class>
+		</classes>
+	</test> <!-- Test -->
+	<test name="General">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.general.ManageEcompConsumerCredentials">
+				<methods>
+					<exclude name="createEcompCredentialsByNoExistingIUser" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.general.FeProxyTest" />
+			<class name="org.openecomp.sdc.ci.tests.execute.general.UuidTest" />
+		</classes>
+	</test>
+	<test name="Resource">
+		<classes>
+			<!-- <class
+				name="org.openecomp.sdc.ci.tests.execute.resource.SimultaneousApiTest" /> -->
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.ComponentRelationshipInVfTest">
+				<methods>
+					<exclude name="associateOneOfTwoCPsToVl_ThenDiscocciate" />
+					<exclude name="disassociateRelationInVfNotFound" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.UpdateResourceMetadataTest">
+				<methods>
+					<exclude name="UpdateResourceCategory_negativeFlow" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.VFResourceInstanceNameCRUD"/>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.VfComponentInstanceCRUDTest">
+				<methods>
+					<exclude name="createAllAtomicInstancesTestGetReqCapAPI_suc" />
+					<exclude name="createVfcInstance_UserIdIsEmpty" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceApiTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.ValidateExtendedVfData" />
+		</classes>
+	</test>
+	<test name="Product">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductUndoCheckoutTest">
+				<methods>
+					<exclude name="undoCheckOutNotExist" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest">
+				<methods>
+					<exclude name="createServiceInstanceNameIsNull" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ChangeServiceInstanceVersionTest">
+				<methods>
+					<exclude name="changeServiceInstanceVersionToNonExisitingServiceVersion" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductGetFollowedTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductToscaYamlGenerationTest" />
+			<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckinTest">
+				<methods>
+					<exclude name="checkInProductNotExist" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckoutTest" />
+			<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest">
+				<methods>
+					<exclude name="updateProductDescriptionRemoveSpacesFromBeginning" />
+					<exclude name="updateProductDescriptionRemoveSpacesFromTheEnd" />
+					<exclude name="updateProductDescriptionValidCharacters02" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductCreateWithValidationsTest">
+				<methods>
+					<exclude name="createProductDescriptionRemoveSpacesFromBeginning" />
+					<exclude name="createProductDescriptionRemoveSpacesFromTheEnd" />
+					<exclude name="createProductDescriptionValidCharacters01" />
+					<exclude name="createProductDescriptionValidCharacters02" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+	<test name="Service">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.GetServiceLatestVersionTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.CreateServiceMetadataApiTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.ReqCapOccurrencesTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.ChangeServiceDistributionStatusApiTest">
+				<methods>
+					<exclude name="approveCertifiedService_byDesigner" />
+					<exclude name="approveCertifiedService_byOps" />
+					<exclude name="approveCertifiedService_byTester" />
+					<exclude
+						name="distributionStatusChange_approve_Reject_AprroveBysdncAdminDetails" />
+					<exclude name="rejectCertifiedService_byDesigner" />
+					<exclude name="rejectCertifiedService_byOps" />
+					<exclude name="rejectCertifiedService_byTester" />
+					<exclude name="rejectCertifiedService_bysdncAdminDetails" />
+					<exclude name="rejectCertifiedService_bysdncGovernorDeatails" />
+					<exclude name="rejectNotCertifiedService_checkedin" />
+					<exclude name="rejectNotCertifiedService_checkeout" />
+					<exclude name="rejectNotCertifiedService_inProgress" />
+					<exclude name="rejectNotCertifiedService_readyForCer" />
+					<exclude name="rejectServiceNotFound" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.ServiceComponentInstanceCRUDTest">
+				<methods>
+					<exclude name="associateAfterCheckoutAllInstancesTest" />
+					<exclude name="associateAfterDeletingResourceTest" />
+					<exclude name="associateDissociateTwoVFs" />
+					<exclude name="associateInstancesInTwoServiceVersionsTest" />
+					<exclude name="associateNotCompitableReqCapTest" />
+					<exclude name="associateOnceAgainExistingRelationTest" />
+					<exclude name="associateResourceInstanceToResourceInstanceNotFoundTest" />
+					<exclude
+						name="associateTwoRelations_CheckinCheckout_DissoicateOneRelationInSecondVersion" />
+					<exclude name="createResourceInstanceWithEmptyUserIdTest" />
+					<exclude name="deleteNotFoundResourceInstanceTest" />
+					<exclude name="deleteResourceInstanceWithEmptyUserIdTest" />
+					<exclude name="dissociateOnceAgainTest" />
+					<exclude name="dissociateRelationNotFoundTest" />
+					<exclude name="dissoicateRelationWhileInstanceNotFound" />
+					<exclude name="dissoicateWithEmptyUserIdHeaderTest" />
+					<exclude name="relationDeletedAfterDeletingResourceInstanceTest" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.UpdateServiceMetadataTest">
+				<methods>
+					<exclude name="categoryValidationTest6" />
+					<exclude name="categoryValidationTest7" />
+					<exclude name="descriptionValidationTest11" />
+					<exclude name="descriptionValidationTest12" />
+					<exclude name="descriptionValidationTest13" />
+					<exclude name="descriptionValidationTest7" />
+					<exclude name="serviceNameValidationTest17" />
+					<exclude name="updateCertifiedService" />
+					<exclude name="updateCheckoutCertifiedService" />
+					<exclude name="updateServiceByMethod_delete" />
+					<exclude name="updateServiceByMethod_get" />
+					<exclude name="updateServiceByMethod_post" />
+					<exclude name="updateServiceNotExist" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.GetAllServiceVersions" />
+		</classes>
+	</test>
+	<test name="Artifacts">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.DownloadComponentArt" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ArtifactServletTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ValidateHeatArtFieldsTypes" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.PlaceHolderValidations" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ValidateArtResponse" />
+			<class name="org.openecomp.sdc.ci.tests.execute.artifacts.CrudArt" />
+		</classes>
+	</test>
+</suite> 
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml b/test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml
new file mode 100644
index 0000000..3505dad
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="externalApis" configfailurepolicy="continue" verbose="2" >
+	<test name="ExternalApis">
+		<classes>	
+			
+			<class name="org.openecomp.sdc.externalApis.VFCMTExternalAPI"/>
+			<class name="org.openecomp.sdc.externalApis.CRUDExternalAPI"/> 
+			<class name="org.openecomp.sdc.externalApis.DeploymentValiditaion"/>  
+ 			<class name="org.openecomp.sdc.externalApis.GetAssetServlet"/>
+			<class name="org.openecomp.sdc.externalApis.GetCSARofVF"/>
+			<class name="org.openecomp.sdc.externalApis.GetFilteredAssetServlet"/>
+			<class name="org.openecomp.sdc.externalApis.GetSpecificAssetMetadataServlet"/>
+			<class name="org.openecomp.sdc.externalApis.SearchFilterCategoryExternalAPI"/>
+			<class name="org.openecomp.sdc.externalApis.AssetLifeCycle"/>
+			<class name="org.openecomp.sdc.externalApis.UserAPIs"/>  
+
+			
+<!-- 	      <class name="org.openecomp.sdc.ci.tests.execute.product.ChangeServiceInstanceVersionTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckinTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckoutTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCreateWithValidationsTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductGetFollowedTest"/>
+			      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductUndoCheckoutTest"/>    -->
+			
+			
+		</classes>
+	</test>
+</suite> 
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/general.xml b/test-apis-ci/src/main/resources/ci/testSuites/general.xml
new file mode 100644
index 0000000..bd7e6b6
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/general.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="General" >
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.general.SampleTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.general.ManageEcompConsumerCredentials"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.general.UuidTest"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- General -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/imports.xml b/test-apis-ci/src/main/resources/ci/testSuites/imports.xml
new file mode 100644
index 0000000..ae4a5bc
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/imports.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Imports" >
+  <test name="Imports">
+    <classes>
+       <class name="org.openecomp.sdc.ci.tests.execute.imports.ImportGenericResourceCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.imports.ImportCsarResourceTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.imports.ImportNewResourceCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.imports.ImportToscaResourceTest"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- Imports -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/product.xml b/test-apis-ci/src/main/resources/ci/testSuites/product.xml
new file mode 100644
index 0000000..4ea495d
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/product.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Product" >
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductLifecycleTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductUndoCheckoutTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckinTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckoutTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest"/>      
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- Product -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml b/test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml
new file mode 100644
index 0000000..61950e9
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="productAPIs" configfailurepolicy="continue" verbose="2"  parallel="tests" thread-count="6">
+
+  <test name="Test">
+    <classes>
+    
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ChangeServiceInstanceVersionTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckinTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckoutTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCreateWithValidationsTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductGetFollowedTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.product.ProductUndoCheckoutTest"/>
+      
+      
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- Suite -->
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/property.xml b/test-apis-ci/src/main/resources/ci/testSuites/property.xml
new file mode 100644
index 0000000..f94f897
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/property.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Property" >
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.property.PropertyApisTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.property.PropertyServletTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.property.AdditionalInformationServletTest"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- Property -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/resource.xml b/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
new file mode 100644
index 0000000..803fb01
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
@@ -0,0 +1,360 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Sanity" configfailurepolicy="continue" >
+	
+	<!--
+	     	<listeners>
+        <listener class-name="org.openecomp.sdc.ci.tests.config.InvokedMethodListener" />
+    </listeners>
+	-->
+
+
+  <test verbose="2" name="Sanity">
+    <classes>
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.ArtifactServletTest">
+			  <methods>
+				<include name="upadteArtifactWithPayLoadToResourcseTest"/>
+				<include name="createAndUpdateArtifactToInterface"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.CrudArt">
+			  <methods>
+				<include name="addHeatArtifactToResourceAndCertify"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.LCS_Artifacts">
+			  <methods>
+				<include name="LCS_inherit_artifact"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.InformationalArt">
+			  <methods>
+				<include name="UpdateAllResourceMandatoryArtifacts"/>
+				<include name="updateInformationalArtifactMetadataOfResource"/>
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.InformationalArtCloudQuestionnaire">
+			  <methods>
+				<include name="updateMandatoryInformationalArtifact_CloudQuestionnaire"/>
+			  </methods>
+		</class>  
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.ServiceApiArtifactTest">
+			  <methods>
+				<include name="uploadServiceApiArtifactSuccessfullyTest"/>
+				<include name="updateApiArtifactSuccessfullyTest"/>
+				<include name="deleteApiArtifactSuccessfully"/>
+			  </methods>
+		</class>  
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.ServiceInformationalArtifact">
+			  <methods>
+				<include name="updateMandatoryInformationalArtifact_ServiceQuestionnaire"/>
+			  </methods>
+		</class> 
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.artifacts.ValidateArtResponse"/>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.category.CatalogDataApiTest"/>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.category.ElementsApiTest">
+			  <methods>
+				<include name="getAllArtifactTypes"/>
+				<include name="getConfiguration"/>
+				<include name="getAllPropertyScopesSuccess"/>
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.distribution.AuthanticationTests">
+			  <methods>
+				<include name="downloadServiceArtifactSuccessWithAutantication"/>
+			  </methods>
+		</class>
+
+		<class name="org.openecomp.sdc.ci.tests.execute.distribution.DistributionDownloadArtifactTest">
+			  <methods>
+				<include name="downloadResourceArtifactSuccess"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.general.BasicHttpAuthenticationTest">
+			  <methods>
+				<include name="sendAuthenticatedRequestTest_success"/>
+			  </methods>
+		</class>	
+		
+	
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.general.FeProxyTest"/>
+		<class name="org.openecomp.sdc.ci.tests.execute.general.ManageEcompConsumerCredentials">
+			  <methods>
+				<include name="deleteEcompCredentialsMethodDelete"/>
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.general.UuidTest">
+			  <methods>
+				<include name="testE2EUuidHeaderReturnedAndPreserved"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.imports.ImportGenericResourceCITest">
+			  <methods>
+				<include name="importAllTestResources"/>
+				<include name="testImportCheckoutAndUpdateUserResource"/>
+				<include name="testImportWithUpdateNormativeType"/>
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.imports.ImportNewResourceCITest">
+			  <methods>
+				<include name="importAllTestResources_toValidateNewAPI"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.imports.ImportToscaResourceTest">
+			  <methods>
+				<include name="importToscaResource"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CleanupIntermediateReources">
+			  <methods>
+				<include name="test28"/>
+				<include name="test29"/>
+				<include name="test30"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CleanupIntermediateServicesTest">
+			  <methods>
+				<include name="testCleanupIntermediateServices"/>
+			  </methods>
+		</class>
+		
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ResourceLCS_cerificationCITest">
+			  <methods>
+				<include name="verifyAllPrevVerDeleted"/>
+				<include name="verifyStartWithDesignerCertByAdmin"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ResourceLCS_CheckInCITest">
+			  <methods>
+				<include name="checkInTest_suc"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ResourceLCS_CheckOutCITest">
+			  <methods>
+				<include name="checkOutTest_currState_READY_FOR_CERTIFICATION_ownerDSIGNER_performByADMIN_suc"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ResourceLCS_request4CerCITest">
+			  <methods>
+				<include name="req4cer_fromCheckOut_designer_admin"/>
+			  </methods>
+		</class>
+
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ResourceLCS_StartCertificationCITest">
+			  <methods>
+				<include name="startCer_suc"/>
+			  </methods>
+		</class>
+
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ResourceLCS_UndoCheckOutCITest">
+			  <methods>
+				<include name="undoCheckOutTest_import_outAdmin_undoOut_designer"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceCertWithMandatoryArt">
+			  <methods>
+				<include name="CertServiceWithHeatDeployArtOnResource"/>
+			  </methods>
+		</class>
+
+		<class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceCertWithResourceInstances">
+			  <methods>
+				<include name="certServiceWithCertResource"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.property.AdditionalInformationServletTest">
+			  <methods>
+				<include name="createResourceAdditionalInformationTestDuringLifecycle"/>
+				<include name="updateResourceAdditionalInformationTest"/>
+				<include name="deleteResourceAdditionalInformationTest"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.property.PropertyApisTest">
+			  <methods>
+				<include name="testPropertyApis"/>
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.property.PropertyServletTest">
+			  <methods>
+				<include name="createCascadeVfResource"/>
+				<include name="createPropertyTestSetClearDefaultValueInetegr"/>				
+			  </methods>
+		</class>
+		
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.GetAllLatestVersionNonAbstarctResources">
+			  <methods>
+				<include name="resourceCertifiedTwiceCoutCinCout"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.GetAllResourceVersions">
+			  <methods>
+				<include name="getResourceAllVersions_version15"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.GetFollwedElementsTest">
+			  <methods>
+				<include name="getResourcesListBolongsToSpecificDesigner"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.GetResourceAbstractApiTest">
+			  <methods>
+				<include name="getAbstractResourceList"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.GetResourceNotAbstractApiTest">
+			  <methods>
+				<include name="getNotAbstractResourceList"/>						
+			  </methods>
+		</class>
+
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.GetResourceTagsApiTest">
+			  <methods>
+				<include name="getModifiedResourceTagsList"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceApiTest">
+			  <methods>
+				<include name="updateResourceMetadataSuccess"/>						
+			  </methods>
+		</class>
+	<!-- 
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceInstanceNameCRUD">
+			  <methods>
+				<include name="updateResourceInstanceNameAfterServiceCertification"/>						
+			  </methods>
+		</class>
+	-->
+<!-- 		<class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceInstanceServletTest">
+			  <methods>
+				<include name="updateRI_suc"/>						
+			  </methods>
+		</class> -->
+
+		<class name="org.openecomp.sdc.ci.tests.execute.resource.UpdateResourceMetadataTest">
+			  <methods>
+				<include name="UpdateDerivedFromSuccess"/>						
+			  </methods>
+		</class>
+		
+
+		<class name="org.openecomp.sdc.ci.tests.execute.service.GetComponentAuditApiTest">
+			  <methods>
+				<include name="testServiceAuditCertifiedVersion"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.service.ServiceApiTest">
+			  <methods>
+				<include name="createServiceTest"/>	
+				<include name="getFollowedServicesTester"/>						
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.service.ServiceInformationalArtifactApiTest">
+			  <methods>
+				<include name="addArtifactSuccessfuly"/>	
+				<include name="deleteArtifact"/>						
+				<include name="updateArtifactMetadataSuccessfully"/>	
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.service.UpdateServiceMetadataTest">
+			  <methods>
+				<include name="updateServiceSuccessfully"/>	
+			  </methods>
+		</class>
+
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.user.ActivateDeActivateDeleteUser">
+			  <methods>
+				<include name="authorizeDeActivatedUser"/>	
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.user.CreateUserApiTest">
+			  <methods>
+				<include name="createUser"/>	
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.user.GovernorWorkspaceApiTest">
+			  <methods>
+				<include name="governorList_AllCertifiedVersionsOfService"/>	
+			  </methods>
+		</class>
+		
+		<class name="org.openecomp.sdc.ci.tests.execute.user.OpsWorkspaceApiTest">
+			  <methods>
+				<include name="opsList_AllCertifiedVersionsOfServiceApproved"/>	
+			  </methods>
+		</class>
+		
+		<!-- Product tests start-->
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckinTest">
+			  <methods>
+				<include name="checkInProductByCreator"/>	
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ChangeServiceInstanceVersionTest">
+			  <methods>
+				<include name="changeServiceInstanceVersionByPm"/>	
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckoutTest">
+			  <methods>
+				<include name="checkOutProductByPmNotInContacts"/>	
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest">
+			  <methods>
+				<include name="createServiceInstanceTest"/>	
+				<include name="deleteServiceInstanceByPm"/>	
+				<include name="updateServiceInstanceNameByPm"/>	
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest">
+			  <methods>
+				<include name="createManyGroupingsDiffCategories"/>	
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ProductGetFollowedTest">
+			  <methods>
+				<include name="followedPageTest"/>	
+			  </methods>
+		</class>
+		<class name="org.openecomp.sdc.ci.tests.execute.product.ProductUndoCheckoutTest">
+			  <methods>
+				<include name="undoCheckOutProductByPm"/>	
+			  </methods>
+		</class>
+		<!-- Product tests end-->
+	 </classes>
+  </test> <!-- Test -->
+</suite> <!-- Sanity -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/sanity.xml b/test-apis-ci/src/main/resources/ci/testSuites/sanity.xml
new file mode 100644
index 0000000..f642170
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/sanity.xml
@@ -0,0 +1,394 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Sanity" configfailurepolicy="continue" verbose="2">
+
+	<test name="sanityE2Eflows">
+		<classes>
+			<class name="org.openecomp.sdc.ci.tests.sanity.CrudE2E" />
+		</classes>
+	</test>
+
+	<test name="General">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.general.BasicHttpAuthenticationTest">
+				<methods>
+					<include name="sendAuthenticatedRequestTest_success" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.general.FeProxyTest" />
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.general.ManageEcompConsumerCredentials">
+				<methods>
+					<include name="deleteEcompCredentialsMethodDelete" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.general.UuidTest">
+				<methods>
+					<include name="testE2EUuidHeaderReturnedAndPreserved" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+	
+	<test name="ArtifactOnInstance">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.CrudArt">
+				<methods>
+					<include name="addDcaeInventoryToscaArtifactToResourceInstanceAndCertify" />
+					<include name="addDcaeInventoryJsonArtifactToResourceInstanceAndCertify" />
+					<include name="addDcaeInventoryPolicyArtifactToResourceInstanceAndCertify" />
+					<include name="addDcaeInventoryDocArtifactToResourceInstanceAndCertify" />
+					<include name="addDcaeInventoryBluePrintArtifactToResourceInstanceAndCertify" />
+					<include name="addDcaeInventoryEventArtifactToResourceInstanceAndCertify" />
+					<include name="updateArtifactDescriptionToResourceInstance" />
+					<include name="deleteArtifactToResourceInstance" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+	<test name="Artifact">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.ArtifactServletTest">
+				<methods>
+					<include name="upadteArtifactWithPayLoadToResourcseTest" />
+					<include name="createAndUpdateArtifactToInterface" />
+				</methods>
+			</class>
+
+			<class name="org.openecomp.sdc.ci.tests.execute.artifacts.CrudArt">
+				<methods>
+					<include name="addHeatArtifactToResourceAndCertify" />
+				</methods>
+			</class>
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.artifacts.LCS_Artifacts"> 
+				<methods> <include name="LCS_inherit_artifact" /> </methods> </class> -->
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.artifacts.InformationalArt"> 
+				<methods> <include name="UpdateAllResourceMandatoryArtifacts" /> <include 
+				name="updateInformationalArtifactMetadataOfResource" /> </methods> </class> 
+				<class name="org.openecomp.sdc.ci.tests.execute.artifacts.InformationalArtCloudQuestionnaire"> 
+				<methods> <include name="updateMandatoryInformationalArtifact_CloudQuestionnaire" 
+				/> </methods> </class> -->
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.artifacts.ServiceApiArtifactTest"> 
+				<methods> <include name="uploadServiceApiArtifactSuccessfullyTest" /> <include 
+				name="updateApiArtifactSuccessfullyTest" /> <include name="deleteApiArtifactSuccessfully" 
+				/> </methods> </class> -->
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.artifacts.ServiceInformationalArtifact"> 
+				<methods> <include name="updateMandatoryInformationalArtifact_ServiceQuestionnaire" 
+				/> </methods> </class> -->
+
+			<class name="org.openecomp.sdc.ci.tests.execute.artifacts.ValidateArtResponse" />
+			
+			
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.artifacts.DownloadComponentArt">
+				<methods>
+					<include name="downloadArtifactFromResourceTest" />
+					<include name="downloadArtifactFromServiceTest" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+	<test name="Service">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.GetComponentAuditApiTest">
+				<methods>
+					<include name="testServiceAuditCertifiedVersion" />
+				</methods>
+			</class>
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.service.ServiceApiTest"> 
+				<methods> <include name="createServiceTest" /> <include name="getFollowedServicesTester" 
+				/> </methods> </class> -->
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.service.ServiceInformationalArtifactApiTest"> 
+				<methods> <include name="addArtifactSuccessfuly" /> <include name="deleteArtifact" 
+				/> <include name="updateArtifactMetadataSuccessfully" /> </methods> </class> -->
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.service.UpdateServiceMetadataTest">
+				<methods>
+					<include name="updateServiceSuccessfully" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+	<test name="Resource">
+		<classes>
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.resource.GetAllLatestVersionNonAbstarctResources"> 
+				<methods> <include name="resourceCertifiedTwiceCoutCinCout" /> </methods> 
+				</class> -->
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.GetAllResourceVersions">
+				<methods>
+					<include name="getResourceAllVersions_version15" />
+				</methods>
+			</class>
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.resource.GetFollwedElementsTest"> 
+				<methods> <include name="getResourcesListBolongsToSpecificDesigner" /> </methods> 
+				</class> -->
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.resource.GetResourceAbstractApiTest"> 
+				<methods> <include name="getAbstractResourceList" /> </methods> </class> -->
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.GetResourceNotAbstractApiTest">
+				<methods>
+					<include name="getNotAbstractResourceList" />
+				</methods>
+			</class>
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.resource.GetResourceTagsApiTest"> 
+				<methods> <include name="getModifiedResourceTagsList" /> </methods> </class> -->
+
+			<class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceApiTest">
+				<methods>
+					<include name="updateResourceMetadataSuccess" />
+				</methods>
+			</class>
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceInstanceNameCRUD"> 
+				<methods> <include name="updateResourceInstanceNameAfterServiceCertification"/> 
+				</methods> </class> -->
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.resource.ResourceInstanceServletTest"> 
+				<methods> <include name="updateRI_suc"/> </methods> </class> -->
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.resource.UpdateResourceMetadataTest">
+				<methods>
+					<include name="UpdateDerivedFromSuccess" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+	<test name="Product">
+		<classes>
+			<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckinTest">
+				<methods>
+					<include name="checkInProductByCreator" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ChangeServiceInstanceVersionTest">
+				<methods>
+					<include name="changeServiceInstanceVersionByPm" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCheckoutTest">
+				<methods>
+					<include name="checkOutProductByPmNotInContacts" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest">
+				<methods>
+					<include name="createServiceInstanceTest" />
+					<include name="deleteServiceInstanceByPm" />
+					<include name="updateServiceInstanceNameByPm" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest">
+				<methods>
+					<include name="createManyGroupingsDiffCategories" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductGetFollowedTest">
+				<methods>
+					<include name="followedPageTest" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.product.ProductUndoCheckoutTest">
+				<methods>
+					<include name="undoCheckOutProductByPm" />
+				</methods>
+			</class>
+			<!-- Product tests end -->
+		</classes>
+	</test>
+	<test name="Catalog">
+		<classes>
+			<class name="org.openecomp.sdc.ci.tests.execute.category.CatalogDataApiTest" />
+		</classes>
+	</test>
+
+	<test name="distribution">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.distribution.AuthanticationTests">
+				<methods>
+					<include name="downloadServiceArtifactSuccessWithAutantication" />
+				</methods>
+			</class>
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.distribution.DistributionDownloadArtifactTest">
+				<methods>
+					<include name="downloadResourceArtifactSuccess" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+	<test name="Category">
+		<classes>
+			<class name="org.openecomp.sdc.ci.tests.execute.category.ElementsApiTest">
+				<methods>
+					<include name="getAllArtifactTypes" />
+					<include name="getConfiguration" />
+					<include name="getAllPropertyScopesSuccess" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+	<test name="Imports">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.imports.ImportGenericResourceCITest">
+				<methods>
+					<include name="importAllTestResources" />
+					<include name="testImportCheckoutAndUpdateUserResource" />
+					<include name="testImportWithUpdateNormativeType" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.imports.ImportNewResourceCITest">
+				<methods>
+					<include name="importAllTestResources_toValidateNewAPI" />
+				</methods>
+			</class>
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.imports.ImportToscaResourceTest">
+				<methods>
+					<include name="importToscaResource" />
+				</methods>
+			</class>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.imports.ImportToscaCapabilitiesWithProperties">
+				<methods>
+					<include name="importNodeTypeWithCapabilityWithPropertiesFromYmlSucceed" />
+					<include name="importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesSucceed" />
+				</methods>
+			</class>
+		</classes>
+	</test> <!-- Test -->
+
+	<test name="attribute">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.attribute.ComponentInstanceAttributeTest">
+				<methods>
+					<include name="testUpdateAttributeOnResourceInstance" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+	<test name="inputs">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.inputs.InputsApiTests">
+				<methods>
+					<include name="testInputsMainFunctionality" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+	
+	<test name="property">
+		<classes>
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.property.AdditionalInformationServletTest">
+				<methods>
+					<include name="createResourceAdditionalInformationTestDuringLifecycle" />
+					<include name="updateResourceAdditionalInformationTest" />
+					<include name="deleteResourceAdditionalInformationTest" />
+				</methods>
+			</class>
+
+			<class name="org.openecomp.sdc.ci.tests.execute.property.PropertyApisTest">
+				<methods>
+					<include name="testPropertyApis" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.ci.tests.execute.property.ComponentInstancePropertyTest">
+				<methods>
+					<include name="nestedVfResourceProperty3Levels" />
+				</methods>
+			</class>
+
+
+
+			<!-- <class name="org.openecomp.sdc.ci.tests.execute.property.PropertyServletTest"> 
+				<methods> <include name="createCascadeVfResource" /> <include name="createPropertyTestSetClearDefaultValueInetegr" 
+				/> </methods> </class> -->
+		</classes>
+	</test>
+
+	<test name="User">
+		<classes>
+
+			<!-- class
+				name="org.openecomp.sdc.ci.tests.execute.user.ActivateDeActivateDeleteUser">
+				<methods>
+					<include name="authorizeDeActivatedUser" />
+				</methods>
+			</class-->
+
+			<class name="org.openecomp.sdc.ci.tests.execute.user.CreateUserApiTest">
+				<methods>
+					<include name="createUser" />
+				</methods>
+			</class>
+
+			<class
+				name="org.openecomp.sdc.ci.tests.execute.user.GovernorWorkspaceApiTest">
+				<methods>
+					<include name="governorList_AllCertifiedVersionsOfService" />
+				</methods>
+			</class>
+
+		</classes>
+	</test>
+	
+	<test name="ExternalApis">
+		<classes>
+			<class name="org.openecomp.sdc.externalApis.GetAssetServlet" >
+				<methods>
+					<include name="getResourceAssetSuccess" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.externalApis.GetFilteredAssetServlet">
+				<methods>
+					<include name="getResourceAssetBySpecifiedCategoryAndSubCategory" />
+					<include name="getServiceAssetBySpecifiedCategoryAndDistributionStatus" />
+				</methods>
+			</class>
+			<class name="org.openecomp.sdc.externalApis.GetSpecificAssetMetadataServlet">
+				<methods>
+					<include name="getResourceAssetMetadataWithResourceInstancesSuccess" />
+					<include name="getServiceAssetMetadataWithCertifiedResourceInstancesAndArtifactsOnRIsAndServiceSuccess" />
+				</methods>
+			</class>
+		</classes>
+	</test>
+
+
+
+
+
+
+
+</suite> 
\ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/service.xml b/test-apis-ci/src/main/resources/ci/testSuites/service.xml
new file mode 100644
index 0000000..18d5630
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/service.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Service" >
+   <test name="Service">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.GetServiceLatestVersionTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.CreateServiceMetadataApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.ReqCapOccurrencesTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.ChangeServiceDistributionStatusApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.ServiceComponentInstanceCRUDTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.UpdateServiceMetadataTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.service.GetAllServiceVersions"/>
+        </classes> 
+    </test>
+</suite> <!-- Service -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml b/test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml
new file mode 100644
index 0000000..54f1868
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="lifeCycle" >
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_cerificationCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceResourceLCSTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_UndoCheckOutCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_UndoCheckOutCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_StartCertificationCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_CheckinCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_CheckOutCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceCertWithResourceInstances"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CrossCheckOutTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CertifyVFWithNotCertRIs"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_request4CerCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CleanupIntermediateReources"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_CheckOutCIT"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_cerificationCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.CertifyServiceWithNotCertRI"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCS_CheckInCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_request4CerCITest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.lifecycle.ServiceLCS_StartCertificationCITest"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- lifeCycle -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/user.xml b/test-apis-ci/src/main/resources/ci/testSuites/user.xml
new file mode 100644
index 0000000..948993c
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/testSuites/user.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="User" >
+  <test name="Test">
+    <classes>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.AuthorizedUserApiTest_extend"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.AuthorizedUserApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.OpsWorkspaceApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.UserApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.GetAllAdminUsersApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.CRUDUserTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.CreateUserApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.GovernorWorkspaceApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.GetListsOfTesterUserApiTest"/>
+      <class name="org.openecomp.sdc.ci.tests.execute.user.ActivateDeActivateDeleteUser"/>
+    </classes>
+  </test> <!-- Test -->
+</suite> <!-- User -->
diff --git a/test-apis-ci/src/main/resources/log4j.properties b/test-apis-ci/src/main/resources/log4j.properties
new file mode 100644
index 0000000..d313e92
--- /dev/null
+++ b/test-apis-ci/src/main/resources/log4j.properties
@@ -0,0 +1,34 @@
+# Define the root logger with appender file
+log4j.rootLogger = INFO, FILE, stdout
+
+# Define the file appender
+log4j.appender.FILE=org.apache.log4j.RollingFileAppender
+log4j.appender.FILE.File=${targetlog}logs/ci-log.out
+
+# Define the layout for file appender
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
+
+# Set the maximum file size before rollover
+log4j.appender.FILE.maxFileSize=5MB
+
+# Set the the backup index
+log4j.appender.FILE.maxBackupIndex=10
+
+
+#############################################################
+
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+#log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
+
+log4j.logger.org.apache.cassandra.service.StorageProxy=INFO
+log4j.logger.com.thinkaurelius.titan.diskstorage.cassandra.CassandraTransaction=INFO, FILE, stdout
+
+log4j.logger.org.openecomp.sdc.ci.tests.utils=INFO, FILE, stdout
+log4j.additivity.org.openecomp.sdc.ci.tests.utils=false
+
+
diff --git a/test-apis-ci/src/main/resources/log4j.xml b/test-apis-ci/src/main/resources/log4j.xml
new file mode 100644
index 0000000..6db233a
--- /dev/null
+++ b/test-apis-ci/src/main/resources/log4j.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
+	debug="false">
+
+	<appender name="fileAppender" class="org.apache.log4j.FileAppender">
+
+		<param name="Threshold" value="INFO" />
+
+		<param name="File" value="logfile.log" />
+
+		<layout class="org.apache.log4j.PatternLayout">
+
+			<param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
+
+		</layout>
+
+	</appender>
+
+	<root>
+
+		<level value="INFO" />
+
+		<appender-ref ref="fileAppender" />
+
+	</root>
+	
+	
+
+</log4j:configuration>
diff --git a/test-apis-ci/src/main/resources/logback.xml b/test-apis-ci/src/main/resources/logback.xml
new file mode 100644
index 0000000..4723bc2
--- /dev/null
+++ b/test-apis-ci/src/main/resources/logback.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+        <file>logFile.log</file>
+        <append>true</append>
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="com.memorynotfound" level="TRACE"/>
+
+    <root level="DEBUG">
+        <appender-ref ref="STDOUT" />
+        <appender-ref ref="FILE" />
+    </root>
+
+</configuration>
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml b/test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml
new file mode 100644
index 0000000..9d7cd74
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml
@@ -0,0 +1,383 @@
+###########################################
+# Note the conventions of the field values:
+# type can be one of: CONFIG_ERROR, SYSTEM_ERROR, DATA_ERROR, CONNECTION_PROBLEM, AUTHENTICATION_PROBLEM
+# severity can be one of: WARN, ERROR, FATAL
+# alarmSeverity can be one of: CRITICAL,MAJOR,MINOR,INFORMATIONAL,NONE
+# code is a unique integer in range of 3003-9999 (3000-3002 are occupied for internal usage)
+# The above enumeration values are out-of-the-box and can be changed in code. 
+# In case of config and code mismatch, the appropriate error will be printed to log
+#
+## Range of BE codes - 3010-7999
+
+errors:
+
+    BeRestApiGeneralError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_4000,
+        severity: ERROR,
+        description: "Unexpected error during BE REST API execution",
+        alarmSeverity: CRITICAL
+    }
+
+    BeHealthCheckError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3010,
+        severity: ERROR,
+        description: "Error during BE Health Check",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeInitializationError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_4019,
+        severity: ERROR,
+        description: "Catalog-BE was not initialized properly",
+        alarmSeverity: CRITICAL
+    }
+
+    BeResourceMissingError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3011,
+        severity: ERROR,
+        description: "Mandatory resource %s cannot be found in repository",
+        alarmSeverity: MAJOR
+    }
+    
+    BeServiceMissingError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3012,
+        severity: ERROR,
+        description: "Mandatory service %s cannot be found in repository",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedAddingResourceInstanceError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3013,
+        severity: ERROR,
+        description: "Failed to add resource instance of resource %s to service %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeIncorrectServiceError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3014,
+        severity: ERROR,
+        description: "Service %s is not valid",
+        alarmSeverity: MAJOR
+    }
+     
+    BeRepositoryDeleteError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3015,
+        severity: ERROR,
+        description: "Failed to delete object %s from repository",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeRepositoryQueryError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3016,
+        severity: ERROR,
+        description: "Failed to fetch from repository %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeInvalidConfigurationError: {
+        type: CONFIG_ERROR,
+        code: ASDC_3017,
+        severity: FATAL,
+        description: "Configuration parameter %s is invalid. Value configured is %s",
+        alarmSeverity: MAJOR
+    }
+   
+    BeUebConnectionError: {
+        type: CONNECTION_PROBLEM,
+        code: ASDC_4001,
+        severity: ERROR,
+        description: "Connection problem towards U-EB server. Reason: %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeUebSystemError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3019,
+        severity: ERROR,
+        description: "Error occured during access to U-EB Server. Operation: %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeUebObjectNotFoundError: {
+        type: DATA_ERROR,
+        code: ASDC_4005,
+        severity: ERROR,
+        description: "Error occured during access to U-EB Server. Data not found: %s",
+        alarmSeverity: MAJOR
+    }
+
+    BeDistributionEngineSystemError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3021,
+        severity: ERROR,
+        description: "Error occured in Distribution Engine. Failed operation: %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeUebAuthenticationError: {
+        type: AUTHENTICATION_PROBLEM,
+        code: ASDC_4003,
+        severity: ERROR,
+        description: "Authentication problem towards U-EB server. Reason: %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeUebUnkownHostError: {
+        type: CONNECTION_PROBLEM,
+        code: ASDC_4002,
+        severity: ERROR,
+        description: "Connection problem towards U-EB server. Cannot reach host %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeDistributionEngineInvalidArtifactType: {
+        type: DATA_ERROR,
+        code: ASDC_4006,
+        severity: WARN,
+        description: "The artifact type %s does not appear in the list of valid artifacts %s",
+        alarmSeverity: MAJOR
+    }
+    BeInvalidTypeError: {
+        type: DATA_ERROR,
+        code: ASDC_4008,
+        severity: WARN,
+        description: "The type %s of %s is invalid",
+        alarmSeverity: MAJOR
+    }
+    BeInvalidValueError: {
+        type: DATA_ERROR,
+        code: ASDC_3028,
+        severity: WARN,
+        description: "The value %s of %s from type %s is invalid",
+        alarmSeverity: MAJOR
+    } 
+    
+    BeFailedDeletingResourceInstanceError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_3029,
+        severity: ERROR,
+        description: "Failed to delete resource instance %s from service %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeMissingConfigurationError: {
+        type: CONFIG_ERROR,
+        code: ASDC_3030,
+        severity: FATAL,
+        description: "Configuration parameter %s is missing",
+        alarmSeverity: MAJOR
+    }
+    
+    BeConfigurationInvalidListSizeError: {
+        type: CONFIG_ERROR,
+        code: ASDC_3031,
+        severity: FATAL,
+        description: "Configuration parameter %s is invalid. At least %s values shall be configured",
+        alarmSeverity: MAJOR
+    }
+    
+    ErrorConfigFileFormat: {
+        type: CONFIG_ERROR,
+        code: ASDC_3032,
+        severity: ERROR,
+        description: "Error element not found in YAML name: %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeMissingArtifactInformationError: {
+        type: DATA_ERROR,
+        code: ASDC_4010,
+        severity: ERROR,
+        description: "Artifact uploaded has missing information. Missing %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeArtifactMissingError: {
+        type: DATA_ERROR,
+        code: ASDC_4011,
+        severity: ERROR,
+        description: "Artifact %s requested is not found",
+        alarmSeverity: MAJOR
+    }
+    
+    BeArtifactPayloadInvalid: {
+        type: DATA_ERROR,
+        code: ASDC_4012,
+        severity: ERROR,
+        description: "Payload of artifact uploaded is invalid (invalid MD5 or encryption)",
+        alarmSeverity: MAJOR
+    }
+    
+    BeUserMissingError: {
+        type: DATA_ERROR,
+        code: ASDC_4009,
+        severity: ERROR,
+        description: "User %s requested is not found",
+        alarmSeverity: MAJOR
+    }
+    
+    BeArtifactInformationInvalidError: {
+        type: DATA_ERROR,
+        code: ASDC_4013,
+        severity: ERROR,
+        description: "Input for artifact metadata is invalid",
+        alarmSeverity: MAJOR
+    }
+    BeFailedAddingCapabilityTypeError: {
+        type: DATA_ERROR,
+        code: ASDC_4015,
+        severity: ERROR,
+        description: "Failed adding capability type",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeCapabilityTypeMissingError: {
+        type: DATA_ERROR,
+        code: ASDC_4016,
+        severity: ERROR,
+        description: "Capability Type %s not found",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeInterfaceMissingError: {
+        type: DATA_ERROR,
+        code: ASDC_4020,
+        severity: ERROR,
+        description: "Interface %s required is missing",
+        alarmSeverity: MAJOR
+    }
+    
+    BeDaoSystemError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_4014,
+        severity: ERROR,
+        description: "Operation towards database failed",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeSystemError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_4017,
+        severity: ERROR,
+        description: "Unexpected error during operation",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeFailedLockObjectError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_4007,
+        severity: WARN,
+        description: "Failed to lock object for update",
+        alarmSeverity: CRITICAL
+    }
+    
+    BeInvalidJsonInput: {
+        type: SYSTEM_ERROR,
+        code: ASDC_4018,
+        severity: ERROR,
+        description: "Failed to convert json input to object",
+        alarmSeverity: MAJOR
+    }
+    
+    BeDistributionMissingError: {
+        type: DATA_ERROR,
+        code: ASDC_4021,
+        severity: ERROR,
+        description: "Distribution %s required is missing",
+        alarmSeverity: MAJOR
+    }
+    
+    BeHealthCheckRecovery: {
+        type: RECOVERY,
+        code: ASDC_4022,
+        severity: INFO,
+        description: "BE Health Check Recovery",
+        alarmSeverity: INFORMATIONAL
+    }
+    BeFailedCreateNodeError: {
+        type: DATA_ERROR,
+        code: ASDC_6000,
+        severity: ERROR,
+        description: "Failed to create node %s on graph. status is %s",
+        alarmSeverity: MAJOR
+    }
+    BeFailedUpdateNodeError: {
+        type: DATA_ERROR,
+        code: ASDC_6001,
+        severity: ERROR,
+        description: "Failed to update node %s on graph. Status is %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedDeleteNodeError: {
+        type: DATA_ERROR,
+        code: ASDC_6002,
+        severity: ERROR,
+        description: "Failed to delete node %s on graph. Status is %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedRetrieveNodeError: {
+        type: DATA_ERROR,
+        code: ASDC_6003,
+        severity: ERROR,
+        description: "Failed to retrieve node %s from graph. Status is %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeExecuteRollbackError: {
+        type: DATA_ERROR,
+        code: ASDC_6004,
+        severity: ERROR,
+        description: "Going to execute rollback on graph.",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedFindParentError: {
+        type: DATA_ERROR,
+        code: ASDC_6005,
+        severity: ERROR,
+        description: "Failed to find parent node %s on graph. Status is %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedFindAllNodesError: {
+        type: DATA_ERROR,
+        code: ASDC_6006,
+        severity: ERROR,
+        description: "Failed to fetch all nodes with type %s of parent node %s . Status is %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedFindAssociationError: {
+        type: DATA_ERROR,
+        code: ASDC_6007,
+        severity: ERROR,
+        description: "Cannot find node with type %s associated with node %s . Status is %s",
+        alarmSeverity: MAJOR
+    }
+    
+    BeFailedFindAssociationError: {
+        type: DATA_ERROR,
+        code: ASDC_6008,
+        severity: ERROR,
+        description: "Cannot find node with type %s associated with node %s . Status is %s",
+        alarmSeverity: MAJOR
+    }
+    BeComponentCleanerSystemError: {
+        type: SYSTEM_ERROR,
+        code: ASDC_6009,
+        severity: ERROR,
+        description: "Error occured in Component Cleaner Task. Failed operation: %s",
+        alarmSeverity: MAJOR
+    }
+    
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/error-configuration.yaml b/test-apis-ci/src/test/resources/CI/error-configuration.yaml
new file mode 100644
index 0000000..ef7a885
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/error-configuration.yaml
@@ -0,0 +1,1778 @@
+# Errors
+errors:
+    OK: {
+        code: 200,
+        message: "OK"
+    }
+    CREATED: {
+        code: 201,
+        message: "OK"
+    }
+    NO_CONTENT: {
+        code: 204,
+        message: "No Content"
+    }
+#--------POL4050-----------------------------     
+    NOT_ALLOWED: {
+        code: 405,
+        message: "Error: Method not allowed.",
+        messageId: "POL4050"
+    }
+#--------POL5000-----------------------------     
+    GENERAL_ERROR: {
+        code: 500,
+        message: "Error: Internal Server Error. Please try again later.",
+        messageId: "POL5000"
+    }
+#---------POL5001------------------------------     
+    MISSING_X_ECOMP_INSTANCE_ID: {
+        code: 400  ,
+        message: "Error: Missing 'X-ECOMP-InstanceID' HTTP header.",
+        messageId: "POL5001"
+    }
+#---------POL5002------------------------------     
+    AUTH_REQUIRED: {
+        code: 401  ,
+        message: "Error: Authentication is required to use the API.",
+        messageId: "POL5002"
+    }
+#---------POL5003------------------------------     
+    AUTH_FAILED: {
+        code: 403  ,
+        message: "Error: Not authorized to use the API.",
+        messageId: "POL5003"
+    }
+#---------POL5004------------------------------     
+    MISSING_USER_ID: {
+        code: 400  ,
+        message: "Error: Missing 'USER_ID' HTTP header.",
+        messageId: "POL5004"
+    }
+#---------SVC4000----------------------------- 
+    INVALID_CONTENT: {
+        code: 400,
+        message: "Error: Invalid content.",
+        messageId: "SVC4000"
+    }
+#---------SVC4002----------------------------- 
+    MISSING_INFORMATION: {
+        code: 403,
+        message: "Error: Missing information.",
+        messageId: "SVC4002"
+    }
+#---------SVC4003------------------------------ 
+# %1 - Users's ID     
+    USER_NOT_FOUND: {
+        code: 404,
+        message: "Error: User '%1' was not found.",
+        messageId: "SVC4003"
+    }
+#---------SVC4004----------------------------- 
+# %1 - Users's email address     
+    INVALID_EMAIL_ADDRESS: {
+        code: 400,
+        message: "Error: Invalid email address '%1'.",
+        messageId: "SVC4004"
+    }
+#---------SVC4005------------------------------ 
+# %1 - role
+    INVALID_ROLE: {
+        code: 400,
+        message: "Error: Invalid role '%1'.",
+        messageId: "SVC4005"
+    }
+#---------SVC4006------------------------------ 
+# %1 - Users's USER_ID     
+    USER_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: User with '%1' ID already exists.",
+        messageId: "SVC4006"
+    }
+#---------SVC4007------------------------------ 
+    DELETE_USER_ADMIN_CONFLICT: {
+        code: 409,
+        message: "Error: An administrator can only be deleted by another administrator.",
+        messageId: "SVC4007"
+    }
+#---------SVC4008----------------------------- 
+# %1 - Users's userId     
+    INVALID_USER_ID: {
+        code: 400,
+        message: "Error: Invalid userId '%1'.",
+        messageId: "SVC4008"
+    }
+#---------SVC4049------------------------------ 
+# %1 - service/resource
+    COMPONENT_MISSING_CONTACT: {
+        code: 400,
+        message: "Error: Invalid Content. Missing %1 contact.",
+        messageId: "SVC4049"
+    } 
+#---------SVC4050----------------------------- 
+# %1 - Service/Resource/Additional parameter
+# %2 - service/resource/label name
+    COMPONENT_NAME_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: %1 with name '%2' already exists.",
+        messageId: "SVC4050"
+    }
+#---------SVC4051------------------------------ 
+# %1 - resource/service 
+    COMPONENT_MISSING_CATEGORY: {
+        code: 400,
+        message: "Error: Invalid Content. Missing %1 category.",
+        messageId: "SVC4051"
+    }
+
+#---------SVC4052------------------------------ 
+    COMPONENT_MISSING_TAGS: {
+        code: 400,
+        message: "Error: Invalid Content. At least one tag has to be specified.",
+        messageId: "SVC4052"
+    }
+
+#---------SVC4053------------------------------ 
+# %1 - service/resource
+    COMPONENT_MISSING_DESCRIPTION: {
+        code: 400,
+        message: "Error: Invalid Content. Missing %1 description.",
+        messageId: "SVC4053"
+    }
+#---------SVC4054------------------------------  
+# %1 - resource/service
+    COMPONENT_INVALID_CATEGORY: {
+        code: 400,
+        message: "Error: Invalid Content. Invalid %1 category.",
+        messageId: "SVC4054"
+    }
+#---------SVC4055------------------------------ 
+    MISSING_VENDOR_NAME: {
+        code: 400,
+        message: "Error: Invalid Content. Missing vendor name.",
+        messageId: "SVC4055"
+    }
+#---------SVC4056------------------------------ 
+    MISSING_VENDOR_RELEASE: {
+        code: 400,
+        message: "Error: Invalid Content. Missing vendor release.",
+        messageId: "SVC4056"
+    }
+
+#---------SVC4057------------------------------  
+    MISSING_DERIVED_FROM_TEMPLATE: {
+        code: 400,
+        message: "Error: Invalid Content. Missing derived from template specification.",
+        messageId: "SVC4057"
+    }
+
+#---------SVC4058------------------------------ 
+# %1 - service/resource
+    COMPONENT_MISSING_ICON: {
+        code: 400,
+        message: "Error: Invalid Content. Missing %1 icon.",
+        messageId: "SVC4058"
+    }
+#---------SVC4059------------------------------ 
+# %1 - service/resource
+    COMPONENT_INVALID_ICON: {
+        code: 400,
+        message: "Error: Invalid Content. Invalid %1 icon.",
+        messageId: "SVC4059"
+    }
+#---------SVC4060------------------------------  
+    PARENT_RESOURCE_NOT_FOUND: {
+        code: 400,
+        message: "Error: Invalid Content. Derived from resource template was not found.",
+        messageId: "SVC4060"
+    }
+#---------SVC4061------------------------------  
+    MULTIPLE_PARENT_RESOURCE_FOUND: {
+        code: 400,
+        message: "Error: Invalid Content. Multiple derived from resource template is not allowed.",
+        messageId: "SVC4061"
+    }
+
+#---------SVC4062------------------------------ 
+# %1 - service/resource
+    MISSING_COMPONENT_NAME: {
+        code: 400,
+        message: "Error: Invalid Content. Missing %1 name.",
+        messageId: "SVC4062"
+    }
+#---------SVC4063------------------------------  
+    #%1  -  resource/service name
+    RESOURCE_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' resource was not found.",
+        messageId: "SVC4063"
+    }
+
+#---------SVC4064------------------------------ 
+# %1 - Service/Resource/Property
+    COMPONENT_INVALID_DESCRIPTION: {
+        code: 400,
+        message: "Error: Invalid Content. %1 description contains non-english characters.",
+        messageId: "SVC4064"
+    }
+#---------SVC4065------------------------------ 
+# %1 - Service/Resource/Property
+# %2 - max resource/service name length 
+    COMPONENT_DESCRIPTION_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. %1 description exceeds limit of %2 characters.",
+        messageId: "SVC4065"
+    }
+#---------SVC4066------------------------------ 
+# %1 - max length   
+    COMPONENT_TAGS_EXCEED_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. Tags overall length exceeds limit of %1 characters.",
+        messageId: "SVC4066"
+    }
+#---------SVC4067------------------------------
+# %1 - max length  
+    VENDOR_NAME_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. Vendor name exceeds limit of %1 characters.",
+        messageId: "SVC4067"
+    }
+#---------SVC4068------------------------------
+# %1 - max length  
+    VENDOR_RELEASE_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. Vendor release exceeds limit of %1 characters.",
+        messageId: "SVC4068"
+    }
+
+#---------SVC4069------------------------------ 
+# %1 - Service/Resource/Product
+    COMPONENT_INVALID_CONTACT: {
+        code: 400,
+        message: "Error: Invalid Content. %1 Contact Id should be in format 'mnnnnnn' or 'aannna' or 'aannnn', where m=m ,a=a-zA-Z and n=0-9",
+        messageId: "SVC4069"
+    }
+#---------SVC4070------------------------------ 
+# %1 - Service/Resource
+    INVALID_COMPONENT_NAME: {
+        code: 400,
+        message: 'Error: Invalid Content. %1 name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+        messageId: "SVC4070"
+    }
+
+#---------SVC4071------------------------------ 
+    INVALID_VENDOR_NAME: {
+        code: 400,
+        message: 'Error: Invalid Content. Vendor name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+        messageId: "SVC4071"
+    }
+#---------SVC4072------------------------------ 
+    INVALID_VENDOR_RELEASE: {
+        code: 400,
+        message: 'Error: Invalid Content. Vendor release is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+        messageId: "SVC4072"
+    }
+#---------SVC4073------------------------------ 
+# %1 - Service/Resource
+# %2 - max  resource/service name  
+    COMPONENT_NAME_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. %1 name exceeds limit of %2 characters.",
+        messageId: "SVC4073"
+    }
+#---------SVC4080------------------------------  
+# %1 - resource/service name
+# %2 - resource/service
+# %3 - First name of last modifier
+# %4 - Last name of last modifier
+# %5 - USER_ID of last modifier
+    COMPONENT_IN_CHECKOUT_STATE: {
+        code: 403,
+        message: "Error: Requested '%1' %2 is locked for modification by %3 %4(%5).",
+        messageId: "SVC4080"
+    }
+#---------SVC4081-----------------------------  
+# %1 - resource/service name
+# %2 - resource/service
+# %3 - First name of last modifier
+# %4 - Last name of last modifier
+# %5 - USER_ID of last modifier
+    COMPONENT_IN_CERT_IN_PROGRESS_STATE: {
+        code: 403,
+        message: "Error: Requested '%1' %2 is locked for certification by %3 %4(%5).",
+        messageId: "SVC4081"
+    }
+
+#-----------SVC4082---------------------------  
+# %1 - resource/service name
+# %2 - resource/service
+# %3 - First name of last modifier
+# %4 - Last name of last modifier
+# %5 - USER_ID of last modifier
+    COMPONENT_SENT_FOR_CERTIFICATION: {
+        code: 403,
+        message: "Error: Requested '%1' %2 is sent for certification by %3 %4(%5).",
+        messageId: "SVC4082"
+    }
+#-----------SVC4083---------------------------
+    COMPONENT_VERSION_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Version of this %1 was already promoted.",
+        messageId: "SVC4083"
+    }
+#-----------SVC4084---------------------------
+# %1 - resource/service/product name
+# %2 - resource/service/product
+# %3 - First name of last modifier
+# %4 - Last name of last modifier
+# %5 - USER_ID of last modifier
+    COMPONENT_ALREADY_CHECKED_IN: {
+        code: 409,
+        message: "Error: The current version of '%1' %2 was already checked-in by %3 %4(%5).",
+        messageId: "SVC4084"
+    }
+#-----------SVC4085---------------------------
+# %1 - resource/service/product name
+# %2 - resource/service/product
+# %3 - First name of last modifier
+# %4 - Last name of last modifier
+# %5 - USER_ID of last modifier
+    COMPONENT_CHECKOUT_BY_ANOTHER_USER: {
+        code: 403,
+        message: "Error: %1 %2 has already been checked out by %3 %4(%5).",
+        messageId: "SVC4085"
+    }
+#-----------SVC4086---------------------------
+# %1  - resource/service name
+# %2  - resource/service
+    COMPONENT_IN_USE: {
+        code: 403,
+        message: "Error: Requested '%1' %2 is in use by another user.",
+        messageId: "SVC4086"
+    }
+#-----------SVC4087---------------------------
+# %1 - component name
+# %2 - resource/service/product
+    COMPONENT_HAS_NEWER_VERSION: {
+        code: 409,
+        message: "Error: Checking out of the requested version of the '%1' %2 is not allowed as a newer version exists.",
+        messageId: "SVC4087"
+    }
+#-----------SVC4088---------------------------
+# %1 - resource/service name
+# %2 - resource/service
+# %3 - First name of last modifier
+# %4 - Last name of last modifier
+# %5 - USER_ID of last modifier
+    COMPONENT_ALREADY_CERTIFIED: {
+        code: 403,
+        message: "Error: Requested %1 %2 has already been certified by %3 %4(%5).",
+        messageId: "SVC4088"
+    }
+#-----------SVC4089---------------------------
+# %1 - resource/service name
+# %2 - resource/service
+    COMPONENT_NOT_READY_FOR_CERTIFICATION: {
+        code: 403,
+        message: "Error: Requested '%1' %2 is not ready for certification.",
+        messageId: "SVC4089"
+    }
+#-----------SVC4100---------------------------
+#%1 - property name
+    PROPERTY_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' property was not found.",
+        messageId: "SVC4100"
+    }
+#-----------SVC4101---------------------------
+#%1 - property name
+    PROPERTY_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Property with '%1' name already exists.",
+        messageId: "SVC4101"
+    }
+
+#-----------SVC4102---------------------------
+# %1 - capability type name 
+    CAPABILITY_TYPE_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Capability Type with name '%1' already exists.",
+        messageId: "SVC4102"
+    }
+#-----------SVC4114---------------------------
+    AUTH_FAILED_INVALIDE_HEADER: {
+        code: 400,
+        message: "Error: Invalid Authorization header.",
+        messageId: "SVC4114"
+    }
+#-----------SVC4115---------------------------
+# %1 - capability type name 
+    MISSING_CAPABILITY_TYPE: {
+        code: 400,
+        message: "Error: Invalid Content. Missing Capability Type '%1'.",
+        messageId: "SVC4115"
+    }
+    RESOURCE_INSTANCE_BAD_REQUEST: {
+        code: 400,
+        message: "Error: Invalid Content.",
+        messageId: "SVC4116"
+    }
+#-----------SVC4117---------------------------
+# %1 - resource instance name
+# %2 - resource instance name
+# %3 - requirement name
+    RESOURCE_INSTANCE_MATCH_NOT_FOUND: {
+        code: 404,
+        message: "Error: Match not found between resource instance '%1' and resource instance '%2' for requirement '%3'.",
+        messageId: "SVC4117"
+    }
+#-----------SVC4118---------------------------
+# %1 - resource instance name
+# %2 - resource instance name
+# %3 - requirement name
+    RESOURCE_INSTANCE_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Resource instances '%1' and '%2' are already associated with requirement '%3'.",
+        messageId: "SVC4118"
+    }
+#-----------SVC4119---------------------------
+# %1 - resource instance name
+# %2 - resource instance name
+# %3 - requirement name
+    RESOURCE_INSTANCE_RELATION_NOT_FOUND: {
+        code: 404,
+        message: "Error: No relation found between resource instances '%1' and '%2' for requirement '%3'.",
+        messageId: "SVC4119"
+    }
+#-----------SVC4120---------------------------
+# %1 - User's USER_ID
+    USER_INACTIVE: {
+        code: 404,
+        message: "Error: User %1 was not found.",
+        messageId: "SVC4120"
+    }
+#-----------SVC4121---------------------------
+# %1 - User's USER_ID
+    USER_HAS_ACTIVE_ELEMENTS: {
+        code: 403,
+        message: "Error: User with %1 ID can not be deleted since it has active elements(resources/services/artifacts).",
+        messageId: "SVC4121"
+    }
+#-----------SVC4122---------------------------
+# %1 - artifact type
+    ARTIFACT_TYPE_NOT_SUPPORTED: {
+        code: 400,
+        message: "Error: Invalid artifact type '%1'.",
+        messageId: "SVC4122"
+    }
+#-----------SVC4123---------------------------
+    ARTIFACT_LOGICAL_NAME_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Artifact logical name cannot be changed.",
+        messageId: "SVC4123"
+    }
+#-----------SVC4124---------------------------
+    MISSING_ARTIFACT_TYPE: {
+        code: 400,
+        message: "Error: Missing artifact type.",
+        messageId: "SVC4124"
+    }
+#-----------SVC4125---------------------------
+# %1-artifact name
+    ARTIFACT_EXIST: {
+        code: 400,
+        message: "Error: Artifact '%1' already exists.",
+        messageId: "SVC4125"
+    }
+#---------SVC4126------------------------------ 
+# %1 - resource/service/product/...
+# %2 - field (tag, vendor name...)
+    INVALID_FIELD_FORMAT: {
+        code: 400,
+        message: "Error:  Invalid %1 %2 format.",
+        messageId: "SVC4126"
+    }
+#-----------SVC4127---------------------------
+    ARTIFACT_INVALID_MD5: {
+        code: 400,
+        message: "Error: Invalid artifact checksum.",
+        messageId: "SVC4127"
+    }
+#-----------SVC4128---------------------------
+    MISSING_ARTIFACT_NAME: {
+        code: 400,
+        message: "Error: Invalid content. Missing artifact name.",
+        messageId: "SVC4128"
+    }
+#-----------SVC4129---------------------------
+    MISSING_PROJECT_CODE: {
+        code: 400,
+        message: "Error: Invalid Content. Missing PROJECT_CODE number.",
+        messageId: "SVC4129"
+    }
+#-----------SVC4130---------------------------
+    INVALID_PROJECT_CODE: {
+        code: 400,
+        message: "Error: Invalid Content. PROJECT_CODE must be from 3 up to 50 characters.",
+        messageId: "SVC4130"
+    }
+#-----------SVC4131---------------------------
+# %1-resource/service
+# %2-srtifact/artifacts
+# %3-semicolomn separated list of artifact 
+    COMPONENT_MISSING_MANDATORY_ARTIFACTS: {
+        code: 403,
+        message: "Error: Missing mandatory informational %1 %2: [%3].",
+        messageId: "SVC4131"
+    }
+#-----------SVC4132---------------------------
+# %1 - lifecycle  type name
+    LIFECYCLE_TYPE_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Lifecycle Type with name '%1' already exists.",
+        messageId: "SVC4132"
+    }
+#-----------SVC4133---------------------------
+# %1 - service version
+# %2 - service name
+    SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION: {
+        code: 403,
+        message: "Error: Version %1 of '%2' service is not available for distribution.",
+        messageId: "SVC4133"
+    }
+#-----------SVC4134---------------------------
+    MISSING_LIFECYCLE_TYPE: {
+        code: 400,
+        message: "Error: Invalid Content. Missing interface life-cycle type.",
+        messageId: "SVC4134"
+    }
+#---------SVC4135------------------------------ 
+    SERVICE_CATEGORY_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Service category cannot be changed once the service is certified.",
+        messageId: "SVC4135"
+    }
+#---------SVC4136------------------------------ 
+# %1 - distribution environment name    
+    DISTRIBUTION_ENVIRONMENT_NOT_AVAILABLE: {
+        code: 500,
+        message: "Error: Requested distribution environment '%1' is not available.",
+        messageId: "SVC4136"
+    }
+#---------SVC4137------------------------------ 
+# %1 - distribution environment name    
+    DISTRIBUTION_ENVIRONMENT_NOT_FOUND: {
+        code: 400,
+        message: "Error: Requested distribution environment '%1' was not found.",
+        messageId: "SVC4137"
+    }
+#---------SVC4138------------------------------     
+    DISTRIBUTION_ENVIRONMENT_INVALID: {
+        code: 400,
+        message: "Error: Invalid distribution environment.",
+        messageId: "SVC4138"
+    }
+#---------SVC4139------------------------------     
+# %1 - service name
+    DISTRIBUTION_ARTIFACT_NOT_FOUND: {
+        code: 409,
+        message: "Error: Service '%1' cannot be distributed due to missing deployment artifacts.",
+        messageId: "SVC4139"
+    }
+#---------SVC4200------------------------------ 
+# %1 - Service/Resource
+# %2 - max icon name length   
+    COMPONENT_ICON_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. %1 icon name exceeds limit of %2 characters.",
+        messageId: "SVC4200"
+    }
+#---------SVC4300------------------------------ 
+    RESTRICTED_ACCESS: {
+        code: 403,
+        message: "Error: Restricted access.",
+        messageId: "SVC4300"
+    }
+#---------SVC4301------------------------------ 
+    RESTRICTED_OPERATION: {
+        code: 409,
+        message: "Error: Restricted operation.",
+        messageId: "SVC4301"
+    }
+#---------SVC4500------------------------------     
+    MISSING_BODY: {
+        code: 400  ,
+        message: "Error: Missing request body.",
+        messageId: "SVC4500"
+    }
+#---------SVC4501------------------------------
+    MISSING_PUBLIC_KEY: {
+        code: 400  ,
+        message: "Error: Invalid Content. Missing mandatory parameter 'apiPublicKey'." ,
+        messageId: "SVC4501"
+    }
+#---------SVC4502------------------------------     
+    DISTRIBUTION_ENV_DOES_NOT_EXIST: {
+        code: 400  ,
+        message: "Error: Invalid  Body  : Missing mandatory parameter 'distrEnvName'." ,
+        messageId: "SVC4502"
+    }
+#-----------SVC4503---------------------------
+# %1 - service name
+    SERVICE_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' service was not found.",
+        messageId: "SVC4503"
+    }
+
+#---------SVC4504------------------------------ 
+# %1 - Service/Resource
+# %2 - service/resource version
+    COMPONENT_VERSION_NOT_FOUND: {
+        code: 404,
+        message: "Error: %1 version %2 was not found.",
+        messageId: "SVC4504"
+    }
+#-----------SVC4505---------------------------
+    #%1-artifact name
+ 
+    ARTIFACT_NOT_FOUND: {
+        code: 404,
+        message: "Error: Artifact '%1' was not found.",
+        messageId: "SVC4505"
+    }
+#---------SVC4506------------------------------ 
+    MISSING_ENV_NAME: {
+        code: 400  ,
+        message: "Error: Invalid Content. Missing mandatory parameter 'distrEnvName'.",
+        messageId: "SVC4506"
+    }
+#---------SVC4507------------------------------ 
+    COMPONENT_INVALID_TAGS_NO_COMP_NAME: {
+        code: 400,
+        message: "Error: Invalid Content. One of the tags should be the component name.",
+        messageId: "SVC4507"
+    }
+ 
+#---------SVC4508------------------------------ 
+    SERVICE_NAME_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Service name cannot be changed once the service is certified.",
+        messageId: "SVC4508"
+    }
+
+#---------SVC4509------------------------------ 
+    SERVICE_ICON_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Icon cannot be changed once the service is certified.",
+        messageId: "SVC4509"
+    }
+#---------SVC4510------------------------------ 
+# %1 - icon name max length
+    SERVICE_ICON_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. Icon name exceeds limit of %1 characters.",
+        messageId: "SVC4510"
+    }
+#---------SVC4511------------------------------ 
+    DISTRIBUTION_REQUESTED_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested distribution was not found.",
+        messageId: "SVC4511"
+    }
+#---------SVC4512------------------------------ 
+# %1 - Distribution ID
+    DISTRIBUTION_REQUESTED_FAILED: {
+        code: 403,
+        message: "Error: Requested distribution '%1' failed.",
+        messageId: "SVC4512"
+    }
+#---------SVC4513------------------------------ 
+    RESOURCE_CATEGORY_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Resource category cannot be changed once the resource is certified.",
+        messageId: "SVC4513"
+    }
+#---------SVC4514------------------------------ 
+    RESOURCE_NAME_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Resource name cannot be changed once the resource is certified.",
+        messageId: "SVC4514"
+    }
+#---------SVC4515------------------------------ 
+    RESOURCE_ICON_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Icon cannot be changed once the resource is certified.",
+        messageId: "SVC4515"
+    }
+#---------SVC4516------------------------------ 
+    RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Vendor name cannot be changed once the resource is certified.",
+        messageId: "SVC4516"
+    }
+#---------SVC4517------------------------------ 
+    RESOURCE_DERIVED_FROM_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: Derived from resource template cannot be changed once the resource is certified.",
+        messageId: "SVC4517"
+    }
+#---------SVC4518------------------------------ 
+# %1 - max length 
+    COMPONENT_SINGLE_TAG_EXCEED_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. Single tag exceeds limit of %1 characters.",
+        messageId: "SVC4518"
+    }
+#---------SVC4519------------------------------ 
+    INVALID_DEFAULT_VALUE: {
+        code: 400,
+        message: "Error: mismatch in data-type occurred for property %1. data type is %2 and default value found is %3.",
+        messageId: "SVC4519"
+    }
+#---------SVC4520------------------------------ 
+# %1 - service or resource 
+    ADDITIONAL_INFORMATION_MAX_NUMBER_REACHED: {
+        code: 409,
+        message: "Error: Maximal number of additional %1 parameters was reached.",
+        messageId: "SVC4520"
+    }
+#---------SVC4521------------------------------
+    ADDITIONAL_INFORMATION_EMPTY_STRING_NOT_ALLOWED: {
+        code: 400,
+        message: "Error: Invalid Content. The Additional information label and value cannot be empty.",
+        messageId: "SVC4521"
+    }
+#---------SVC4522------------------------------ 
+# %1 - label/value
+# %2 - Maximal length of %1
+    ADDITIONAL_INFORMATION_EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. Additional information %1 exceeds limit of %2 characters.",
+        messageId: "SVC4522"
+    }
+#---------SVC4523------------------------------
+    ADDITIONAL_INFORMATION_KEY_NOT_ALLOWED_CHARACTERS: {
+        code: 400,
+        message: 'Error: Invalid Content. Additional information label is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+        messageId: "SVC4523"
+    }
+#---------SVC4524------------------------------
+    ADDITIONAL_INFORMATION_NOT_FOUND: {
+        code: 409,
+        message: "Error: Requested additional information was not found.",
+        messageId: "SVC4524"
+    }
+#---------SVC4525------------------------------    
+    ADDITIONAL_INFORMATION_VALUE_NOT_ALLOWED_CHARACTERS: {
+        code: 400,
+        message: 'Error: Invalid Content. Additional information contains non-english characters.',
+        messageId: "SVC4525"
+    }
+#---------SVC4526------------------------------ 
+    RESOURCE_INSTANCE_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' resource instance was not found.",
+        messageId: "SVC4526"
+    }
+#---------SVC4527------------------------------ 
+    ASDC_VERSION_NOT_FOUND: {
+        code: 500,
+        message: 'Error: ASDC version cannot be displayed.',
+        messageId: "SVC4527"
+    }
+#---------SVC4528------------------------------ 
+# %1-artifact url/artifact label/artifact description/VNF Service Indicator
+    MISSING_DATA: {
+        code: 400,
+        message: "Error: Invalid content. Missing %1.",
+        messageId: "SVC4528"
+    }
+#---------SVC4529------------------------------ 
+# %1-artifact url/artifact label/artifact description/artifact name
+# %2 - Maximal length of %1
+    EXCEEDS_LIMIT: {
+        code: 400,
+        message: "Error: Invalid Content. %1 exceeds limit of %2 characters.",
+        messageId: "SVC4529"
+    }
+#---------SVC4530------------------------------ 
+    ARTIFACT_INVALID_TIMEOUT: {
+        code: 400,
+        message: "Error: Invalid Content. Artifact Timeout should be set to valid positive non-zero number of minutes.",
+        messageId: "SVC4530"
+    }
+#---------SVC4531------------------------------ 
+    SERVICE_IS_VNF_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: VNF Indicator cannot be updated for certified service.",
+        messageId: "SVC4531"
+    }
+ #---------SVC4532------------------------------ 
+    RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE: {
+        code: 404,
+        message: "Error: Requested '%1' resource instance was not found on the service '%2.",
+        messageId: "SVC4532"
+    }
+ #---------SVC4533------------------------------ 
+ # %1 -  "HEAT"/"HEAT_ENV"/"MURANO_PKG"/"YANG_XML" 
+    WRONG_ARTIFACT_FILE_EXTENSION: {
+        code: 400,
+        message: "Error: Invalid file extension for %1 artifact type.",
+        messageId: "SVC4533"
+    }
+
+#---------SVC4534------------------------------ 
+# %1 -  "HEAT"/"HEAT_ENV"             
+    INVALID_YAML: {
+        code: 400,
+        message: "Error: Uploaded YAML file for %1 artifact is invalid.",
+        messageId: "SVC4534"
+    }
+
+#---------SVC4535------------------------------ 
+# %1 -  "HEAT"             
+    INVALID_DEPLOYMENT_ARTIFACT_HEAT: {
+        code: 400,
+        message: "Error: Invalid %1 artifact.",
+        messageId: "SVC4535"
+    }
+#---------SVC4536------------------------------ 
+# %1 - "Resource"/"Service"
+# %2 -  resource/service name 
+# %3 -  "HEAT"/"HEAT_ENV"/"MURANO_PKG" 
+# %4 -  "HEAT"/"HEAT_ENV"/"MURANO_PKG
+    DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS: {
+        code: 400,
+        message: "Error: %1 '%2' already has a deployment artifact of %3 type .Please delete or update an existing %4 artifact.",
+        messageId: "SVC4536"
+    }
+
+#---------SVC4537------------------------------ 
+    MISSING_HEAT: {
+        code: 400,
+        message: "Error: Missing HEAT artifact. HEAT_ENV artifact cannot be uploaded without corresponding HEAT template.",
+        messageId: "SVC4537"
+    }
+#---------SVC4538------------------------------ 
+    MISMATCH_HEAT_VS_HEAT_ENV: {
+        code: 400,
+        message: "Error: Invalid artifact content. Parameter's set in HEAT_ENV '%1' artifact doesn't match the parameters in HEAT '%2' artifact.",
+        messageId: "SVC4538"
+    }
+#---------SVC4539------------------------------ 
+    INVALID_RESOURCE_PAYLOAD: {
+        code: 400,
+        message: "Error: Invalid resource payload.",
+        messageId: "SVC4539"
+    }
+#---------SVC4540------------------------------ 
+    INVALID_TOSCA_FILE_EXTENSION: {
+        code: 400,
+        message: "Error: Invalid file extension for TOSCA template.",
+        messageId: "SVC4540"
+    }
+#---------SVC4541------------------------------ 
+    INVALID_YAML_FILE: {
+        code: 400,
+        message: "Error: Invalid YAML file.",
+        messageId: "SVC4541"
+    }
+#---------SVC4542------------------------------ 
+    INVALID_TOSCA_TEMPLATE: {
+        code: 400,
+        message: "Error: Invalid TOSCA template.",
+        messageId: "SVC4542"
+    }
+#---------SVC4543------------------------------ 
+    NOT_RESOURCE_TOSCA_TEMPLATE: {
+        code: 400,
+        message: "Error: Imported Service TOSCA template.",
+        messageId: "SVC4543"
+    }
+#---------SVC4544------------------------------ 
+    NOT_SINGLE_RESOURCE: {
+        code: 400,
+        message: "Error: Imported TOSCA template should contain one resource definition.",
+        messageId: "SVC4544"
+    }
+#---------SVC4545------------------------------ 
+    INVALID_RESOURCE_NAMESPACE: {
+        code: 400,
+        message: "Error: Invalid resource namespace.",
+        messageId: "SVC4545"
+    }
+#---------SVC4546------------------------------ 
+    RESOURCE_ALREADY_EXISTS: {
+        code: 400,
+        message: "Error: Imported resource already exists in ASDC Catalog.",
+        messageId: "SVC4546"
+    }
+#---------SVC4549------------------------------ 
+    INVALID_RESOURCE_CHECKSUM: {
+        code: 400,
+        message: "Error: Invalid resource checksum.",
+        messageId: "SVC4549"
+    }
+#---------SVC4550------------------------------ 
+    #%1  -  Consumer salt
+    INVALID_LENGTH: {
+        code: 400,
+        message: "Error: Invalid %1 length.",
+        messageId: "SVC4550"
+    }
+    #---------SVC4551------------------------------  
+    #%1  -  ECOMP User name
+    ECOMP_USER_NOT_FOUND: {
+        code: 404,
+        message: "Error: ECOMP User '%1' was not found.",
+        messageId: "SVC4551"
+    }
+#---------SVC4552------------------------------
+    CONSUMER_ALREADY_EXISTS: {
+        code: 409,
+        message: "Error: ECOMP User already exists.",
+        messageId: "SVC4552"
+    }
+#---------SVC4553-----------------------------
+    #%1  -  Consumer name / Consumer password/ Consumer salt 
+    INVALID_CONTENT_PARAM: {
+        code: 400,
+        message: "Error: %1 is invalid.",
+        messageId: "SVC4553"
+    }
+    #---------SVC4554------------------------------ 
+# %1 - "Resource"/"Service"
+    COMPONENT_ARTIFACT_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested artifact doesn't belong to specified %1.",
+        messageId: "SVC4554"
+    }
+#---------SVC4554------------------------------
+# %1 - "Service name"
+    SERVICE_DEPLOYMENT_ARTIFACT_NOT_FOUND: {
+        code: 403,
+        message: "Error: Requested '%1' service is not ready for certification. Service has to have at least one deployment artifact.",
+        messageId: "SVC4554"
+    }
+#---------SVC4555------------------------------ 
+#%1 - "Resource"/"Service"/"Product"
+#%2 - "category"
+    COMPONENT_ELEMENT_INVALID_NAME_LENGTH: {
+        code: 400,
+        message: "Error: Invalid %1 %2 name length.",
+        messageId: "SVC4555"
+    }
+#---------SVC4556------------------------------ 
+#%1 - "Resource"/"Service"/"Product"
+#%2 - "category"
+    COMPONENT_ELEMENT_INVALID_NAME_FORMAT: {
+        code: 400,
+        message: "Error: Invalid %1 %2 name format.",
+        messageId: "SVC4556"
+    }
+#---------SVC4557------------------------------ 
+#%1 - "Resource"/"Service"/"Product"
+#%2 - "category name"
+    COMPONENT_CATEGORY_ALREADY_EXISTS: {
+        code: 409,
+        message: "Error: %1 category name '%2' already exists.",
+        messageId: "SVC4557"
+    }
+#---------SVC4558------------------------------
+# %1 - "service"/"VF"
+# %2 - "Resource name"
+    VALIDATED_RESOURCE_NOT_FOUND: {
+        code: 403,
+        message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource.",
+        messageId: "SVC4558"
+    }
+#---------SVC4559------------------------------
+# %1 - "service"/"VF"
+# %2 - "Resource name"
+    FOUND_ALREADY_VALIDATED_RESOURCE: {
+        code: 403,
+        message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource. Please use already available validated resource version.",
+        messageId: "SVC4559"
+    }
+#---------SVC4560------------------------------
+# %1 - "service"/"VF"
+# %2 - "Resource name"
+    FOUND_LIST_VALIDATED_RESOURCES: {
+        code: 403,
+        message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource. Please use one of available validated resource versions.",
+        messageId: "SVC4560"
+    }  
+#---------SVC4561------------------------------
+# %1 - "resource"/"product"
+# %2 - "category"
+# %3 - "category name"
+    COMPONENT_CATEGORY_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested %1 %2 '%3' was not found.",
+        messageId: "SVC4561"
+    }
+#---------SVC4562------------------------------
+# %1 - "Resource"/"Product"
+# %2 - "sub-category name"
+# %3 - "category name"
+    COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY: {
+        code: 409,
+        message: "Error: %1 sub-category '%2' already exists under '%3' category.",
+        messageId: "SVC4562"
+    }
+#---------SVC4563------------------------------
+# %1 - "Product"
+# %2 - "grouping name"
+# %3 - "sub-category name"
+    COMPONENT_GROUPING_EXISTS_FOR_SUB_CATEGORY: {
+        code: 409,
+        message: "Error: %1 grouping '%2' already exists under '%3' sub-category.",
+        messageId: "SVC4563"
+    }
+#---------SVC4564------------------------------ 
+# %1 - product name
+    PRODUCT_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' product was not found.",
+        messageId: "SVC4564"
+    }
+#---------SVC4565------------------------------ 
+# %1 - "HEAT"   
+# %2  - parameter type ("string" , "boolean" , "number") 
+# %3 -  parameter name
+    INVALID_HEAT_PARAMETER_VALUE: {
+        code: 400,
+        message: "Error: Invalid %1 artifact. Invalid %2 value set for '%3' parameter.",
+        messageId: "SVC4565"
+    }
+#---------SVC4566------------------------------ 
+# %1 - "HEAT"   
+# %2  - parameter type ("string" , "boolean" , "number") 
+    INVALID_HEAT_PARAMETER_TYPE: {
+        code: 400,
+        message: "Error: Invalid %1 artifact. Unsupported '%2' parameter type.",
+        messageId: "SVC4566"
+    }
+#---------SVC4567------------------------------ 
+# %1 -  "YANG_XML"             
+    INVALID_XML: {
+        code: 400,
+        message: "Error: Uploaded XML file for %1 artifact is invalid.",
+        messageId: "SVC4567"
+    }
+#---------SVC4567------------------------------ 
+# %1 - "User Name and UserId"   
+# %2  -"checked-out"/"in-certification"
+    CANNOT_DELETE_USER_WITH_ACTIVE_ELEMENTS: {
+        code: 409,
+        message: "Error: User cannot be deleted. User '%1' has %2 projects.",
+        messageId: "SVC4567"
+    }
+#---------SVC4568------------------------------ 
+# %1 - "User Name and UserId"   
+# %2  -"checked-out"/"in-certification"
+    CANNOT_UPDATE_USER_WITH_ACTIVE_ELEMENTS: {
+        code: 409,
+        message: "Error: Role cannot be changed. User '%1' has %2 projects.",
+        messageId: "SVC4568"
+    }
+#---------SVC4570------------------------------ 
+    UPDATE_USER_ADMIN_CONFLICT: {
+        code: 409,
+        message: "Error: An administrator is not allowed to change his/her role.",
+        messageId: "SVC4570"
+    }
+#---------SVC4571------------------------------ 
+    SERVICE_CANNOT_CONTAIN_SUBCATEGORY: {
+        code: 400,
+        message: "Error: Sub category cannot be defined for service",
+        messageId: "SVC4571"
+    }
+#---------SVC4572------------------------------ 
+# %1 - "Resource"/"Service"
+    COMPONENT_TOO_MUCH_CATEGORIES: {
+        code: 400,
+        message: "Error: %1 must have only 1 category",
+        messageId: "SVC4572"
+    }
+#---------SVC4574------------------------------ 
+    RESOURCE_TOO_MUCH_SUBCATEGORIES: {
+        code: 400,
+        message: "Error: Resource must have only 1 sub category",
+        messageId: "SVC4574"
+    }
+#---------SVC4575------------------------------ 
+    COMPONENT_MISSING_SUBCATEGORY: {
+        code: 400,
+        message: "Error: Missing sub category",
+        messageId: "SVC4575"
+    }
+ #---------SVC4576------------------------------ 
+# %1 - "component type"
+    UNSUPPORTED_ERROR: {
+        code: 400,
+        message: "Error : Requested component type %1 is unsupported.",
+        messageId: "SVC4576"
+    }
+    #---------SVC4577------------------------------ 
+# %1 - "resource type"
+    RESOURCE_CANNOT_CONTAIN_RESOURCE_INSTANCES: {
+        code: 409,
+        message: "Error : Resource of type %1 cannot contain resource instances.",
+        messageId: "SVC4577"
+    }
+#---------SVC4578------------------------------ 
+# %1 - "Resource"/"Service"
+# %2 -  resource/service name 
+# %3 -  "artifact name" 
+    DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS: {
+        code: 400,
+        message: "Error: %1 '%2' already has a deployment artifact named '%3'.",
+        messageId: "SVC4578"
+    }
+#---------SVC4579------------------------------ 
+# %1 - "Category"/"Sub-Category"/"Group"
+# %2 -  category/sub-category/grouping name.
+    INVALID_GROUP_ASSOCIATION: {
+        code: 400,
+        message: "Error: Invalid group association. %1 '%2' was not found.",
+        messageId: "SVC4579"
+    }
+#---------SVC4580------------------------------ 
+    EMPTY_PRODUCT_CONTACTS_LIST: {
+        code: 400,
+        message: "Error: Invalid content. At least one Product Contact has to be specified.",
+        messageId: "SVC4580"
+    }
+#---------SVC4581------------------------------ 
+# %1 - UserId
+    INVALID_PRODUCT_CONTACT: {
+        code: 400,
+        message: "Error: Invalid content. User '%1' cannot be set as Product Contact.",
+        messageId: "SVC4581"
+    }
+#---------SVC4582------------------------------ 
+# %1 - Product
+# %2 - "abbreviated"/"full"
+    MISSING_ONE_OF_COMPONENT_NAMES: {
+        code: 400,
+        message: "Error: Invalid content. Missing %1 %2 name.",
+        messageId: "SVC4582"
+    }    
+#---------SVC4583------------------------------
+# %1 - "Icon"
+# %2 - "resource"/"service"/"product"
+    COMPONENT_PARAMETER_CANNOT_BE_CHANGED: {
+        code: 400,
+        message: "Error: %1 cannot be changed once the %2 is certified.",
+        messageId: "SVC4583"
+    }
+#---------SVC4584------------------------------
+# %1  - service/VF name 
+# %2 - "service" /"VF"
+# %3 -  resource instance origin type
+# %4 -  resource instance name 
+# %5 -  requirement/capability
+# %6 -  requirement/capability name
+# %7 -  "fulfilled" (for req)/"consumed (for cap)"
+    REQ_CAP_NOT_SATISFIED_BEFORE_CERTIFICATION: {
+        code: 403,
+        message: "Error:  Requested '%1' %2 is not ready for certification.  %3 '%4' has to have %5 '%6' %7.",
+        messageId: "SVC4584"
+    }
+#---------SVC4585------------------------------ 
+    INVALID_OCCURRENCES: {
+        code: 400,
+        message: "Error: Invalid occurrences format.",
+        messageId: "SVC4585"
+    }
+#---------SVC4586------------------------------ 
+#---------SVC4586------------------------------ 
+    INVALID_SERVICE_API_URL: {
+        code: 400,
+        message: 'Error: Invalid Service API URL. Please check whether your URL has a valid domain extension and does not contain the following characters - #?&@%+;,=$<>~^`\[]{}|"*!',
+        messageId: "SVC4586"
+    }
+#---------SVC4587------------------------------ 
+# %1  - Data type name 
+    DATA_TYPE_ALREADY_EXIST: {
+        code: 409,
+        message: 'Error: Data type %1 already exists.',
+        messageId: "SVC4587"
+    }
+#---------SVC4588------------------------------ 
+# %1  - Data type name 
+    DATA_TYPE_NOR_PROPERTIES_NEITHER_DERIVED_FROM: {
+        code: 400,
+        message: 'Error: Invalid Data type %1. Data type must have either a valid derived from declaration or at least one valid property',
+        messageId: "SVC4588"
+    }
+#---------SVC4589------------------------------ 
+# %1  - Data type name 
+    DATA_TYPE_PROPERTIES_CANNOT_BE_EMPTY: {
+        code: 400,
+        message: "Error: Invalid Data type %1. 'properties' parameter cannot be empty if provided.",
+        messageId: "SVC4589"
+    }
+#---------SVC4590------------------------------ 
+# %1  - Property type name 
+# %2  - Property name
+    INVALID_PROPERTY_TYPE: {
+        code: 400,
+        message: "Error: Invalid Property type %1 in property %2.",
+        messageId: "SVC4590"
+    }
+#---------SVC4591------------------------------ 
+# %1  - Property inner type
+# %2  - Property name 
+    INVALID_PROPERTY_INNER_TYPE: {
+        code: 400,
+        message: "Error: Invalid property inner type %1, in property %2",
+        messageId: "SVC4591"
+    }
+#---------SVC4592------------------------------ 
+# %1  - component instance name
+# %2  - "resource instance"/"service instance"
+    COMPONENT_INSTANCE_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' %2 was not found.",
+        messageId: "SVC4592"
+    }
+#---------SVC4593------------------------------ 
+# %1 - component instance name
+# %2 - "resource instance"/"service instance"
+# %3 - "resource/"service"/"product"
+# %4 - container name 
+    COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER: {
+        code: 404,
+        message: "Error: Requested '%1' %2 was not found on the %3 '%4'.",
+        messageId: "SVC4593"
+    }
+#---------SVC4594------------------------------
+#%1 - requirement / capability
+#%2 - requirement name
+    IMPORT_DUPLICATE_REQ_CAP_NAME: {
+        code: 400,
+        message: "Error: Imported TOSCA template contains more than one %1 named '%2'.",
+        messageId: "SVC4594"
+    }
+#---------SVC4595------------------------------
+#%1 - requirement / capability
+#%2 - requirement name
+#%3 - parent containing the requirement 
+    IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED: {
+        code: 400,
+        message: "Error: Imported TOSCA template contains %1 '%2' that is already defined by derived template %3.",
+        messageId: "SVC4595"
+    }
+#---------SVC4596------------------------------ 
+# %1  - Data type name
+    DATA_TYPE_DERIVED_IS_MISSING: {
+        code: 400,
+        message: "Error: Invalid Content. The ancestor data type %1 cannot be found in the system.",
+        messageId: "SVC4596"
+    }
+#---------SVC4597------------------------------ 
+# %1  - Data type name
+# %2  - Property names
+    DATA_TYPE_PROPERTY_ALREADY_DEFINED_IN_ANCESTOR: {
+        code: 400,
+        message: "Error: Invalid Content. The data type %1 contains properties named %2 which are already defined in one of its ancestors.",
+        messageId: "SVC4597"
+    }
+#---------SVC4598------------------------------ 
+# %1  - Data type name
+    DATA_TYPE_DUPLICATE_PROPERTY: {
+        code: 400,
+        message: "Error: Invalid Content. The data type %1 contains duplicate property.",
+        messageId: "SVC4598"
+    }
+#---------SVC4599------------------------------ 
+# %1  - Data type name
+# %2  - Property names
+    DATA_TYPE_PROEPRTY_CANNOT_HAVE_SAME_TYPE_OF_DATA_TYPE: {
+        code: 400,
+        message: "Error: Invalid Content. The data type %1 contains properties %2 which their type is this data type.",
+        messageId: "SVC4599"
+    }
+#---------SVC4600------------------------------ 
+# %1  - Data type name
+    DATA_TYPE_CANNOT_HAVE_PROPERTIES: {
+        code: 400,
+        message: "Error: Invalid Content. The data type %1 cannot have properties since it is of type scalar",
+        messageId: "SVC4600"
+    }
+#---------SVC4601------------------------------ 
+    NOT_TOPOLOGY_TOSCA_TEMPLATE: {
+        code: 400,
+        message: "Error: TOSCA yaml file %1 cannot be modeled to VF as it does not contain 'topology_template.",
+        messageId: "SVC4601"
+    }
+#---------SVC4602--------------------------------
+# %1 - yaml file name
+# %2 - node_template label
+# %3 - node_template type
+    INVALID_NODE_TEMPLATE: {
+        code: 400,
+        message: "Error: TOSCA yaml file '%1' contains node_template '%2' of type '%3' that does not represent existing VFC/CP/VL",
+        messageId: "SVC4602"
+    }
+#---------SVC4603------------------------------  
+# %1 - component type
+# %2 - component name
+# %3 - state
+    ILLEGAL_COMPONENT_STATE: {
+        code: 403,
+        message: "Error: Component instance of %1 can not be created because the component '%2' is in an illegal state %3.",
+        messageId: "SVC4603"
+    }
+#---------SVC4604------------------------------  
+# %1 - csar file name
+    CSAR_INVALID: {
+        code: 400,
+        message: "Error: TOSCA CSAR '%1' is invalid. 'TOSCA-Metadata/Tosca.meta' file must be provided.",
+        messageId: "SVC4604"
+    }
+#---------SVC4605------------------------------  
+# %1 - csar file name
+    CSAR_INVALID_FORMAT: {
+        code: 400,
+        message: "Error: TOSCA CSAR '%1' is invalid. Invalid 'TOSCA-Metadata/Tosca.meta' file format.",
+        messageId: "SVC4605"
+    }
+#---------SVC4606------------------------------  
+# %1 - property name
+# %2 - property type
+# %3 - property innerType
+# %4 - default value is
+    INVALID_COMPLEX_DEFAULT_VALUE: {
+        code: 400,
+        message: "Error: Invalid default value of property %1. Data type is %2 with inner type %3 and default value found is %4.",
+        messageId: "SVC4606"
+    }
+#---------SVC4607------------------------------  
+# %1 - csar file name
+    CSAR_NOT_FOUND: {
+        code: 400,
+        message: "Error: TOSCA CSAR '%1' is not found.",
+        messageId: "SVC4607"
+    }
+#---------SVC4608------------------------------  
+# %1 - artifact name
+# %2 - component type
+# %3 - actual component type
+    MISMATCH_BETWEEN_ARTIFACT_TYPE_AND_COMPONENT_TYPE: {
+        code: 400,
+        message: "Error: Artifact %1 is only compatible with component of type %2, but component type is %3.",
+        messageId: "SVC4608"
+    }
+
+#---------SVC4609------------------------------ 
+# %1 -  "INVALID_JSON"             
+    INVALID_JSON: {
+        code: 400,
+        message: "Error: Uploaded JSON file for %1 artifact is invalid.",
+        messageId: "SVC4609"
+    }
+#---------SVC4610------------------------------  
+# %1 - csar file name
+# %2 - missing file name
+    YAML_NOT_FOUND_IN_CSAR: {
+        code: 400,
+        message: "Error - TOSCA CSAR %1 is invalid. TOSCA-Metadata/Tosca.meta refers to file %2 that is not provided.",
+        messageId: "SVC4610"
+    }
+#---------SVC4611------------------------------  
+# %1 - group name
+    GROUP_MEMBER_EMPTY: {
+        code: 400,
+        message: "Error: Invalid Content. Group %1 member list was provided but does not have values",
+        messageId: "SVC4611"
+    }
+#---------SVC4612------------------------------ 
+# %1  - group name 
+    GROUP_TYPE_ALREADY_EXIST: {
+        code: 409,
+        message: 'Error: Group type %1 already exists.',
+        messageId: "SVC4612"
+    }
+#---------SVC4613------------------------------  
+# %1 - group name
+# %2 - VF name(component name)
+# %3 - actual component type [VF]
+    GROUP_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Group with name '%1' already exists in %2 %3.",
+        messageId: "SVC4613"
+    }   
+#---------SVC4614------------------------------  
+# %1 - group type
+    GROUP_TYPE_IS_INVALID: {
+        code: 400,
+        message: "Error: Invalid content. Group type %1 does not exist",
+        messageId: "SVC4614"
+    }
+#---------SVC4615------------------------------  
+# %1 - group name
+    GROUP_MISSING_GROUP_TYPE: {
+        code: 400,
+        message: "Error: Invalid Content. Missing Group Type for group '%1'",
+        messageId: "SVC4615"
+    }
+#---------SVC4616------------------------------
+# %1 - member name
+# %2 - group name
+# %3 - VF name
+# %4 - component type [VF ]
+    GROUP_INVALID_COMPONENT_INSTANCE: {
+        code: 400,
+        message: "Error: Member '%1' listed in group '%2' is not part of '%3' %4.",
+        messageId: "SVC4616"
+    }                 
+#---------SVC4617------------------------------
+# %1 - member name
+# %2 - group name
+# %3 - group type
+    GROUP_INVALID_TOSCA_NAME_OF_COMPONENT_INSTANCE: {
+        code: 400,
+        message: "Error: member %1 listed in group %2 is not part of allowed members of group type %3.",
+        messageId: "SVC4617"
+    }
+#---------SVC4618------------------------------ 
+# %1 - missing file name
+# %2 - csar file name
+    ARTIFACT_NOT_FOUND_IN_CSAR: {
+        code: 400,
+        message: "Error: artifact %1 is defined in CSAR %2 manifest but is not provided",
+        messageId: "SVC4618"
+    }
+#---------SVC4619------------------------------ 
+# %1 - artifact name
+# %2 - artifact type
+# %3 - existing artifact type
+    ARTIFACT_ALRADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR: {
+        code: 400,
+        message: "Error: artifact %1 in type %2 already exists in type %3.",
+        messageId: "SVC4619"
+    }
+#---------SVC4620------------------------------ 
+    FAILED_RETRIVE_ARTIFACTS_TYPES: {
+        code: 400,
+        message: "Error: Failed to retrieve list of suported artifact types.",
+        messageId: "SVC4620"
+    }
+#---------SVC4621------------------------------ 
+# %1 - artifact name
+# %2 - master 
+    ARTIFACT_ALRADY_EXIST_IN_MASTER_IN_CSAR: {
+        code: 400,
+        message: "Error: artifact %1 already exists in master %2 .",
+        messageId: "SVC4621"
+    }
+#---------SVC4622------------------------------ 
+# %1 - artifact name
+# %2 - artifact type 
+# %3 - master name
+# %4 - master type
+    ARTIFACT_NOT_VALID_IN_MASTER: {
+        code: 400,
+        message: "Error: artifact %1 in type %2 can not be exists under master %3 in type %4.",
+        messageId: "SVC4622"
+    }
+#---------SVC4623------------------------------ 
+# %1 - artifact name
+# %2 - artifact type 
+# %3 - env name
+# %4 - existing env
+    ARTIFACT_NOT_VALID_ENV: {
+        code: 400,
+        message: "Error: Artifact %1 in type %2 with env %3 already exists with another env %4",
+        messageId: "SVC4623"
+    }
+#---------SVC4624------------------------------  
+# %1 - groups names
+# %2 - VF name
+# %3 - component type [VF ]
+    GROUP_IS_MISSING: {
+        code: 400,
+        message: "Error: Invalid Content. The groups '%1' cannot be found under %2 %3.",
+        messageId: "SVC4624"
+    }
+#---------SVC4625------------------------------  
+# %1 - groups name
+    GROUP_ARTIFACT_ALREADY_ASSOCIATED: {
+        code: 400,
+        message: "Error: Invalid Content. Artifact already associated to group '%1'.",
+        messageId: "SVC4625"
+    }
+#---------SVC4626------------------------------  
+# %1 - groups name
+    GROUP_ARTIFACT_ALREADY_DISSOCIATED: {
+        code: 400,
+        message: "Error: Invalid Content. Artifact already dissociated from group '%1'.",
+        messageId: "SVC4626"
+    }
+#---------SVC4627------------------------------
+# %1 - property name
+# %2 - group name
+# %3 - group type name
+    GROUP_PROPERTY_NOT_FOUND: {
+        code: 400,
+        message: "Error: property %1 listed in group %2 is not exist in group type %3.",
+        messageId: "SVC4627"
+    }
+#---------SVC4628------------------------------  
+# %1 - csarUUID
+# %2 - VF name
+    VSP_ALREADY_EXISTS: {
+        code: 400,
+        message: "Error: The VSP with UUID %1 was already imported for VF %2. Please select another or update the existing VF.",
+        messageId: "SVC4628"
+    }
+#---------SVC4629------------------------------  
+# %1 - VF name
+    MISSING_CSAR_UUID: {
+        code: 400,
+        message: "Error: The Csar UUID or payload name is missing for VF %1.",
+        messageId: "SVC4629"
+    }
+#---------SVC4630------------------------------  
+# %1 - VF name
+# %2 - new csarUUID
+# %3 - old csarUUID
+    RESOURCE_LINKED_TO_DIFFERENT_VSP: {
+        code: 400,
+        message: "Error: Resource %1 cannot be updated using CsarUUID %2 since the resource is linked to a different VSP with csarUUID %3.",
+        messageId: "SVC4630"
+    }
+#---------SVC4631------------------------------ 
+# %1  - policy name 
+    POLICY_TYPE_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Policy type %1 already exists.",
+        messageId: "SVC4631"
+    }
+#---------SVC4632------------------------------
+# %1 - target name
+# %2 - policy type name
+    TARGETS_NON_VALID: {
+        code: 400,
+        message: "Error: target %1 listed in policy type %2 is not a group or resource.",
+        messageId: "SVC4632"
+    }
+#---------SVC4633------------------------------
+# %1 - policy name
+    TARGETS_EMPTY: {
+        code: 400,
+        message: "Error: Invalid Content. Policy %1 target list was provided but does not have values",
+        messageId: "SVC4633"
+    }
+#---------SVC4634------------------------------
+    DATA_TYPE_CANNOT_BE_EMPTY: {
+        code: 500,
+        message: "Error: Data types are empty. Please import the data types.",
+        messageId: "SVC4634"
+    }
+#---------SVC4635------------------------------
+# %1 - csar uuid
+    RESOURCE_FROM_CSAR_NOT_FOUND: {
+        code: 400,
+        message: "Error: resource from csar uuid %1 not found",
+        messageId: "SVC4635"
+    }
+#---------SVC4636------------------------------
+# %1 - Data type name
+    DATA_TYPE_CANNOT_BE_UPDATED_BAD_REQUEST: {
+        code: 400,
+        message: 'Error: Data type %1 cannot be upgraded. The new data type does not contain old properties or the type of one of the properties has been changed.',
+        messageId: "SVC4636"
+    }
+#-----------SVC4637---------------------------
+#%1 - attribute name
+    ATTRIBUTE_NOT_FOUND: {
+        code: 404,
+        message: "Error: Requested '%1' attribute was not found.",
+        messageId: "SVC4637"
+    }    
+#-----------SVC4638---------------------------
+#%1 - attribute name
+    ATTRIBUTE_ALREADY_EXIST: {
+        code: 409,
+        message: "Error: Attribute with '%1' name already exists.",
+        messageId: "SVC4638"
+    }
+#-----------SVC4639---------------------------
+#%1 - property name
+    PROPERTY_NAME_ALREADY_EXISTS: {
+        code: 409,
+        message: "Error: Property with '%1' name and different type already exists.",
+        messageId: "SVC4639"
+    }
+#-----------SVC4640---------------------------
+#%1 - property name
+    INVALID_PROPERTY: {
+        code: 409,
+        message: "Error: Invalid property received.",
+        messageId: "SVC4640"
+    }
+#---------SVC4641-----------------------------
+#%1 - invalid filter
+#%2 - valid filters
+    INVALID_FILTER_KEY: {
+        code: 400,
+        message: "Error: The filter %1 is not applicable. Please use one of the following filters: %2",
+        messageId: "SVC4641"
+    }
+#---------SVC4642-----------------------------
+#%1 - asset type
+#%2 - filter
+    NO_ASSETS_FOUND: {
+        code: 404,
+        message: "No %1 were found to match criteria %2",
+        messageId: "SVC4642"
+    }
+#---------SVC4643------------------------------
+# %1 - "Resource"/"Product"
+# %2 - "sub-category name"
+# %3 - "category name"
+    COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY: {
+        code: 404,
+        message: "Error: %1 sub-category '%2' not found under category '%3'.",
+        messageId: "SVC4643"
+    }
+#---------SVC4644------------------------------
+# %1 - Format
+    CORRUPTED_FORMAT: {
+        code: 400,
+        message: "Error: %1 format is corrupted.",
+        messageId: "SVC4644"
+    }
+#---------SVC4645------------------------------
+# %1 - "groupType"
+    INVALID_VF_MODULE_TYPE: {
+        code: 400,
+        message: "Error: Invalid group type '%1' (should be VfModule).",
+        messageId: "SVC4645"
+    }
+#---------SVC4646------------------------------
+# %1 - "groupName"
+    INVALID_VF_MODULE_NAME: {
+        code: 400,
+        message: "Error: Invalid Content. VF Module name '%1' contains invalid characters",
+        messageId: "SVC4646"
+    }
+    
+#---------SVC4647------------------------------
+# %1 - "modifiedName"
+    INVALID_VF_MODULE_NAME_MODIFICATION: {
+        code: 400,
+        message: "Error: Invalid VF Module name modification, can not modify '%1'",
+        messageId: "SVC4647"
+    }
+#---------SVC4648------------------------------
+# %1 - "inputId"
+# %2 - "componentId"
+    INPUT_IS_NOT_CHILD_OF_COMPONENT: {
+        code: 400,
+        message: "Error: Input id: '%1' is not child of component id: '%2'",
+        messageId: "SVC4648"
+    }
+#---------SVC4649------------------------------
+# %1 - "groupName"
+    GROUP_HAS_CYCLIC_DEPENDENCY: {
+        code: 400,
+        message: "Error: The group '%1' has cyclic dependency",
+        messageId: "SVC4649"
+    }
+#---------SVC4650------------------------------
+# %1 - "Component Type"
+# %2 - <ServiceName>
+# %3 - error description
+    AAI_ARTIFACT_GENERATION_FAILED: {
+        code: 500,
+        message: "Error: %1 %2 automatic generation of artifacts failed. Description: %3",
+        messageId: "SVC4650"
+    }
+#---------SVC4651------------------------------
+    PARENT_RESOURCE_DOES_NOT_EXTEND: {
+        code: 400,
+        message: "Error: Once resource is certified, derived_from can be changed only to a sibling",
+        messageId: "SVC4651"
+    }
+#---------SVC4652------------------------------  
+# %1 - resource/service
+    COMPONENT_INVALID_SUBCATEGORY: {
+        code: 400,
+        message: "Error: Invalid Content. Invalid %1 sub category.",
+        messageId: "SVC4652"
+    }
+#---------SVC4653------------------------------  
+# %1 - group instance uniqueId     
+# %2 - service uniqueId
+    GROUP_INSTANCE_NOT_FOUND_ON_COMPONENT_INSTANCE: {
+        code: 404,
+        message: "Error: Requested group instance %1 was not found on component %2.",
+        messageId: "SVC4653"
+    }
+#---------SVC4654------------------------------  
+# %1 - group property name     
+# %2 - valid min limit value
+# %3 - valid max limit value
+    INVALID_GROUP_MIN_MAX_INSTANCES_PROPERTY_VALUE: {
+        code: 400,
+        message: "Error: Value of %1 must be not higher than %2, and not lower than %3.",
+        messageId: "SVC4654"
+    }
+#---------SVC4655------------------------------  
+# %1 - group property name     
+# %2 - valid min limit value
+# %3 - valid max limit value
+    INVALID_GROUP_INITIAL_COUNT_PROPERTY_VALUE: {
+        code: 400,
+        message: "Error: Value of %1 must be between %2 and %3.",
+        messageId: "SVC4655"
+    }
+#---------SVC4656------------------------------  
+# %1 - group property name     
+# %2 - lower/higher
+# %3 - valid max/min value
+    INVALID_GROUP_PROPERTY_VALUE_LOWER_HIGHER: {
+        code: 400,
+        message: "Error: Value of %1 must be %2 or equals to %3.",
+        messageId: "SVC4656"
+    }    
+#---------SVC4657------------------------------
+# %1 - certificationRequest / startTesting
+    RESOURCE_VFCMT_LIFECYCLE_STATE_NOT_VALID: {
+        code: 400,
+        message: "Error - Lifecycle state %1 is not valid for resource of type VFCMT",
+        messageId: "SVC4657"
+    }
+#---------SVC4658------------------------------
+# %1 – asset type [service / resource ]
+# %2 – main asset uuid
+# %3 – not found asset type [service / resource]
+# %4 – not found asset name 
+    ASSET_NOT_FOUND_DURING_CSAR_CREATION: {
+        code: 400,
+        message: "Error: CSAR packaging failed for %1 %2. %3 %4 was not found",
+        messageId: "SVC4658"
+    }
+#---------SVC4659------------------------------
+# %1 – asset type [service / resource ]
+# %2 – main asset uuid
+# %3 – Artifact name 
+# %4 – Artifact uuid
+    ARTIFACT_PAYLOAD_NOT_FOUND_DURING_CSAR_CREATION: {
+        code: 400,
+        message: " Error: CSAR packaging failed for %1 %2. Artifact %3 [%4] was not found",
+        messageId: "SVC4659"
+    }
+#---------SVC4660------------------------------
+# %1 - assetType
+# %2 - matching generic node type name
+    GENERIC_TYPE_NOT_FOUND: {
+        code: 404,
+        message: "Creation of %1 failed. Generic type %2 was not found",
+        messageId: "SVC4660"
+    }
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml b/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml
new file mode 100644
index 0000000..120f33d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml
@@ -0,0 +1,23 @@
+services:
+    Mobility:
+      name: "Mobility1"
+      icons: ['mobility']
+    Network_L1_3:
+      name: "Network L1-31"
+      icons: ['network_l_1-3']
+resources:
+  NetworkLayer23:
+    name: "Network Layer 2-31"
+    subcategories: 
+      Router:
+          name: "Router"
+          icons: ['router']
+      Gateway:
+          name: "Gateway"
+          icons: ['gateway']
+      WAN_Connectors:
+          name: "WAN Connectors"
+          icons: ['connector']
+      LAN_Connectors:
+          name: "LAN Connectors"
+          icons: ['connector']
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zip b/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zip
new file mode 100644
index 0000000..68b7aa9
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zip
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml
new file mode 100644
index 0000000..484ed4d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml
@@ -0,0 +1,13 @@
+org.openecomp.groups.MyHeatStack1:
+  derived_from: tosca.groups.Root
+  description: Grouped all heat resources which are in the same heat stack
+  properties:
+    heat_files:
+      type: list
+      description: Heat files which associate to this group/heat stack
+      required: true
+      status: SUPPORTED
+      entry_schema:
+        type: string
+    url_credential:
+      type: tosca.datatypes.Credential
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zip b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zip
new file mode 100644
index 0000000..2619853
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zip
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml
new file mode 100644
index 0000000..94fbb04
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml
@@ -0,0 +1,14 @@
+org.openecomp.groups.MyHeatStack2:
+  derived_from: tosca.groups.Root
+  description: Grouped all heat resources which are in the same heat stack
+  members: [ tosca.nodes.Compute ]
+  properties:
+    heat_files:
+      type: list
+      description: Heat files which associate to this group/heat stack
+      required: true
+      status: SUPPORTED
+      entry_schema:
+        type: string
+    url_credential:
+      type: tosca.datatypes.Credential
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zip b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zip
new file mode 100644
index 0000000..7f43af7
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zip
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/other/mapping.json b/test-apis-ci/src/test/resources/CI/other/mapping.json
new file mode 100644
index 0000000..3310d77
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/other/mapping.json
@@ -0,0 +1,182 @@
+{ "order": 1, "template": "auditingevents-*", "settings": {}, "mappings":
+{ 
+"distributiondownloadevent":
+        { "properties": { 
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "RESOURCE_URL": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }}, 
+          "_all": { "enabled": true } },
+   "auditinggetuebclusterevent": 
+        { "properties": { 
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }}, 
+          "_all": { "enabled": true } },
+  "distributionstatusevent": 
+        { "properties": { 
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "RESOURCE_URL": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "TOPIC_NAME":{ "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }}, 
+          "_all": { "enabled": true } },
+"distributionengineevent": 
+        { "properties": { 
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "TOPIC_NAME":{ "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "ROLE": { "include_in_all": true, "type": "string" }, 
+          "API_KEY": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+            "D_ENV": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }}, 
+          "_all": { "enabled": true } },
+  "useraccessevent": { 
+                "properties": { 
+                  "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+              "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+              "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+              "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+              "DESC": { "include_in_all": true, "type": "string" }, 
+              "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+                  "USER": { "include_in_all": true, "type": "string" }}, 
+                  "_all": { "enabled": true }}, 
+"resourceadminevent": 
+              { "properties": { 
+         "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
+         "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+        "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "CURR_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "CURR_STATE": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "MODIFIER": { "include_in_all": true, "type": "string" }, 
+        "PREV_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "PREV_STATE": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "RESOURCE_NAME": { "include_in_all": true, "type": "string" }, 
+        "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+        "DPREV_STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+        "DCURR_STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "TOSCA_NODE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "COMMENT": { "include_in_all": true, "type": "string" }, 
+        "ARTIFACT_DATA": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "PREV_ARTIFACT_UUID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+        "CURR_ARTIFACT_UUID": { "include_in_all": true, "index": "not_analyzed", "type": "string" } }, 
+        "_all": { "enabled": true }} , 
+"useradminevent": 
+        { "properties": { 
+           "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+           "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+           "DESC": { "include_in_all": true, "type": "string" }, 
+           "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "USER_AFTER": { "include_in_all": true, "type": "string" }, 
+          "USER_BEFORE": { "include_in_all": true, "type": "string" }, 
+          "MODIFIER": { "include_in_all": true, "type": "string" }},
+          "_all": { "enabled": true } },
+"distributionnotificationevent":
+                 {"properties":{
+                   "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+                  "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+                  "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+                  "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+                  "DESC": { "include_in_all": true, "type": "string" }, 
+                  "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+                  "CURR_STATE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+                  "CURR_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+                  "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+                  "MODIFIER": { "include_in_all": true, "type": "string" },
+                  "RESOURCE_NAME": { "include_in_all": true, "type": "string" }, 
+                  "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+                  "TOPIC_NAME":{ "include_in_all": true, "index": "not_analyzed", "type": "string" }}, 
+                   "_all": { "enabled": true } },
+ "categoryevent":          
+          {            "properties":{
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "MODIFIER": { "include_in_all": true, "type": "string" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "CATEGORY_NAME": { "include_in_all": true, "type": "string" }, 
+          "SUB_CATEGORY_NAME": { "include_in_all": true, "type": "string" }, 
+          "GROUPING_NAME": { "include_in_all": true, "type": "string" }, 
+          "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }}, 
+             "_all": { "enabled": true } },
+ "authevent": { 
+        "properties": { 
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "URL": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "USER": { "include_in_all": true, "type": "string" }, 
+          "AUTH_STATUS": { "include_in_all": true, "index": "not_analyzed","type": "string" } , 
+          "REALM": { "include_in_all": true, "index": "not_analyzed","type": "string" }} ,             
+          "_all": { "enabled": true }}, 
+ "consumerevent":          
+          {            "properties":{
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "MODIFIER": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "ECOMP_USER": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }}, 
+             "_all": { "enabled": true } },
+  "getuserslistevent":          
+          {            "properties":{
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "MODIFIER": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DETAILS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }}, 
+             "_all": { "enabled": true } },    
+ "getcategoryhierarchyevent":
+          {            "properties":{
+          "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "MODIFIER": { "include_in_all": true, "type": "string" }, 
+          "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DESC": { "include_in_all": true, "type": "string" }, 
+          "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+          "DETAILS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
+          "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }}, 
+             "_all": { "enabled": true } },
+ "distributiondeployevent": 
+          {        "properties": {          
+            "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+            "CURR_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },    
+            "DESC": { "include_in_all": true, "type": "string" },         
+            "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+            "MODIFIER": { "include_in_all": true, "type": "string" },         
+            "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }, 
+            "RESOURCE_NAME": { "include_in_all": true, "type": "string" },         
+            "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+            "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },  
+            "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },    
+            "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }},
+            "_all": { "enabled": true } }}, 
+            "aliases": { "last_3_months": {}}}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml
new file mode 100644
index 0000000..0415385
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<data>
+  <sports>
+    <person>
+      <name>Lionel Andres Messi</name>
+      <birthday>1987-06-24T00:00:00-00:00</birthday>
+    </person>
+    <person>
+      <name>Cristiano Ronaldo</name>
+      <birthday>1985-02-05T00:00:00-00:00</birthday>
+    </person>
+    <team>
+      <name>FC Barcelona</name>
+      <player>
+        <name>Lionel Andres Messi</name>
+        <season>Champions League 2014-2015</season>
+        <number>10</number>
+        <scores>43</scores>
+      </player>
+    </team>
+    <team>
+      <name>Real Madrid</name>
+      <player>
+        <name>Cristiano Ronaldo</name>
+        <season>Champions League 2014-2015</season>
+        <number>7</number>
+        <scores>48</scores>
+      </player>
+    </team>
+  </sports>
+
+</data>
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml
new file mode 100644
index 0000000..6835485
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml
@@ -0,0 +1,787 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+  vnf_id:
+    type: string
+    description: Unique ID for this VNF instance
+    default: This_is_ths_SCP_id
+
+  flavor_scp_be_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_scp_fe_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_smp_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_db_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  image_scp_be_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_be
+  image_scp_fe_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_fe    
+  image_smp_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_smp
+  image_db_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_db
+
+  int_vscp_fe_cluster_net_id:
+    type: string
+    description: LAN2 FE Cluster/KA
+  int_vscp_fe_cluster_cidr:
+    type: string
+    description: Private Network2 Address (CIDR notation)
+  int_vscp_cluster_net_id:
+    type: string
+    description: LAN3 Cluster
+  int_vscp_cluster_cidr:
+    type: string
+    description: Private Network3 Address (CIDR notation)
+  int_vscp_db_network_net_id:
+    type: string
+    description: LAN4 DB
+  int_vscp_db_network_cidr:
+    type: string
+    description: Private Network4 Address (CIDR notation)
+  SIGNET_vrf_A1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_A
+  SIGNET_vrf_B1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_B
+  Cricket_OCS_protected_net_id:
+    type: string
+    description: Network name for CRICKET_OCS
+  OAM_direct_net_id:
+    type: string
+    description: Network name for OAM
+  be0_Cricket_OCS_protected_ips:
+    type: string
+    label: be0 port 5 OAM ip address
+    description: be0 port 5 OAM ip address
+  be1_Cricket_OCS_protected_ips:
+    type: string
+    label: be1 port 5 OAM ip address
+    description: be1 port 5 OAM ip address
+  be2_Cricket_OCS_protected_ips:
+    type: string
+    label: be2 port 5 OAM ip address
+    description: be2 port 5 OAM ip address
+  be3_Cricket_OCS_protected_ips:
+    type: string
+    label: be3 port 5 OAM ip address
+    description: be3 port 5 OAM ip address
+  be4_Cricket_OCS_protected_ips:
+    type: string
+    label: be4 port 5 OAM ip address
+    description: be4 port 5 OAM ip address
+  be0_OAM_direct_ips:
+    type: string
+    label: be0 port 7 OAM ip address
+    description: be0 port 7 OAM ip address
+  be1_OAM_direct_ips:
+    type: string
+    label: be1 port 7 OAM ip address
+    description: be1 port 7 OAM ip address
+  be2_OAM_direct_ips:
+    type: string
+    label: be2 port 7 OAM ip address
+    description: be2 port 7 OAM ip address
+  be3_OAM_direct_ips:
+    type: string
+    label: be3 port 7 OAM ip address
+    description: be3 port 7 OAM ip address
+  be4_OAM_direct_ips:
+    type: string
+    label: be4 port 7 OAM ip address
+    description: be4 port 7 OAM ip address
+  fe0_SIGNET_vrf_A1_direct_ips:
+    type: string
+    label: fe0 port 0 SIGTRAN ip address
+    description: fe0 port 0 SIGTRAN ip address
+  fe0_OAM_direct_ips:
+    type: string
+    label: fe0 port 7 OAM ip address
+    description: fe0 port 7 OAM ip address
+  fe1_SIGNET_vrf_B1_direct_ips:
+    type: string
+    label: fe1 port 1 SIGTRAN ip address
+    description: fe1 port 1 SIGTRAN ip address
+  fe1_OAM_direct_ips:
+    type: string
+    label: fe1 port 7 OAM ip address
+    description: fe1 port 7 OAM ip address
+  smp0_OAM_direct_ips:
+    type: string
+    label: smp0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  smp1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: smp1 port 7 OAM ip address
+  db0_OAM_direct_ips:
+    type: string
+    label: db0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  db1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: db1 port 7 OAM ip address
+  vm_scp_be0_name:
+    type: string
+    default: vSCP_BE0
+    description: name of VM
+  vm_scp_be1_name:
+    type: string
+    default: vSCP_BE1
+    description: name of VM    
+  vm_scp_be2_name:
+    type: string
+    default: vSCP_BE2
+    description: name of VM
+  vm_scp_be3_name:
+    type: string
+    default: vSCP_BE3
+    description: name of VM
+  vm_scp_be4_name:
+    type: string
+    default: vSCP_BE4
+    description: name of VM
+  vm_scp_fe0_name:
+    type: string
+    default: vSCP_FE0
+    description: name of VM
+  vm_scp_fe1_name:
+    type: string
+    default: vSCP_FE1
+    description: name of VM
+  vm_smp0_name:
+    type: string
+    default: vSMP0
+    description: name of VM
+  vm_smp1_name:
+    type: string
+    default: vSMP1
+    description: name of VM
+  vm_db0_name:
+    type: string
+    default: vDB0
+    description: name of VM
+  vm_db1_name:
+    type: string
+    default: vDB1
+    description: name of VM
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zip b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zip
new file mode 100644
index 0000000..c8a2726
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zip
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml
new file mode 100644
index 0000000..6835485
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml
@@ -0,0 +1,787 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+  vnf_id:
+    type: string
+    description: Unique ID for this VNF instance
+    default: This_is_ths_SCP_id
+
+  flavor_scp_be_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_scp_fe_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_smp_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_db_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  image_scp_be_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_be
+  image_scp_fe_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_fe    
+  image_smp_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_smp
+  image_db_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_db
+
+  int_vscp_fe_cluster_net_id:
+    type: string
+    description: LAN2 FE Cluster/KA
+  int_vscp_fe_cluster_cidr:
+    type: string
+    description: Private Network2 Address (CIDR notation)
+  int_vscp_cluster_net_id:
+    type: string
+    description: LAN3 Cluster
+  int_vscp_cluster_cidr:
+    type: string
+    description: Private Network3 Address (CIDR notation)
+  int_vscp_db_network_net_id:
+    type: string
+    description: LAN4 DB
+  int_vscp_db_network_cidr:
+    type: string
+    description: Private Network4 Address (CIDR notation)
+  SIGNET_vrf_A1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_A
+  SIGNET_vrf_B1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_B
+  Cricket_OCS_protected_net_id:
+    type: string
+    description: Network name for CRICKET_OCS
+  OAM_direct_net_id:
+    type: string
+    description: Network name for OAM
+  be0_Cricket_OCS_protected_ips:
+    type: string
+    label: be0 port 5 OAM ip address
+    description: be0 port 5 OAM ip address
+  be1_Cricket_OCS_protected_ips:
+    type: string
+    label: be1 port 5 OAM ip address
+    description: be1 port 5 OAM ip address
+  be2_Cricket_OCS_protected_ips:
+    type: string
+    label: be2 port 5 OAM ip address
+    description: be2 port 5 OAM ip address
+  be3_Cricket_OCS_protected_ips:
+    type: string
+    label: be3 port 5 OAM ip address
+    description: be3 port 5 OAM ip address
+  be4_Cricket_OCS_protected_ips:
+    type: string
+    label: be4 port 5 OAM ip address
+    description: be4 port 5 OAM ip address
+  be0_OAM_direct_ips:
+    type: string
+    label: be0 port 7 OAM ip address
+    description: be0 port 7 OAM ip address
+  be1_OAM_direct_ips:
+    type: string
+    label: be1 port 7 OAM ip address
+    description: be1 port 7 OAM ip address
+  be2_OAM_direct_ips:
+    type: string
+    label: be2 port 7 OAM ip address
+    description: be2 port 7 OAM ip address
+  be3_OAM_direct_ips:
+    type: string
+    label: be3 port 7 OAM ip address
+    description: be3 port 7 OAM ip address
+  be4_OAM_direct_ips:
+    type: string
+    label: be4 port 7 OAM ip address
+    description: be4 port 7 OAM ip address
+  fe0_SIGNET_vrf_A1_direct_ips:
+    type: string
+    label: fe0 port 0 SIGTRAN ip address
+    description: fe0 port 0 SIGTRAN ip address
+  fe0_OAM_direct_ips:
+    type: string
+    label: fe0 port 7 OAM ip address
+    description: fe0 port 7 OAM ip address
+  fe1_SIGNET_vrf_B1_direct_ips:
+    type: string
+    label: fe1 port 1 SIGTRAN ip address
+    description: fe1 port 1 SIGTRAN ip address
+  fe1_OAM_direct_ips:
+    type: string
+    label: fe1 port 7 OAM ip address
+    description: fe1 port 7 OAM ip address
+  smp0_OAM_direct_ips:
+    type: string
+    label: smp0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  smp1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: smp1 port 7 OAM ip address
+  db0_OAM_direct_ips:
+    type: string
+    label: db0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  db1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: db1 port 7 OAM ip address
+  vm_scp_be0_name:
+    type: string
+    default: vSCP_BE0
+    description: name of VM
+  vm_scp_be1_name:
+    type: string
+    default: vSCP_BE1
+    description: name of VM    
+  vm_scp_be2_name:
+    type: string
+    default: vSCP_BE2
+    description: name of VM
+  vm_scp_be3_name:
+    type: string
+    default: vSCP_BE3
+    description: name of VM
+  vm_scp_be4_name:
+    type: string
+    default: vSCP_BE4
+    description: name of VM
+  vm_scp_fe0_name:
+    type: string
+    default: vSCP_FE0
+    description: name of VM
+  vm_scp_fe1_name:
+    type: string
+    default: vSCP_FE1
+    description: name of VM
+  vm_smp0_name:
+    type: string
+    default: vSMP0
+    description: name of VM
+  vm_smp1_name:
+    type: string
+    default: vSMP1
+    description: name of VM
+  vm_db0_name:
+    type: string
+    default: vDB0
+    description: name of VM
+  vm_db1_name:
+    type: string
+    default: vDB1
+    description: name of VM
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env
new file mode 100644
index 0000000..6835485
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env
@@ -0,0 +1,787 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+  vnf_id:
+    type: string
+    description: Unique ID for this VNF instance
+    default: This_is_ths_SCP_id
+
+  flavor_scp_be_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_scp_fe_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_smp_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_db_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  image_scp_be_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_be
+  image_scp_fe_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_fe    
+  image_smp_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_smp
+  image_db_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_db
+
+  int_vscp_fe_cluster_net_id:
+    type: string
+    description: LAN2 FE Cluster/KA
+  int_vscp_fe_cluster_cidr:
+    type: string
+    description: Private Network2 Address (CIDR notation)
+  int_vscp_cluster_net_id:
+    type: string
+    description: LAN3 Cluster
+  int_vscp_cluster_cidr:
+    type: string
+    description: Private Network3 Address (CIDR notation)
+  int_vscp_db_network_net_id:
+    type: string
+    description: LAN4 DB
+  int_vscp_db_network_cidr:
+    type: string
+    description: Private Network4 Address (CIDR notation)
+  SIGNET_vrf_A1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_A
+  SIGNET_vrf_B1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_B
+  Cricket_OCS_protected_net_id:
+    type: string
+    description: Network name for CRICKET_OCS
+  OAM_direct_net_id:
+    type: string
+    description: Network name for OAM
+  be0_Cricket_OCS_protected_ips:
+    type: string
+    label: be0 port 5 OAM ip address
+    description: be0 port 5 OAM ip address
+  be1_Cricket_OCS_protected_ips:
+    type: string
+    label: be1 port 5 OAM ip address
+    description: be1 port 5 OAM ip address
+  be2_Cricket_OCS_protected_ips:
+    type: string
+    label: be2 port 5 OAM ip address
+    description: be2 port 5 OAM ip address
+  be3_Cricket_OCS_protected_ips:
+    type: string
+    label: be3 port 5 OAM ip address
+    description: be3 port 5 OAM ip address
+  be4_Cricket_OCS_protected_ips:
+    type: string
+    label: be4 port 5 OAM ip address
+    description: be4 port 5 OAM ip address
+  be0_OAM_direct_ips:
+    type: string
+    label: be0 port 7 OAM ip address
+    description: be0 port 7 OAM ip address
+  be1_OAM_direct_ips:
+    type: string
+    label: be1 port 7 OAM ip address
+    description: be1 port 7 OAM ip address
+  be2_OAM_direct_ips:
+    type: string
+    label: be2 port 7 OAM ip address
+    description: be2 port 7 OAM ip address
+  be3_OAM_direct_ips:
+    type: string
+    label: be3 port 7 OAM ip address
+    description: be3 port 7 OAM ip address
+  be4_OAM_direct_ips:
+    type: string
+    label: be4 port 7 OAM ip address
+    description: be4 port 7 OAM ip address
+  fe0_SIGNET_vrf_A1_direct_ips:
+    type: string
+    label: fe0 port 0 SIGTRAN ip address
+    description: fe0 port 0 SIGTRAN ip address
+  fe0_OAM_direct_ips:
+    type: string
+    label: fe0 port 7 OAM ip address
+    description: fe0 port 7 OAM ip address
+  fe1_SIGNET_vrf_B1_direct_ips:
+    type: string
+    label: fe1 port 1 SIGTRAN ip address
+    description: fe1 port 1 SIGTRAN ip address
+  fe1_OAM_direct_ips:
+    type: string
+    label: fe1 port 7 OAM ip address
+    description: fe1 port 7 OAM ip address
+  smp0_OAM_direct_ips:
+    type: string
+    label: smp0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  smp1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: smp1 port 7 OAM ip address
+  db0_OAM_direct_ips:
+    type: string
+    label: db0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  db1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: db1 port 7 OAM ip address
+  vm_scp_be0_name:
+    type: string
+    default: vSCP_BE0
+    description: name of VM
+  vm_scp_be1_name:
+    type: string
+    default: vSCP_BE1
+    description: name of VM    
+  vm_scp_be2_name:
+    type: string
+    default: vSCP_BE2
+    description: name of VM
+  vm_scp_be3_name:
+    type: string
+    default: vSCP_BE3
+    description: name of VM
+  vm_scp_be4_name:
+    type: string
+    default: vSCP_BE4
+    description: name of VM
+  vm_scp_fe0_name:
+    type: string
+    default: vSCP_FE0
+    description: name of VM
+  vm_scp_fe1_name:
+    type: string
+    default: vSCP_FE1
+    description: name of VM
+  vm_smp0_name:
+    type: string
+    default: vSMP0
+    description: name of VM
+  vm_smp1_name:
+    type: string
+    default: vSMP1
+    description: name of VM
+  vm_db0_name:
+    type: string
+    default: vDB0
+    description: name of VM
+  vm_db1_name:
+    type: string
+    default: vDB1
+    description: name of VM
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml
new file mode 100644
index 0000000..b70d5a4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml
@@ -0,0 +1,9 @@
+heat_template_version: 2013-05-23
+
+parameters:
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+ 
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml
new file mode 100644
index 0000000..a545569
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml
@@ -0,0 +1,13 @@
+heat_template_version: 2013-05-23
+
+parameters:
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+
+resources:
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json
new file mode 100644
index 0000000..48a3e89
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json
@@ -0,0 +1,11 @@
+{
+    "glossary": {
+        "title": "example glossary",
+		"GlossDiv": {
+            "title": "S",
+			"GlossList": {
+                "GlossEntry": {
+                    "ID": "SGML",
+					"SortAs": "SGML",
+					"GlossTerm": "Standard Generalized Markup Language",
+					"Acronym": "SGML",
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml
new file mode 100644
index 0000000..5c51039
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml
@@ -0,0 +1,787 @@
+	heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+  vnf_id:
+    type: string
+    description: Unique ID for this VNF instance
+    default: This_is_ths_SCP_id
+
+  flavor_scp_be_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_scp_fe_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_smp_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_db_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  image_scp_be_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_be
+  image_scp_fe_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_fe    
+  image_smp_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_smp
+  image_db_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_db
+
+  int_vscp_fe_cluster_net_id:
+    type: string
+    description: LAN2 FE Cluster/KA
+  int_vscp_fe_cluster_cidr:
+    type: string
+    description: Private Network2 Address (CIDR notation)
+  int_vscp_cluster_net_id:
+    type: string
+    description: LAN3 Cluster
+  int_vscp_cluster_cidr:
+    type: string
+    description: Private Network3 Address (CIDR notation)
+  int_vscp_db_network_net_id:
+    type: string
+    description: LAN4 DB
+  int_vscp_db_network_cidr:
+    type: string
+    description: Private Network4 Address (CIDR notation)
+  SIGNET_vrf_A1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_A
+  SIGNET_vrf_B1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_B
+  Cricket_OCS_protected_net_id:
+    type: string
+    description: Network name for CRICKET_OCS
+  OAM_direct_net_id:
+    type: string
+    description: Network name for OAM
+  be0_Cricket_OCS_protected_ips:
+    type: string
+    label: be0 port 5 OAM ip address
+    description: be0 port 5 OAM ip address
+  be1_Cricket_OCS_protected_ips:
+    type: string
+    label: be1 port 5 OAM ip address
+    description: be1 port 5 OAM ip address
+  be2_Cricket_OCS_protected_ips:
+    type: string
+    label: be2 port 5 OAM ip address
+    description: be2 port 5 OAM ip address
+  be3_Cricket_OCS_protected_ips:
+    type: string
+    label: be3 port 5 OAM ip address
+    description: be3 port 5 OAM ip address
+  be4_Cricket_OCS_protected_ips:
+    type: string
+    label: be4 port 5 OAM ip address
+    description: be4 port 5 OAM ip address
+  be0_OAM_direct_ips:
+    type: string
+    label: be0 port 7 OAM ip address
+    description: be0 port 7 OAM ip address
+  be1_OAM_direct_ips:
+    type: string
+    label: be1 port 7 OAM ip address
+    description: be1 port 7 OAM ip address
+  be2_OAM_direct_ips:
+    type: string
+    label: be2 port 7 OAM ip address
+    description: be2 port 7 OAM ip address
+  be3_OAM_direct_ips:
+    type: string
+    label: be3 port 7 OAM ip address
+    description: be3 port 7 OAM ip address
+  be4_OAM_direct_ips:
+    type: string
+    label: be4 port 7 OAM ip address
+    description: be4 port 7 OAM ip address
+  fe0_SIGNET_vrf_A1_direct_ips:
+    type: string
+    label: fe0 port 0 SIGTRAN ip address
+    description: fe0 port 0 SIGTRAN ip address
+  fe0_OAM_direct_ips:
+    type: string
+    label: fe0 port 7 OAM ip address
+    description: fe0 port 7 OAM ip address
+  fe1_SIGNET_vrf_B1_direct_ips:
+    type: string
+    label: fe1 port 1 SIGTRAN ip address
+    description: fe1 port 1 SIGTRAN ip address
+  fe1_OAM_direct_ips:
+    type: string
+    label: fe1 port 7 OAM ip address
+    description: fe1 port 7 OAM ip address
+  smp0_OAM_direct_ips:
+    type: string
+    label: smp0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  smp1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: smp1 port 7 OAM ip address
+  db0_OAM_direct_ips:
+    type: string
+    label: db0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  db1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: db1 port 7 OAM ip address
+  vm_scp_be0_name:
+    type: string
+    default: vSCP_BE0
+    description: name of VM
+  vm_scp_be1_name:
+    type: string
+    default: vSCP_BE1
+    description: name of VM    
+  vm_scp_be2_name:
+    type: string
+    default: vSCP_BE2
+    description: name of VM
+  vm_scp_be3_name:
+    type: string
+    default: vSCP_BE3
+    description: name of VM
+  vm_scp_be4_name:
+    type: string
+    default: vSCP_BE4
+    description: name of VM
+  vm_scp_fe0_name:
+    type: string
+    default: vSCP_FE0
+    description: name of VM
+  vm_scp_fe1_name:
+    type: string
+    default: vSCP_FE1
+    description: name of VM
+  vm_smp0_name:
+    type: string
+    default: vSMP0
+    description: name of VM
+  vm_smp1_name:
+    type: string
+    default: vSMP1
+    description: name of VM
+  vm_db0_name:
+    type: string
+    default: vDB0
+    description: name of VM
+  vm_db1_name:
+    type: string
+    default: vDB1
+    description: name of VM
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml
new file mode 100644
index 0000000..8978e0d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml
@@ -0,0 +1,35 @@
+<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+
+  <sports xmlns="http://example.com/example-sports">
+    <person>
+      <name>Lionel Andr�s Messi</name>
+      <birthday>1987-06-24T00:00:00-00:00</birthday>
+    </person>
+    <person>
+      <name>Cristiano Ronaldo</name>
+      <birthday>1985-02-05T00:00:00-00:00</birthday>
+    </person>
+    <team>
+      <name>FC Barcelona</name>
+      <player>
+        <name>Lionel Andr�s Messi</name>
+        <season>Champions League 2014/2015</season>
+        <number>10</number>
+        <scores>43</scores>
+      </player>
+    </team>
+    <team>
+      <name>Real Madrid</name>
+      <player>
+        <name>Cristiano Ronaldo</name>
+        <season>Champions League 2014/2015</season>
+        <number>7</number>
+        <scores>48</scores>
+      </player>
+    </team>
+  </sports>
+
+
+
+</data>
+</data>
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json
new file mode 100644
index 0000000..d5ca56d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json
@@ -0,0 +1,22 @@
+{
+    "glossary": {
+        "title": "example glossary",
+		"GlossDiv": {
+            "title": "S",
+			"GlossList": {
+                "GlossEntry": {
+                    "ID": "SGML",
+					"SortAs": "SGML",
+					"GlossTerm": "Standard Generalized Markup Language",
+					"Acronym": "SGML",
+					"Abbrev": "ISO 8879:1986",
+					"GlossDef": {
+                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
+						"GlossSeeAlso": ["GML", "XML"]
+                    },
+					"GlossSee": "markup"
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt
new file mode 100644
index 0000000..5f8f77c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt
@@ -0,0 +1,3 @@
+cmd1
+cmd2
+cmd3
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml
new file mode 100644
index 0000000..10c46b7
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml
@@ -0,0 +1,3 @@
+<test>
+	dfsfsdfsdf
+</test>
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docx b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docx
new file mode 100644
index 0000000..c281f53
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docx
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf
new file mode 100644
index 0000000..9c478f6
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf
@@ -0,0 +1,2 @@
+This is sample EMF file
+We currently not checking the file content.
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml
new file mode 100644
index 0000000..10c46b7
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml
@@ -0,0 +1,3 @@
+<test>
+	dfsfsdfsdf
+</test>
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml
new file mode 100644
index 0000000..10c46b7
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml
@@ -0,0 +1,3 @@
+<test>
+	dfsfsdfsdf
+</test>
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json
new file mode 100644
index 0000000..b749a9e
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json
@@ -0,0 +1,3 @@
+{
+    "test": "This is test"
+}
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml
new file mode 100644
index 0000000..10ccf71
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml
@@ -0,0 +1,5 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+node_types:
+  org.openecomp.resource.cp.CP:
+    derived_from: org.openecomp.resource.cp.root
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml b/test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml
new file mode 100644
index 0000000..6835485
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml
@@ -0,0 +1,787 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+  vnf_id:
+    type: string
+    description: Unique ID for this VNF instance
+    default: This_is_ths_SCP_id
+
+  flavor_scp_be_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_scp_fe_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_smp_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_db_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  image_scp_be_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_be
+  image_scp_fe_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_fe    
+  image_smp_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_smp
+  image_db_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_db
+
+  int_vscp_fe_cluster_net_id:
+    type: string
+    description: LAN2 FE Cluster/KA
+  int_vscp_fe_cluster_cidr:
+    type: string
+    description: Private Network2 Address (CIDR notation)
+  int_vscp_cluster_net_id:
+    type: string
+    description: LAN3 Cluster
+  int_vscp_cluster_cidr:
+    type: string
+    description: Private Network3 Address (CIDR notation)
+  int_vscp_db_network_net_id:
+    type: string
+    description: LAN4 DB
+  int_vscp_db_network_cidr:
+    type: string
+    description: Private Network4 Address (CIDR notation)
+  SIGNET_vrf_A1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_A
+  SIGNET_vrf_B1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_B
+  Cricket_OCS_protected_net_id:
+    type: string
+    description: Network name for CRICKET_OCS
+  OAM_direct_net_id:
+    type: string
+    description: Network name for OAM
+  be0_Cricket_OCS_protected_ips:
+    type: string
+    label: be0 port 5 OAM ip address
+    description: be0 port 5 OAM ip address
+  be1_Cricket_OCS_protected_ips:
+    type: string
+    label: be1 port 5 OAM ip address
+    description: be1 port 5 OAM ip address
+  be2_Cricket_OCS_protected_ips:
+    type: string
+    label: be2 port 5 OAM ip address
+    description: be2 port 5 OAM ip address
+  be3_Cricket_OCS_protected_ips:
+    type: string
+    label: be3 port 5 OAM ip address
+    description: be3 port 5 OAM ip address
+  be4_Cricket_OCS_protected_ips:
+    type: string
+    label: be4 port 5 OAM ip address
+    description: be4 port 5 OAM ip address
+  be0_OAM_direct_ips:
+    type: string
+    label: be0 port 7 OAM ip address
+    description: be0 port 7 OAM ip address
+  be1_OAM_direct_ips:
+    type: string
+    label: be1 port 7 OAM ip address
+    description: be1 port 7 OAM ip address
+  be2_OAM_direct_ips:
+    type: string
+    label: be2 port 7 OAM ip address
+    description: be2 port 7 OAM ip address
+  be3_OAM_direct_ips:
+    type: string
+    label: be3 port 7 OAM ip address
+    description: be3 port 7 OAM ip address
+  be4_OAM_direct_ips:
+    type: string
+    label: be4 port 7 OAM ip address
+    description: be4 port 7 OAM ip address
+  fe0_SIGNET_vrf_A1_direct_ips:
+    type: string
+    label: fe0 port 0 SIGTRAN ip address
+    description: fe0 port 0 SIGTRAN ip address
+  fe0_OAM_direct_ips:
+    type: string
+    label: fe0 port 7 OAM ip address
+    description: fe0 port 7 OAM ip address
+  fe1_SIGNET_vrf_B1_direct_ips:
+    type: string
+    label: fe1 port 1 SIGTRAN ip address
+    description: fe1 port 1 SIGTRAN ip address
+  fe1_OAM_direct_ips:
+    type: string
+    label: fe1 port 7 OAM ip address
+    description: fe1 port 7 OAM ip address
+  smp0_OAM_direct_ips:
+    type: string
+    label: smp0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  smp1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: smp1 port 7 OAM ip address
+  db0_OAM_direct_ips:
+    type: string
+    label: db0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  db1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: db1 port 7 OAM ip address
+  vm_scp_be0_name:
+    type: string
+    default: vSCP_BE0
+    description: name of VM
+  vm_scp_be1_name:
+    type: string
+    default: vSCP_BE1
+    description: name of VM    
+  vm_scp_be2_name:
+    type: string
+    default: vSCP_BE2
+    description: name of VM
+  vm_scp_be3_name:
+    type: string
+    default: vSCP_BE3
+    description: name of VM
+  vm_scp_be4_name:
+    type: string
+    default: vSCP_BE4
+    description: name of VM
+  vm_scp_fe0_name:
+    type: string
+    default: vSCP_FE0
+    description: name of VM
+  vm_scp_fe1_name:
+    type: string
+    default: vSCP_FE1
+    description: name of VM
+  vm_smp0_name:
+    type: string
+    default: vSMP0
+    description: name of VM
+  vm_smp1_name:
+    type: string
+    default: vSMP1
+    description: name of VM
+  vm_db0_name:
+    type: string
+    default: vDB0
+    description: name of VM
+  vm_db1_name:
+    type: string
+    default: vDB1
+    description: name of VM
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zip b/test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zip
new file mode 100644
index 0000000..0951d5c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zip
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml
new file mode 100644
index 0000000..f512f80
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getResourceArtifactFileContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getResourceArtifactFileContentTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml
new file mode 100644
index 0000000..180e247
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getResourceArtifactListNoContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getResourceArtifactListNoContentTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml
new file mode 100644
index 0000000..b8f9bbd
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-GetResourceArtifactListTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-GetResourceArtifactListTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml
new file mode 100644
index 0000000..72ff4f3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getResourceArtifactMetadataNoContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getResourceArtifactMetadataNoContentTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml
new file mode 100644
index 0000000..527e4a0
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getResourceArtifactMetadataTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getResourceArtifactMetadataTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml
new file mode 100644
index 0000000..7177a65
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getResourceArtifactPayloadNoContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getResourceArtifactPayloadNoContentTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml
new file mode 100644
index 0000000..e0a0c64
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListTest:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListTest:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml
new file mode 100644
index 0000000..dc5ff15
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListTest2:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest2
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListTest2:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListTest2:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt
new file mode 100644
index 0000000..cb3c3e8
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt
@@ -0,0 +1 @@
+{"id":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7","delegateId":"9c063349-2259-40fe-97f1-7c40e659e1b0","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListTest","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}},{"key":"Mysql-getServiceArtifactListTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}}]}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt
new file mode 100644
index 0000000..f0d0849
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"}
+
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml
new file mode 100644
index 0000000..4ee2c8c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListNoContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListNoContentTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListNoContentTest:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml
new file mode 100644
index 0000000..b564dd0
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListNoContentTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListNoContentTest2:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListNoContentTest2:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt
new file mode 100644
index 0000000..2793518
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt
@@ -0,0 +1 @@
+{"id":"3293c9c8-a162-43fc-b8d1-431399f89cb7","delegateId":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListNoContentTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListNoContentTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListNoContentTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":{"dependsOnMysql-getServiceArtifactListNoContentTest2":{"type":"tosca.relationships.DependsOn","target":"Mysql-getServiceArtifactListNoContentTest2","requirementName":"dependency","requirementType":"tosca.capabilities.Root","targetedCapabilityName":"root"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}}]}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt
new file mode 100644
index 0000000..3c342f6
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"}
+
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml
new file mode 100644
index 0000000..e0a0c64
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListTest:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListTest:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml
new file mode 100644
index 0000000..dc5ff15
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListTest2:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest2
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListTest2:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListTest2:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt
new file mode 100644
index 0000000..cb3c3e8
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt
@@ -0,0 +1 @@
+{"id":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7","delegateId":"9c063349-2259-40fe-97f1-7c40e659e1b0","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListTest","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}},{"key":"Mysql-getServiceArtifactListTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}}]}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt
new file mode 100644
index 0000000..f0d0849
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"}
+
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml
new file mode 100644
index 0000000..e0a0c64
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListTest:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListTest:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml
new file mode 100644
index 0000000..dc5ff15
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListTest2:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest2
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListTest2:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListTest2:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt
new file mode 100644
index 0000000..cb3c3e8
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt
@@ -0,0 +1 @@
+{"id":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7","delegateId":"9c063349-2259-40fe-97f1-7c40e659e1b0","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListTest","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}},{"key":"Mysql-getServiceArtifactListTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}}]}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt
new file mode 100644
index 0000000..f0d0849
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"}
+
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml
new file mode 100644
index 0000000..4ee2c8c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListNoContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListNoContentTest:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListNoContentTest:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml
new file mode 100644
index 0000000..b564dd0
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListNoContentTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-getServiceArtifactListNoContentTest2:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript-getServiceArtifactListNoContentTest2:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt
new file mode 100644
index 0000000..2793518
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt
@@ -0,0 +1 @@
+{"id":"3293c9c8-a162-43fc-b8d1-431399f89cb7","delegateId":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListNoContentTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListNoContentTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListNoContentTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":{"dependsOnMysql-getServiceArtifactListNoContentTest2":{"type":"tosca.relationships.DependsOn","target":"Mysql-getServiceArtifactListNoContentTest2","requirementName":"dependency","requirementType":"tosca.capabilities.Root","targetedCapabilityName":"root"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}}]}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt
new file mode 100644
index 0000000..3c342f6
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"}
+
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml
new file mode 100644
index 0000000..6aad589
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml
@@ -0,0 +1,603 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_missing_default:
+    type: string
+    description: Unique name for this VNF instance
+    label: be4 port 5 OAM ip address
+    
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml
new file mode 100644
index 0000000..d51a20d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml
@@ -0,0 +1,603 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_missing_desc:
+    type: string
+    default: This_is_the_SCP_name
+    label: be4 port 5 OAM ip address
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml
new file mode 100644
index 0000000..2952749
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml
@@ -0,0 +1,603 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_missing_desc:
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+    label: be4 port 5 OAM ip address
+    
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml
new file mode 100644
index 0000000..6835485
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml
@@ -0,0 +1,787 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+#  availability_zone_smp0:
+#    type: string
+#    default: nova
+#  availability_zone_smp1:
+#    type: string
+#    default: nova
+#  availability_zone_fe0:
+#    type: string
+#    default: nova
+#  availability_zone_fe1:
+#    type: string
+#    default: nova
+#  availability_zone_db0:
+#    type: string
+#    default: nova
+#  availability_zone_db1:
+#    type: string
+#    default: nova
+#  availability_zone_be0:
+#    type: string
+#    default: nova
+#  availability_zone_be1:
+#    type: string
+#    default: nova
+#  availability_zone_be2:
+#    type: string
+#    default: nova
+#  availability_zone_be3:
+#    type: string
+#    default: nova
+#  availability_zone_be4:
+#    type: string
+#    default: nova
+
+  vnf_name:
+    type: string
+    description: Unique name for this VNF instance
+    default: This_is_the_SCP_name
+  vnf_id:
+    type: string
+    description: Unique ID for this VNF instance
+    default: This_is_ths_SCP_id
+
+  flavor_scp_be_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_scp_fe_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_smp_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  flavor_db_id:
+    type: string
+    description: flavor type
+    default: a1.Small
+  image_scp_be_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_be
+  image_scp_fe_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_fe    
+  image_smp_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_smp
+  image_db_id:
+    type: string
+    description: Image use to boot a server
+    default: asc_base_image_db
+
+  int_vscp_fe_cluster_net_id:
+    type: string
+    description: LAN2 FE Cluster/KA
+  int_vscp_fe_cluster_cidr:
+    type: string
+    description: Private Network2 Address (CIDR notation)
+  int_vscp_cluster_net_id:
+    type: string
+    description: LAN3 Cluster
+  int_vscp_cluster_cidr:
+    type: string
+    description: Private Network3 Address (CIDR notation)
+  int_vscp_db_network_net_id:
+    type: string
+    description: LAN4 DB
+  int_vscp_db_network_cidr:
+    type: string
+    description: Private Network4 Address (CIDR notation)
+  SIGNET_vrf_A1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_A
+  SIGNET_vrf_B1_direct_net_id:
+    type: string
+    description: Network name for SIGTRAN_B
+  Cricket_OCS_protected_net_id:
+    type: string
+    description: Network name for CRICKET_OCS
+  OAM_direct_net_id:
+    type: string
+    description: Network name for OAM
+  be0_Cricket_OCS_protected_ips:
+    type: string
+    label: be0 port 5 OAM ip address
+    description: be0 port 5 OAM ip address
+  be1_Cricket_OCS_protected_ips:
+    type: string
+    label: be1 port 5 OAM ip address
+    description: be1 port 5 OAM ip address
+  be2_Cricket_OCS_protected_ips:
+    type: string
+    label: be2 port 5 OAM ip address
+    description: be2 port 5 OAM ip address
+  be3_Cricket_OCS_protected_ips:
+    type: string
+    label: be3 port 5 OAM ip address
+    description: be3 port 5 OAM ip address
+  be4_Cricket_OCS_protected_ips:
+    type: string
+    label: be4 port 5 OAM ip address
+    description: be4 port 5 OAM ip address
+  be0_OAM_direct_ips:
+    type: string
+    label: be0 port 7 OAM ip address
+    description: be0 port 7 OAM ip address
+  be1_OAM_direct_ips:
+    type: string
+    label: be1 port 7 OAM ip address
+    description: be1 port 7 OAM ip address
+  be2_OAM_direct_ips:
+    type: string
+    label: be2 port 7 OAM ip address
+    description: be2 port 7 OAM ip address
+  be3_OAM_direct_ips:
+    type: string
+    label: be3 port 7 OAM ip address
+    description: be3 port 7 OAM ip address
+  be4_OAM_direct_ips:
+    type: string
+    label: be4 port 7 OAM ip address
+    description: be4 port 7 OAM ip address
+  fe0_SIGNET_vrf_A1_direct_ips:
+    type: string
+    label: fe0 port 0 SIGTRAN ip address
+    description: fe0 port 0 SIGTRAN ip address
+  fe0_OAM_direct_ips:
+    type: string
+    label: fe0 port 7 OAM ip address
+    description: fe0 port 7 OAM ip address
+  fe1_SIGNET_vrf_B1_direct_ips:
+    type: string
+    label: fe1 port 1 SIGTRAN ip address
+    description: fe1 port 1 SIGTRAN ip address
+  fe1_OAM_direct_ips:
+    type: string
+    label: fe1 port 7 OAM ip address
+    description: fe1 port 7 OAM ip address
+  smp0_OAM_direct_ips:
+    type: string
+    label: smp0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  smp1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: smp1 port 7 OAM ip address
+  db0_OAM_direct_ips:
+    type: string
+    label: db0 port 7 OAM ip address
+    description: smp0 port 7 OAM ip address
+  db1_OAM_direct_ips:
+    type: string
+    label: smp1 port 7 OAM ip address
+    description: db1 port 7 OAM ip address
+  vm_scp_be0_name:
+    type: string
+    default: vSCP_BE0
+    description: name of VM
+  vm_scp_be1_name:
+    type: string
+    default: vSCP_BE1
+    description: name of VM    
+  vm_scp_be2_name:
+    type: string
+    default: vSCP_BE2
+    description: name of VM
+  vm_scp_be3_name:
+    type: string
+    default: vSCP_BE3
+    description: name of VM
+  vm_scp_be4_name:
+    type: string
+    default: vSCP_BE4
+    description: name of VM
+  vm_scp_fe0_name:
+    type: string
+    default: vSCP_FE0
+    description: name of VM
+  vm_scp_fe1_name:
+    type: string
+    default: vSCP_FE1
+    description: name of VM
+  vm_smp0_name:
+    type: string
+    default: vSMP0
+    description: name of VM
+  vm_smp1_name:
+    type: string
+    default: vSMP1
+    description: name of VM
+  vm_db0_name:
+    type: string
+    default: vDB0
+    description: name of VM
+  vm_db1_name:
+    type: string
+    default: vDB1
+    description: name of VM
+
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml b/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml
new file mode 100644
index 0000000..7d4a85c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml
@@ -0,0 +1,144 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: string
+    description: city name
+    default: Hulon
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+  private_building:
+    type: boolean
+    description: home_number
+    default: true
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml b/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml
new file mode 100644
index 0000000..2c404f0
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml
@@ -0,0 +1,469 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+parameters:
+  city_name:
+    type: string
+    description: city name
+    default: Hulon
+  address:
+    type: string
+    description: address
+    default: Narkis
+  home_number:
+    type: number
+    description: home_number
+    default: 14
+  private_building:
+    type: boolean
+    description: home_number
+    default: true
+resources:
+  be0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be0_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
+
+  be0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
+
+  server_scp_be1:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be1_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be1 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be1_port_3 }
+      - port: { get_resource: be1_port_4 }
+      - port: { get_resource: be1_port_5 }
+      - port: { get_resource: be1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be1_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be1_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
+
+  be1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
+
+  server_scp_be2:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be2_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be2 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be2_port_3 }
+      - port: { get_resource: be2_port_4 }
+      - port: { get_resource: be2_port_5 }
+      - port: { get_resource: be2_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be2_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be2_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be2_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be2_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
+
+  be2_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
+
+  server_scp_be3:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be3_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be3 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be3_port_3 }
+      - port: { get_resource: be3_port_4 }
+      - port: { get_resource: be3_port_5 }
+      - port: { get_resource: be3_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be3_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be3_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be3_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be3_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
+
+  be3_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
+
+  server_scp_be4:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be4_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be4 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be4_port_3 }
+      - port: { get_resource: be4_port_4 }
+      - port: { get_resource: be4_port_5 }
+      - port: { get_resource: be4_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be4_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
+
+  be4_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  be4_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  be4_port_5:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: Cricket_OCS_protected_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
+
+  be4_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
+
+  server_scp_fe0:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe0_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe0 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe0_port_0 }
+      - port: { get_resource: fe0_port_2 }
+      - port: { get_resource: fe0_port_3 }
+      - port: { get_resource: fe0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe0_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe0_port_0:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_A1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
+
+  fe0_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe0_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
+
+  server_scp_fe1:
+    type: OS::Nova::Server
+#    depends on: scp_be_wait_condition
+    properties:
+      name: { get_param: vm_scp_fe1_name }
+      image: { get_param: image_scp_fe_id }
+#      availability_zone: { get_param: availability_zone_fe1 }
+      flavor: { get_param: flavor_scp_fe_id }
+      scheduler_hints: { group: { get_resource: FE_Affinity } }
+      networks:
+      - port: { get_resource: fe1_port_1 }
+      - port: { get_resource: fe1_port_2 }
+      - port: { get_resource: fe1_port_3 }
+      - port: { get_resource: fe1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_fe1_name}
+#            wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
+
+  fe1_port_1:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: SIGNET_vrf_B1_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
+
+  fe1_port_2:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+
+  fe1_port_3:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: Clustering_Network }
+
+  fe1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
+
+  server_smp0:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp0_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp0 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp0_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
+
+  server_smp1:
+    type: OS::Nova::Server
+    properties:
+      name: { get_param: vm_smp1_name }
+      image: { get_param: image_smp_id }
+#      availability_zone: { get_param: availability_zone_smp1 }
+      flavor: { get_param: flavor_smp_id }
+      scheduler_hints: { group: { get_resource: SMP_Affinity } }
+      networks:
+      - port: { get_resource: smp1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_smp1_name}
+#            wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
+
+  smp1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
+
+  server_db0:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db0_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db0 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db0_port_4 }
+      - port: { get_resource: db0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db0_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db0_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db0_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
+
+  server_db1:
+    type: OS::Nova::Server
+#    depends_on: smp_wait_condition
+    properties:
+      name: { get_param: vm_db1_name }
+      image: { get_param: image_db_id }
+#      availability_zone: { get_param: availability_zone_db1 }
+      flavor: { get_param: flavor_db_id }
+      scheduler_hints: { group: { get_resource: DB_Affinity } }
+      networks:
+      - port: { get_resource: db1_port_4 }
+      - port: { get_resource: db1_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_db1_name}
+#            wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
+
+  db1_port_4:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_resource: DB_Network }
+
+  db1_port_7:
+    type: OS::Neutron::Port
+    properties:
+      network: { get_param: OAM_direct_net_id }
+      fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml b/test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml
new file mode 100644
index 0000000..7d4a85c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml
@@ -0,0 +1,144 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: string
+    description: city name
+    default: Hulon
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+  private_building:
+    type: boolean
+    description: home_number
+    default: true
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml
new file mode 100644
index 0000000..5117247
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+node_types:
+  org.openecomp.resource.cp:
+    derived_from: tosca.nodes.Root
+    properties:
+      type:
+        type: string
+        required: false
+    requirements: 
+     - VirtualBinding:
+          capability: tosca.capabilities.network.Bindable
+          relationship: tosca.relationships.network.BindsTo
+          occurrences: [0, UNBOUNDED]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml
new file mode 100644
index 0000000..8309df2
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml
@@ -0,0 +1,9 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+node_types:
+  org.openecomp.resource.cp.CP:
+    derived_from: tosca.nodes.Compute
+    properties:
+      type:
+        type: string
+        required: false
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml
new file mode 100644
index 0000000..478e742
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml
@@ -0,0 +1,9 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+node_types:
+  org.openecomp.resource.cp.CP:
+    derived_from: org.openecomp.resource.MyCompute1
+    properties:
+      type:
+        type: string
+        required: false
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml
new file mode 100644
index 0000000..807f7fe
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml
new file mode 100644
index 0000000..b9e6c4f
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      capaBility: 
+        type: tosca.capabilities.OperatingSystem
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml
new file mode 100644
index 0000000..230e4fa
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute2:
+    derived_from: org.openecomp.resource.MyCompute1
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      Capability: 
+        type: tosca.capabilities.OperatingSystem
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml
new file mode 100644
index 0000000..0d097a8
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - requirEment: 
+          capability: tosca.capabilities.Endpoint
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml
new file mode 100644
index 0000000..9cc1f27
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute2:
+    derived_from: org.openecomp.resource.MyCompute1
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - Requirement: 
+          capability: tosca.capabilities.Endpoint
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml
new file mode 100644
index 0000000..3514acf
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+node_types:
+  org.openecomp.resource.cp.LAN:
+    derived_from: org.openecomp.resource.cp.CP
+    properties:
+      type:
+        type: string
+        required: false
+    requirements:
+      - virtualLink:
+          capability: tosca.capabilities.network.Linkable
+          relationship: tosca.relationships.network.LinksTo
+          occurrences: [0, UNBOUNDED]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml
new file mode 100644
index 0000000..7fbf4ec
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml
@@ -0,0 +1,27 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyChildWebApplication:
+    derived_from: tosca.nodes.WebApplication
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - diff: 
+          capability: 
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      deff: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml
new file mode 100644
index 0000000..fe79bb3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml
@@ -0,0 +1,26 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyAsset:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - test: 
+          capability: tosca.capabilities.Scalable
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml
new file mode 100644
index 0000000..798cd5b
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - DependencY: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      FeaTurE: 
+        type: tosca.capabilities.OperatingSystem
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml
new file mode 100644
index 0000000..c72d0ee
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml
@@ -0,0 +1,22 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute2:
+    derived_from: org.openecomp.resource.MyCompute1
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - diff: 
+          capability: tosca.capabilities.Container
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml
new file mode 100644
index 0000000..7132ca4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml
@@ -0,0 +1,25 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute3:
+    derived_from: org.openecomp.resource.MyCompute1
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - diff: 
+          capability: tosca.capabilities.Container
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      deff: 
+        type: tosca.capabilities.Container
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml
new file mode 100644
index 0000000..e9438ba
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml
@@ -0,0 +1,32 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Compute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - test: 
+          capability: tosca.capabilities.Scalable
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml
new file mode 100644
index 0000000..039ab61
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml
@@ -0,0 +1,9 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+node_types:
+  org.openecomp.resource.cp.CP:
+    derived_from: tosca.nodes.Root
+    properties:
+      type:
+        type: string
+        required: false
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml
new file mode 100644
index 0000000..f20a9eb
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_boolean:
+          type: list
+          description : another description
+          default:
+            - false
+            - true
+          entry_schema:
+            description: This is my property
+            type: booolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml
new file mode 100644
index 0000000..f1af89c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - false
+            - truee
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml
new file mode 100644
index 0000000..974d96b
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - false
+            - 3
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml
new file mode 100644
index 0000000..52377e4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - false
+            - 3.56
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml
new file mode 100644
index 0000000..c66b434
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10000
+            - 3.56
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml
new file mode 100644
index 0000000..79b3c03
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10000
+            - aaaa
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml
new file mode 100644
index 0000000..5556e9d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10000
+            - true
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml
new file mode 100644
index 0000000..a3b21a6
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10.50
+            - true
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml
new file mode 100644
index 0000000..dc28591
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10.50
+            - asdc
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml
new file mode 100644
index 0000000..e465448
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10.50
+            - 500
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml
new file mode 100644
index 0000000..a428b51
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10.50
+            - 500.0@
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml
new file mode 100644
index 0000000..d840253
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10000
+            - 3#
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml
new file mode 100644
index 0000000..4eb5988
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - false
+            - true%
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml
new file mode 100644
index 0000000..ad263f3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml
@@ -0,0 +1,18 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - false
+            - falsee
+            - true
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml
new file mode 100644
index 0000000..93e8caa
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml
@@ -0,0 +1,19 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: list
+          description : another description
+          default:
+            - 10.5
+            - 10.6x
+            - 20.5
+            - 30.5
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml
new file mode 100644
index 0000000..ed8ea4d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_boolean:
+          type: koko
+          description : another description
+          default:
+            - false
+            - true
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml
new file mode 100644
index 0000000..c7ff074
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_boolean:
+          type: map
+          description : another description
+          default:
+            - false
+            - true
+          entry_schema:
+            description: This is my property
+            type: booolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml
new file mode 100644
index 0000000..d9abb87
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - false
+            - truee
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml
new file mode 100644
index 0000000..e8f9b6e
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - false
+            - 3
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml
new file mode 100644
index 0000000..d9dc4f9
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - false
+            - 3.56
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml
new file mode 100644
index 0000000..aba6ff1
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10000
+            - 3.56
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml
new file mode 100644
index 0000000..f27904d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10000
+            - aaaa
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml
new file mode 100644
index 0000000..ea123f3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10000
+            - true
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml
new file mode 100644
index 0000000..87b51fb
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10.50
+            - true
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml
new file mode 100644
index 0000000..2fc8ded
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10.50
+            - asdc
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml
new file mode 100644
index 0000000..3ab449d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10.50
+            - 500
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml
new file mode 100644
index 0000000..e437de8
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10.50
+            - 500.0@
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml
new file mode 100644
index 0000000..f2fbc7c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10000
+            - 3#
+          entry_schema:
+            description: This is my property
+            type: integer
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml
new file mode 100644
index 0000000..e375aae
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - false
+            - true%
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml
new file mode 100644
index 0000000..e087212
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml
@@ -0,0 +1,18 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - false
+            - falsee
+            - true
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml
new file mode 100644
index 0000000..3923ee1
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml
@@ -0,0 +1,19 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_property:
+          type: map
+          description : another description
+          default:
+            - 10.5
+            - 10.6x
+            - 20.5
+            - 30.5
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml
new file mode 100644
index 0000000..ed8ea4d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_boolean:
+          type: koko
+          description : another description
+          default:
+            - false
+            - true
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml
new file mode 100644
index 0000000..dfc564b
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyFatherCompute:
+    derived_from: tosca.nodes.Compute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml
new file mode 100644
index 0000000..533333e
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml
@@ -0,0 +1,26 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types:
+  org.openecomp.resource.MyCompute1:
+        derived_from: tosca.nodes.Compute
+        attributes:
+          private_address:
+            type: string
+          public_address:
+            type: string
+          networks:
+            type: map
+            entry_schema:
+              type: tosca.datatypes.network.NetworkInfo
+          ports:
+            type: map
+            entry_schema:
+              type: tosca.datatypes.network.PortInfo
+        capabilities:
+          host: 
+            type: tosca.capabilities.Container
+          endpoint :
+            type: tosca.capabilities.Endpoint.Admin 
+          OS: 
+            type: tosca.capabilities.OperatingSystem
+          BINDING:
+            type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml
new file mode 100644
index 0000000..9d8b2d8
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml
@@ -0,0 +1,23 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types:
+  org.openecomp.resource.MyCompute1:
+        derived_from: tosca.nodes.Compute
+        attributes:
+          private_address:
+            type: string
+          public_address:
+            type: string
+          networks:
+            type: map
+            entry_schema:
+              type: tosca.datatypes.network.NetworkInfo
+          ports:
+            type: map
+            entry_schema:
+              type: tosca.datatypes.network.PortInfo
+        requirements:
+          - LOCAL_STORAGE: 
+              capability: tosca.capabilities.Attachment
+              node: tosca.nodes.BlockStorage
+              relationship: tosca.relationships.AttachesTo
+              occurrences: [0, 1]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml
new file mode 100644
index 0000000..a5413e5
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml
@@ -0,0 +1,23 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types:
+  org.openecomp.resource.MyCompute2:
+        derived_from: org.openecomp.resource.MyCompute1
+        attributes:
+          private_address:
+            type: string
+          public_address:
+            type: string
+          networks:
+            type: map
+            entry_schema:
+              type: tosca.datatypes.network.NetworkInfo
+          ports:
+            type: map
+            entry_schema:
+              type: tosca.datatypes.network.PortInfo
+        requirements:
+          - LOCAL_STORAGE: 
+              capability: tosca.capabilities.Attachment
+              node: tosca.nodes.BlockStorage
+              relationship: tosca.relationships.AttachesTo
+              occurrences: [0, 2]
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml
new file mode 100644
index 0000000..9cea0b9
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vfc.vfc3:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        occurrences: [1, 1]
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml
new file mode 100644
index 0000000..24efc27
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vfc.vfc2:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, 1]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        occurrences: [1, UNBOUNDED]
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml
new file mode 100644
index 0000000..237bec1
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.DerivedFromMyCompute:
+    derived_from: org.openecomp.resource.MyCompute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml
new file mode 100644
index 0000000..0679bff
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml
@@ -0,0 +1,15 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyWebApp:
+    derived_from: tosca.nodes.WebApplication
+    properties:
+      context_root:
+        type: string
+    capabilities:
+      app_endpoint: 
+        type: tosca.capabilities.Endpoint.Admin #derived from WebApplication's tosca.capabilities.Endpoint "app_endpoint"
+    requirements:
+      - host: 
+          capability: tosca.capabilities.Container.Docker #derived from WebApplication's tosca.capabilities.Container "host"
+          node: tosca.nodes.WebServer
+          relationship: tosca.relationships.HostedOn
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml
new file mode 100644
index 0000000..0fa9a30
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml
@@ -0,0 +1,53 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyComputeTest:
+    derived_from: tosca.nodes.Root
+    properties:
+      myProp:
+        type: tosca.datatypes.Credential
+        descritpion: hey Desc
+        default: 
+          "protocol" : hey1
+          "token_type" : hey2
+          "token" : hey3
+          "keys" : {"keyA" : "val1" , keyB : val2}
+          "user" : hey4
+    attributes:
+      private_address:
+        type: string
+        status: supported
+        default: myDefault
+      public_address:
+        type: string
+      networks:
+        type: map
+        default: {keyA : val1 , keyB : val2}
+        entry_schema:
+          type: string
+      ports:
+        type: tosca.datatypes.Credential
+        description: this is my description
+        default:
+          "protocol" : hey1
+          "token_type" : hey2
+          "token" : hey3
+          "keys" : {"keyA" : "val1" , keyB : val2}
+          "user" : hey4
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml
new file mode 100644
index 0000000..4d6db6c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Compute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      Binding: #"binding" exists on parent
+        type: tosca.capabilities.OperatingSystem
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml
new file mode 100644
index 0000000..fcc3952
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml
@@ -0,0 +1,42 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+      - LOCAL_Storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      Scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml
new file mode 100644
index 0000000..7cab3ac
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml
@@ -0,0 +1,40 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+      - LOCAL_Storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml
new file mode 100644
index 0000000..a3ff088
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.TestResource:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_prop:
+          type: list
+          description : another description
+          default:
+            - 12
+            - true
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml
new file mode 100644
index 0000000..2f864a7
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_prop:
+          type: list
+          description : another description
+          default:
+            - false
+            - true
+          entry_schema:
+            description: This is my property
+            type: string
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml
new file mode 100644
index 0000000..fd52df5
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml
@@ -0,0 +1,198 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        my_boolean:
+          type: list
+          description : another description
+          default:
+            - false
+            - true
+          entry_schema:
+            description: This is my property
+            type: boolean
+        my_boolean_array:
+          type: list
+          description : another description
+          default: [ true , false ]
+          entry_schema:
+            description: This is my property
+            type: boolean
+        duplicate_boolean_values:
+          type: list
+          description : another description
+          default: [ true , false , true ]
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_null_value:
+          type: list
+          description : another description
+          default:
+            - true
+            -
+            - false
+          entry_schema:
+            description: This is my property
+            type: boolean
+        my_integers:
+          type: list
+          description : another description
+          default:
+            - 0
+            - 1000
+            - -1000
+            - 50
+          entry_schema:
+            description: This is my property
+            type: integer
+        my_integers_array:
+          type: list
+          description : another description
+          default: [ 10 , -1000, 0 ]
+          entry_schema:
+            description: This is my property
+            type: integer
+        duplicate_integers_values:
+          type: list
+          description : another description
+          default: [ 10 , 10, -1000, 0 ]
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_null_value:
+          type: list
+          description : another description
+          default:
+            - 1000
+            -
+            - 2000
+          entry_schema:
+            description: This is my property
+            type: integer
+        my_string:
+          type: list
+          description : another description
+          default:
+            - <b>asdc<b>
+            - $?^@ecomp$!#%()_-~@+*^...;;/w#
+            - uc
+          entry_schema:
+            description: This is my property
+            type: string
+        my_string_array:
+          type: list
+          description : another description
+          default: [  <b>AAA</b>, ~$~#bbb%^*_-, qwe , 1.3 , <b>500</b> , true ]
+          entry_schema:
+            description: This is my property
+            type: string
+        string_null_value:
+          type: list
+          description : another description
+          default:
+            - <b>asdc<b>
+            -
+            - uc
+          entry_schema:
+            description: This is my property
+            type: string
+        string_space_value:
+          type: list
+          description : another description
+          default:
+            - <b>  asdc<b>
+            -    
+            -     uc
+          entry_schema:
+            description: This is my property
+            type: string
+        duplicate_string_values:
+          type: list
+          description : another description
+          default:
+            - asdc
+            - asdc
+            - uc
+          entry_schema:
+            description: This is my property
+            type: string
+        my_float:
+          type: list
+          description : another description
+          default:
+            - 6
+            - 1000.000001
+            - -3.0f
+          entry_schema:
+            description: This is my property
+            type: float
+        my_float_array:
+          type: list
+          description : another description
+          default: [ 0.01 , -5.0 , 2.1f ]
+          entry_schema:
+            description: This is my property
+            type: float
+        duplicate_float_values:
+          type: list
+          description : another description
+          default:
+            - 0.0
+            - 0.0
+            - 4.555555
+          entry_schema:
+            description: This is my property
+            type: float
+        float_no_default_values:
+          type: list
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: float
+        float_null_value:
+          type: list
+          description : another description
+          default:
+            - 6
+            -
+            - -3.0f
+          entry_schema:
+            description: This is my property
+            type: float
+        float_space_value:
+          type: list
+          description : another description
+          default:
+            - 6
+            - 
+            - -3.0f
+          entry_schema:
+            description: This is my property
+            type: float
+        integer_no_default_values:
+          type: list
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: integer
+        string_no_default_values:
+          type: list
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: string
+        boolean_no_default_values:
+          type: list
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: boolean
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml
new file mode 100644
index 0000000..f856603
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml
@@ -0,0 +1,452 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.LinkTest:
+      derived_from: tosca.nodes.Root
+      properties:
+        string_prop01:
+          type: map
+          description : another description
+          default: {keyA : val1 , keyB : val2}
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop02:
+          type: map
+          description : another description
+          default: {keyA : "val1" , keyB : "val2"}
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop03:
+          type: map
+          description : another description
+          default: {"keyA" : "val1" , keyB : val2}
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop04:
+          type: map
+          description : another description
+          default: {"keyA" : 10 , keyB : <b>true</b> }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop05:
+          type: map
+          description : another description
+          default: {"keyA" :  , keyB : "Big" }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop06:
+          type: map
+          description : another description
+          default: {"keyA" : aaaA  , keyB : null }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop07:
+          type: map
+          description : another description
+          default: {"keyA" : NULL  , keyB : Null }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop08:
+          type: map
+          description : another description
+          default: {"keyA" : ""  , keyB : "abcd" }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop09:
+          type: map
+          description : another description
+          default: {"keyA" : "  "  , keyB : "abcd" }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop10:
+          type: map
+          description : another description
+          default: {"keyA" : "    aaaa"  , keyB : "    bbbb" }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop11:
+          type: map
+          description : another description
+          default: {"keyA" : "aaaa      "  , keyB : "bbbb     " }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop12:
+          type: map
+          description : another description
+          default: {"keyA" : "     aaaa      "  , keyB : "     bbbb    ccccc   " }
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop13:
+          type: map
+          description : another description
+          default:
+            keyA : "aaaa"
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop14:
+          type: map
+          description : another description
+          default:
+            keyA : "      aaaa        "
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop15:
+          type: map
+          description : another description
+          default:
+            keyA : AbcD
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop16:
+          type: map
+          description : another description
+          default:
+            keyA :         AbcD
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop17:
+          type: map
+          description : another description
+          default:
+            keyA :         AbcD      
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop18:
+          type: map
+          description : another description
+          default:
+            keyA : <b>AbcD</b>      
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop19:
+          type: map
+          description : another description
+          default:
+            keyA : <b>AbcD      
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop20:
+          type: map
+          description : another description
+          default:
+            keyA : aaaa
+            keya : aaaa
+            Keya : Aaaa
+            KEYA : nnnn
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop21:
+          type: map
+          description : another description
+          default:
+            keyA : NULL
+            keyB : null
+            keyC : Null
+          entry_schema:
+            description: This is my property
+            type: string
+        string_prop22:
+          type: map
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: string
+        integer_prop01:
+          type: map
+          description : another description
+          default: {keyA : 1 , keyB : 1000}
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop02:
+          type: map
+          description : another description
+          default: {keyA : Null , keyB : NULL ,keyC : null }
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop03:
+          type: map
+          description : another description
+          default: {keyA :  , keyB : -600}
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop03:
+          type: map
+          description : another description
+          default: {keyA :            800  , keyB :          -600}
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop04:
+          type: map
+          description : another description
+          default: {keyA :              , keyB :          -600}
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop05:
+          type: map
+          description : another description
+          default: {keyA : 100              , keyB : 0      }
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop06:
+          type: map
+          description : another description
+          default: {keyA : 100 , keyB : 00}
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop07:
+          type: map
+          description : another description
+          default: {keyA :   100    , keyB :    100        }
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop08:
+          type: map
+          description : another description
+          default:
+            keyA : 100
+            keyB : 200
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop09:
+          type: map
+          description : another description
+          default:
+            keyA :            100
+            keyB : 200           
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop10:
+          type: map
+          description : another description
+          default:
+            keyA : null
+            keyA : Null
+            keyB : 1111
+            keyB : 2222
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop11:
+          type: map
+          description : another description
+          default:
+            keyA : null
+            keyB : Null
+            keyC : NULL
+            keyD : 
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop12:
+          type: map
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: integer
+        integer_prop13:
+          type: map
+          description : another description
+          default: {keyA : 100 , keyA : 200}
+          entry_schema:
+            description: This is my property
+            type: integer
+        boolean_prop01:
+          type: map
+          description : another description
+          default: {keyA : true , keyB : false , keyC : false }
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop02:
+          type: map
+          description : another description
+          default: {keyA : TRUE , keyB : FALSE , keyC : False }
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop03:
+          type: map
+          description : another description
+          default:
+            keyA : null
+            keyB : Null
+            keyC : NULL
+            keyD : 
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop04:
+          type: map
+          description : another description
+          default: {keyA : Null , keyB : NULL ,keyC : null ,keyD : }
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop05:
+          type: map
+          description : another description
+          default: {keyA :      true , keyB : false     , keyC :     false       }
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop06:
+          type: map
+          description : another description
+          default:
+            keyA :     true
+            keyB : true
+            keyC :       false
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop07:
+          type: map
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop08:
+          type: map
+          description : another description
+          default:
+            keyA : false
+            keyA : true
+            keyB : true
+            keyB : false
+          entry_schema:
+            description: This is my property
+            type: boolean
+        boolean_prop09:
+          type: map
+          description : another description
+          default: {keyA : true,keyA : false,keyB : false,keyB : true}
+          entry_schema:
+            description: This is my property
+            type: boolean
+        float_prop01:
+          type: map
+          description : another description
+          default: {keyA : 1.20 , keyB : 3.56f , keyC : 33}
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop02:
+          type: map
+          description : another description
+          default: {keyA : 0.00, keyB : 0.0 , keyC : 0 }
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop03:
+          type: map
+          description : another description
+          default: {keyA : null, keyB : Null , keyC : NULL , keyD : }
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop04:
+          type: map
+          description : another description
+          default: {keyA :      1.20 , keyB : 3.56f       , keyC :      33        }
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop05:
+          type: map
+          description : another description
+          default:
+            keyA : 33
+            keyB : 1.2000
+            keyC : 3.607f
+            keyD : 0
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop06:
+          type: map
+          description : another description
+          default:
+            keyA :       33
+            keyB : 1.2000      
+            keyC :    3.607f 
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop07:
+          type: map
+          description : another description
+          default:
+            keyA : null
+            keyB : Null
+            keyC : NULL
+            keyD : 
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop08:
+          type: map
+          description : another description
+          default:
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop09:
+          type: map
+          description : another description
+          default:
+            keyA : 3.5
+            keyA : 0.01
+            keyB : 3.6
+            keyB : 
+          entry_schema:
+            description: This is my property
+            type: float
+        float_prop10:
+            type: map
+            description : another description
+            default: {keyA : 0.0002}
+            entry_schema:
+              description: This is my property
+              type: float
+        float_prop11:
+          type: map
+          description : another description
+          default: {keyA : 0.000 , keyA : 003.56f, keyB : 33}
+          entry_schema:
+            description: This is my property
+            type: float
+      capabilities:
+        link:
+          type: tosca.capabilities.network.Linkable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml
new file mode 100644
index 0000000..e4d626f
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Compute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - Local_Storage: 
+          capability: tosca.capabilities.Endpoint
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml
new file mode 100644
index 0000000..7ae9552
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute2:
+    derived_from: org.openecomp.resource.MyCompute1
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - Local_Storage: 
+          capability: tosca.capabilities.Endpoint
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml
new file mode 100644
index 0000000..301116c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml
@@ -0,0 +1,37 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+description: Template for vSCP -- connectable to OCS-FW -- temporary model for 1602 demo
+
+############################
+# The model capture four sub-components (VDUs) and their connectivity to six
+# networks. 
+############################
+
+node_types:
+
+#The node type for vSCP
+#used for substitution mapping, or to describe vSCP resource in ASDC studio
+  org.openecomp.resource.vSCP-03-16: 
+    derived_from: tosca.nodes.Root
+    requirements: 
+      - sigtran_connection1:
+          capability: tosca.capabilities.Node
+      - sigtran_connection2:
+          capability: tosca.capabilities.Node
+      - ocs_connection:
+          capability: tosca.capabilities.Node
+      - oam_connection: 
+          capability: tosca.capabilities.Node
+      - firewall:
+          capability: tosca.capabilities.Node
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: org.openecomp.capabilities.networkInterfaceNotFound
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml
new file mode 100644
index 0000000..d100daf
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml
@@ -0,0 +1,25 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+description: Template for vSCP -- connectable to OCS-FW -- temporary model for 1602 demo
+
+############################
+# The model capture four sub-components (VDUs) and their connectivity to six
+# networks. 
+############################
+
+node_types:
+
+#The node type for vSCP
+#used for substitution mapping, or to describe vSCP resource in ASDC studio
+  org.openecomp.resource.vSCP-03-16: 
+    derived_from: tosca.nodes.Root
+    requirements: 
+      - sigtran_connection1:
+          capability: org.openecomp.capabilities.networkInterfaceNotFound
+      - sigtran_connection2:
+          capability: tosca.capabilities.Node
+      - ocs_connection:
+          capability: tosca.capabilities.Node
+      - oam_connection: 
+          capability: tosca.capabilities.Node
+      - firewall:
+          capability: tosca.capabilities.Node
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml
new file mode 100644
index 0000000..cc5b202
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyChildCompute:
+    derived_from: org.openecomp.resource.MyFatherCompute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml
new file mode 100644
index 0000000..b7859d4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml
@@ -0,0 +1,15 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyChildWebApp:
+    derived_from: org.openecomp.resource.MyWebApp
+    properties:
+      context_root:
+        type: string
+    capabilities:
+      app_endpoint: 
+        type: tosca.capabilities.Endpoint
+    requirements:
+      - host: 
+          capability: tosca.capabilities.Container
+          node: tosca.nodes.WebServer
+          relationship: tosca.relationships.HostedOn
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml
new file mode 100644
index 0000000..98bf9b7
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml
new file mode 100644
index 0000000..2b28073
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.RootNotExists
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml
new file mode 100644
index 0000000..2fa3ad0
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: toscaSimpleYaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml
new file mode 100644
index 0000000..d1a613f
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource2.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml
new file mode 100644
index 0000000..8084d04
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml
@@ -0,0 +1,34 @@
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml
new file mode 100644
index 0000000..40ae610
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml
@@ -0,0 +1,77 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, UNBOUNDED]
+      - local_storage200: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, 1]
+      - local_storage300: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, 10]
+      - local_storage400: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, 10000000]
+      - local_storage500: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [2, 3]
+      - local_storageNoOccurrences600: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo         
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpointNoOccurrence :
+        type: tosca.capabilities.Endpoint.Admin 
+      endpoint200 :
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences: [1, 2]  
+      endpoint300 :
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences: [1, 1]  
+      endpoint400 :
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences: [1, 10]  
+      endpoint500 :
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences: [1, 10000000]  
+      endpoint600 :
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences: [1, UNBOUNDED  ]   
+      endpoint700 :
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences: [2, 4  ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml
new file mode 100644
index 0000000..b243add
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requiremens:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilitis:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml
new file mode 100644
index 0000000..43d92d1
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute1:
+    derived_from: tosca.nodes.Compute
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - Local_Storage: #"local_storage" exists on parent
+          capability: tosca.capabilities.Endpoint
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED] 
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml
new file mode 100644
index 0000000..90e771d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.VF.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml
new file mode 100644
index 0000000..73b201e
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml
@@ -0,0 +1,42 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
+  
+  org.openecomp.resource.example.TransactionSubsystem:
+    derived_from: tosca.nodes.Root
+    capabilities:
+      message_receiver: tosca.capabilities.Endpoint
+    requirements:
+      - database_endpoint: tosca.capabilities.Endpoint.Database
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml
new file mode 100644
index 0000000..c451eb2
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml
@@ -0,0 +1,44 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+  description: Template of an application connecting to a database.
+ 
+  node_templates:
+    web_app:
+      type: tosca.nodes.WebApplication.MyWebApp
+      requirements:
+        - host: web_server
+        - database_endpoint: db
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml
new file mode 100644
index 0000000..43a9a17
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml
@@ -0,0 +1,16 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyWebApp:
+    derived_from: tosca.nodes.WebApplication
+    properties:
+      context_root:
+        type: string
+    capabilities:
+      app_endpoint: 
+        type: tosca.capabilities.Endpoint
+    requirements:
+      - HOSt: 
+          capability: tosca.capabilities.Container.Docker
+          node: tosca.nodes.WebServer
+          relationship: tosca.relationships.HostedOn
+          occurrences: [ 1, 2 ]
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml
new file mode 100644
index 0000000..7c796d2
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vl.MyLink:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml
new file mode 100644
index 0000000..ff255f2
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.cp.MyPort:
+    derived_from: org.openecomp.resource.cp.Port
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage: 
+          capability: tosca.capabilities.network.Bindable
+          node: org.openecomp.resource.vl.MyLink
+          relationship: tosca.relationships.BindTo
+          occurrences: [0, UNBOUNDED]  
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml
new file mode 100644
index 0000000..f007a0f
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [2, 0]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml
new file mode 100644
index 0000000..0487b63
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [-1, 2]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml
new file mode 100644
index 0000000..7afdffa
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [1, -2]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml
new file mode 100644
index 0000000..f8a582f
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ , 2]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml
new file mode 100644
index 0000000..f1c6a93
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ 1, ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml
new file mode 100644
index 0000000..b0ef54b
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ 0 , 0 ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml
new file mode 100644
index 0000000..afd999f
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ @ , 1 ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml
new file mode 100644
index 0000000..60efc99
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ 1.0 , 2.0 ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml
new file mode 100644
index 0000000..d6ec7ea
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ "1" , "2" ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml
new file mode 100644
index 0000000..27de429
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [  ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml
new file mode 100644
index 0000000..5bdae3a
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+          occurrences: [ UNBOUNDED , UNBOUNDED  ]
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml
new file mode 100644
index 0000000..8c3034a
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ 2, 1]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml
new file mode 100644
index 0000000..4b5eba9
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ -1, 2]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml
new file mode 100644
index 0000000..9c42e22
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ 1, -2]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml
new file mode 100644
index 0000000..49953b5
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ , 2]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml
new file mode 100644
index 0000000..8d8985d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ 1 , ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml
new file mode 100644
index 0000000..1294450
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ 0 , 0 ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml
new file mode 100644
index 0000000..618c980
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ 0 , # ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml
new file mode 100644
index 0000000..d0c4575
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ 1.0 , 2.0 ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml
new file mode 100644
index 0000000..024338d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ "1" , "2" ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml
new file mode 100644
index 0000000..a4a32ba
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [  ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml
new file mode 100644
index 0000000..c3024a3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.MyCompute:
+    derived_from: tosca.nodes.Root
+    attributes:
+      private_address:
+        type: string
+      public_address:
+        type: string
+      networks:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.NetworkInfo
+      ports:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.network.PortInfo
+    requirements:
+      - local_storage100: 
+          capability: tosca.capabilities.Attachment
+          node: tosca.nodes.BlockStorage
+          relationship: tosca.relationships.AttachesTo
+    capabilities:
+      host: 
+        type: tosca.capabilities.Container
+        valid_source_types: [tosca.nodes.SoftwareComponent] 
+      endpoint100 :
+        type: tosca.capabilities.Endpoint.Admin 
+        occurrences: [ UNBOUNDED, UNBOUNDED ]  
+      os: 
+        type: tosca.capabilities.OperatingSystem
+      scalable:
+        type: tosca.capabilities.Scalable
+      binding:
+        type: tosca.capabilities.network.Bindable
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml
new file mode 100644
index 0000000..b9bda18
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vfc.vfc4:
+    derived_from: tosca.nodes.Root
+    properties:
+      # domain-specific software component version
+      component_version: 
+        type: version
+        required: false
+      admin_credential: 
+        type: tosca.datatypes.Credential
+        required: false
+    requirements:
+      - host: 
+          capability: tosca.capabilities.Container
+          relationship: tosca.relationships.HostedOn
+          occurrences: [1, 1]   
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml
new file mode 100644
index 0000000..9676bcd
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  org.openecomp.resource.vfc.vfc1:
+    derived_from: tosca.nodes.Root
+    properties:
+      # domain-specific software component version
+      component_version: 
+        type: version
+        required: false
+      admin_credential: 
+        type: tosca.datatypes.Credential
+        required: false
+    requirements:
+      - host: 
+          capability: tosca.capabilities.Container
+          relationship: tosca.relationships.HostedOn
+          occurrences: [1, 2]   
diff --git a/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt b/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt
new file mode 100644
index 0000000..f46af26
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt
@@ -0,0 +1 @@
+{"id":"c25811fc-e03f-401d-93ca-45d9bd312703","delegateId":"17710a88-f3d8-483d-aded-afee2906a8c1","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-webServer","version":"1.0.0.wd03-SNAPSHOT"},{"name":"apache-type","version":"2.0.0-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Compute_2","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}},{"key":"Apache","value":{"type":"alien.nodes.Apache","name":null,"properties":{"port":"80","document_root":"/var/www","version":"2.4"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"attachToCompute_2":{"type":"tosca.relationships.AttachTo","target":"Compute_2","requirementName":"dependency","requirementType":"tosca.capabilities.Root","targetedCapabilityName":"attach"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"secure_endpoint":{"type":"tosca.capabilities.Endpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"app_endpoint":{"type":"tosca.capabilities.Endpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.ApacheContainer","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":null}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}}]}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt
new file mode 100644
index 0000000..f3fdf02
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt
@@ -0,0 +1 @@
+{"id":"17710a88-f3d8-483d-aded-afee2906a8c1","name":"MichaelTest2","description":null,"topologyId":"c25811fc-e03f-401d-93ca-45d9bd312703"}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml
new file mode 100644
index 0000000..b6faadd
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: NO
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml
new file mode 100644
index 0000000..7fb2923
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: 0
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml
new file mode 100644
index 0000000..fd451aa
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: OFF
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml
new file mode 100644
index 0000000..a253e4c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: t
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml
new file mode 100644
index 0000000..ce273b3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: true
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml
new file mode 100644
index 0000000..4680eb6
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: on
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml
new file mode 100644
index 0000000..1ed7781
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: y
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml
new file mode 100644
index 0000000..c0b42e6
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: yes
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml
new file mode 100644
index 0000000..24b862b
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: 1
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml
new file mode 100644
index 0000000..7bad8ef
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: F
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml
new file mode 100644
index 0000000..8b35e2a
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: FALSE
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml
new file mode 100644
index 0000000..2768e0d
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: N
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml
new file mode 100644
index 0000000..fc7f84c
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: number
+    description: city name
+    default: 12
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml
new file mode 100644
index 0000000..28ec335
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: number
+    description: city name
+    default: 12.12
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png
new file mode 100644
index 0000000..8e02f49
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml
new file mode 100644
index 0000000..a2eb4d4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-uploadComponent
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+  - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+  - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+  alien.nodes.Mysql-uploadComponent:
+    derived_from: tosca.nodes.Database
+    description: >
+      A node to install MySQL v5.5 database with data
+      on a specific attached volume.
+    capabilities:
+      host:
+        type: alien.capabilities.MysqlDatabase
+        properties:
+          valid_node_types: [ tosca.nodes.WebApplication ]
+    requirements:
+      - host: tosca.nodes.Compute
+        type: tosca.relationships.HostedOn
+    tags:
+      icon: /images/mysql.png
+    properties:
+      db_port:
+        type: integer
+        default: 3306
+        description: The port on which the underlying database service will listen to data.
+      db_name:
+        type: string
+        required: true
+        default: wordpress
+        description: The logical name of the database.
+      db_user:
+        type: string
+        default: pass
+        description: The special user account used for database administration.
+      db_password:
+        type: string
+        default: pass
+        description: The password associated with the user account provided in the ‘db_user’ property.
+      bind_address:
+        type: boolean
+        default: true
+        required: false
+        description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+      storage_path:
+        type: string
+        default: /mountedStorage
+        constraints:
+          - valid_values: [ "/mountedStorage", "/var/mysql" ]
+    interfaces:
+      Standard:
+        create: scripts/install_mysql.sh
+        start:
+          inputs:
+            VOLUME_HOME: { get_property: [SELF, storage_path] }
+            PORT: { get_property: [SELF, db_port] }
+            DB_NAME: { get_property: [SELF, db_name] }
+            DB_USER: { get_property: [SELF, db_user] }
+            DB_PASSWORD: { get_property: [SELF, db_password] }
+            BIND_ADRESS: { get_property: [SELF, bind_address] }
+          implementation: scripts/start_mysql.sh
+      fastconnect.cloudify.extensions:
+         start_detection:
+          inputs:
+            PORT: { get_property: [SELF, db_port] }
+          implementation: scripts/mysql_start_detection.groovy
+    artifacts:
+      - scripts: scripts
+        type: tosca.artifacts.File
+
+capability_types:
+  alien.capabilities.MysqlDatabase:
+      derived_from: tosca.capabilities.Container
+
+artifact_types:
+  tosca.artifacts.GroovyScript:
+    description: A groovy script (.groovy file)
+    file_ext: [groovy]
diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh
new file mode 100644
index 0000000..400bcf4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+  if mkdir "${LOCK}" &>/dev/null; then
+    echo "MySQL take the lock"
+    break;
+  fi
+  echo "Waiting the end of one of our recipes..."
+  sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+  echo "Waiting for other software managers to finish..."
+  sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete."
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh
new file mode 100644
index 0000000..648bd45
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT        : $PORT"
+echo "ENV VAR USED DB_NAME     : $DB_NAME"
+echo "ENV VAR USED DB_USER     : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+  echo "Starting MYSQL..."
+  sudo /etc/init.d/mysql stop
+  sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+  RET=1
+  while [[ RET -ne 0 ]]; do
+    echo "=> Waiting for confirmation of MySQL service startup"
+    sleep 5
+    sudo mysql -uroot -e "status" > /dev/null 2>&1
+    RET=$?
+  done
+}
+
+function AllowFileSystemToMySQL {
+  MYSQL_DATA_DIR=$VOLUME_HOME/data
+  MYSQL_LOG=$VOLUME_HOME/logs
+
+  echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+  if sudo test ! -d $MYSQL_DATA_DIR; then
+    echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+    sudo mkdir -p $MYSQL_DATA_DIR
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+  fi
+  if sudo test ! -d $MYSQL_LOG; then
+    echo "Creating LOG dir > $MYSQL_LOG ..."
+    sudo mkdir -p $MYSQL_LOG
+    # mysql as owner and group owner
+    sudo chown -R mysql:mysql $MYSQL_LOG
+  fi
+
+  # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+  COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+  sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+  # reload app permission manager service
+  sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+  echo "Updating MySQL conf files [DATA, LOGS]..."
+  sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+  sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+  sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+  if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+    sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+  fi
+  if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+    sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+  fi
+
+  if [ "$BIND_ADRESS" == "true" ]; then
+    sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+  fi
+}
+
+function InitMySQLDb {
+  # create database DB_NAME
+  if [ "$DB_NAME" ]; then
+    echo "INIT DATABASE $DB_NAME"
+    sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+  fi
+
+  # create user and give rights
+  if [ "$DB_USER" ]; then
+    echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+    sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+    sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+    sudo mysql -uroot -e "FLUSH PRIVILEGES"
+  fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+  echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+  echo "=> Init new database path to $MYSQL_DATA_DIR"
+  sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+  echo "=> MySQL database initialized !"
+else
+  echo "=> Using an existing volume of MySQL"
+  AllowFileSystemToMySQL
+  UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml
new file mode 100644
index 0000000..764b8d4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: number123
+    description: city name
+    default: 12.12
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml
new file mode 100644
index 0000000..19119f3
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: K
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml
new file mode 100644
index 0000000..f9c09a4
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: boolean
+    description: city name
+    default: 11
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml
new file mode 100644
index 0000000..9a48987
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: number
+    description: city name
+    default: 1.2Noo
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml
new file mode 100644
index 0000000..4c0e07a
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: number
+    description: city name
+    default: 1 2 3
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml
new file mode 100644
index 0000000..f52ef04
--- /dev/null
+++ b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml
@@ -0,0 +1,140 @@
+heat_template_version: 2013-05-23
+#################################
+#
+#  Changes in v0.2:
+#  - Unique availability zone for each VM
+#  - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
+#  - 2 DB VMs added
+#  - Images corrected
+#  - VM start-up order: SMP->DB->BE->FE (no error handling yet)
+#  - Provisioning scripts placeholders
+#
+#################################
+
+description: ASC Template
+
+parameters:
+  city_name:
+    type: string
+    description: city name
+    default: שלום
+  address:
+    type: string
+    description: address
+    default: Alonim
+  home_number:
+    type: number
+    description: home_number
+    default: 8
+resources:
+#  scp_be_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_be_wait_handle }
+#      count: 5
+#      timeout: 300
+#  scp_be_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  scp_fe_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: scp_fe_wait_handle }
+#      count: 2
+#      timeout: 300
+#  scp_fe_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  smp_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: smp_wait_handle }
+#      count: 2
+#      timeout: 300
+#  smp_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+#
+#  db_wait_condition:
+#    type: OS::Heat::WaitCondition
+#    properties:
+#      handle: { get_resource: db_wait_handle }
+#      count: 2
+#      timeout: 300
+#  db_wait_handle:
+#    type: OS::Heat::WaitConditionHandle
+
+  FE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"] 
+  BE_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  SMP_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+  DB_Affinity:
+    type: OS::Nova::ServerGroup
+    properties:
+      policies: ["anti-affinity"]
+      
+  FE_Clustering_KA:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_fe_cluster_net_id }
+
+  FE_Clustering_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: FE_Clustering_KA }
+      cidr: { get_param: int_vscp_fe_cluster_cidr }
+
+  Clustering_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_cluster_net_id }
+
+  Clustering_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: Clustering_Network }
+      cidr: { get_param: int_vscp_cluster_cidr }
+
+  DB_Network:
+    type: OS::Contrail::VirtualNetwork
+    properties:
+      name: { get_param: int_vscp_db_network_net_id }
+
+  DB_Network_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: DB_Network }
+      cidr: { get_param: int_vscp_db_network_cidr }
+
+  server_scp_be0:
+    type: OS::Nova::Server
+#    depends on: db_wait_condition
+    properties:
+      name: { get_param: vm_scp_be0_name }
+      image: { get_param: image_scp_be_id }
+#      availability_zone: { get_param: availability_zone_be0 }
+      flavor: { get_param: flavor_scp_be_id }
+      scheduler_hints: { group: { get_resource: BE_Affinity } }
+      networks:
+      - port: { get_resource: be0_port_3 }
+      - port: { get_resource: be0_port_4 }
+      - port: { get_resource: be0_port_5 }
+      - port: { get_resource: be0_port_7 }
+      metadata:
+        vnf_id: { get_param: vnf_id }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            #todo: provision $vm_name
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+            $vm_name: {get_param: vm_scp_be0_name}
+#            wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/config.json b/test-apis-ci/src/test/resources/config.json
new file mode 100644
index 0000000..71c9d35
--- /dev/null
+++ b/test-apis-ci/src/test/resources/config.json
@@ -0,0 +1,12 @@
+{
+
+catalogBeHost: behost,
+catalogFeHost: fehost,
+esHost: eshost,
+catalogFePort: 8080,
+catalogBePort: 8080,
+esPort: 9200,
+resourceConfigDir: "src/test/resources/CI/tests",
+componentsConfigDir: "src/test/resources/CI/components"
+
+}
\ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/logback-test.xml b/test-apis-ci/src/test/resources/logback-test.xml
new file mode 100644
index 0000000..03ce9d1
--- /dev/null
+++ b/test-apis-ci/src/test/resources/logback-test.xml
@@ -0,0 +1,13 @@
+<!-- only one line, shut up logback ! -->
+<configuration>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <Pattern>
+                %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
+            </Pattern>
+        </encoder>
+    </appender>
+    <root level="off">
+        <appender-ref ref="STDOUT" />
+    </root>
+</configuration>
\ No newline at end of file
