summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraleemraja <ar00500721@techmahindra.com>2020-08-20 19:06:27 +0530
committeraleemraja <ar00500721@techmahindra.com>2020-08-20 19:06:42 +0530
commit417bd28022619432588cc58679e68d893c62c617 (patch)
tree0468cc9cfdc866ae581c62f86839aa86c604e298 /src
parentac2672f417dabb4d097e485457089a0945ab8a71 (diff)
Passing Instance params for SO Macro request
- Added Support for Instance params for SO Macro request at Service level and VNF level. - Added JUnit Test cases for ExecutionTask and ToscaInfoProcessor. - Updated timeout for StatusResourceTest. Issue-ID: EXTAPI-369 Change-Id: Ibbbbbd2d7021c16ea6291cc899e310ae26200999 Signed-off-by: aleemraja <ar00500721@techmahindra.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java1
-rw-r--r--src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java43
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java104
-rw-r--r--src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java312
-rw-r--r--src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java59
-rw-r--r--src/test/java/org/onap/nbi/test/ExecutionTaskTest.java136
-rw-r--r--src/test/resources/__files/toscafile/service-DummyService-csar.csarbin0 -> 69676 bytes
-rw-r--r--src/test/resources/__files/toscafile/service-VfwCnf1308Service-csar.csarbin0 -> 100985 bytes
-rw-r--r--src/test/resources/karatetest/features/04--StatusRessourceTest.feature1
-rw-r--r--src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc.json85
-rw-r--r--src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc_tosca.json10
-rw-r--r--src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066.json272
-rw-r--r--src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066_tosca.json10
-rw-r--r--src/test/resources/toscafile/service-VfwCnf1308Service-csar.csarbin0 -> 100985 bytes
14 files changed, 992 insertions, 41 deletions
diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java b/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java
index f9f5e07..128bc6c 100644
--- a/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java
+++ b/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java
@@ -49,6 +49,7 @@ public class ServiceSpecificationResource extends ResourceManagement {
ArrayList<Map<String, Object>> resourseSpecificationMap= (ArrayList<Map<String, Object>>) response.get("resourceSpecification");
for (Map<String, Object> map : resourseSpecificationMap) {
map.remove("childResourceSpecification");
+ map.remove("serviceInstanceParams");
map.remove("InstanceSpecification");
}
response.put("resourceSpecification", resourseSpecificationMap);
diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java b/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java
index 586d0b5..67f157e 100644
--- a/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java
+++ b/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java
@@ -22,6 +22,7 @@ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.onap.nbi.apis.serviceorder.model.consumer.VFModelInfo;
@@ -35,6 +36,7 @@ import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.functions.GetInput;
import org.onap.sdc.toscaparser.api.parameters.Input;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -137,11 +139,12 @@ public class ToscaInfosProcessor {
List<IEntityDetails> vfEntityList = sdcCsarHelper.getEntity(EntityQuery.newBuilder(SdcTypes.VF).build(),
TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).build(), false);
+ Map<String, org.onap.sdc.toscaparser.api.Property> groupProperties = null;
Map<String, String> listOfInstanceParameters = new HashMap<>();
if (!vfEntityList.isEmpty()) {
IEntityDetails iEntityDetails = vfEntityList.get(0);
- Map<String, org.onap.sdc.toscaparser.api.Property> groupProperties = iEntityDetails.getProperties();
+ groupProperties = iEntityDetails.getProperties();
for (String key : groupProperties.keySet()) {
org.onap.sdc.toscaparser.api.Property property = groupProperties.get(key);
@@ -254,11 +257,45 @@ public class ToscaInfosProcessor {
if (!vfModuleEntityList.isEmpty()) {
resourceSpecification.put("childResourceSpecification", listOfVfModelInfo);
}
- resourceSpecification.put("InstanceSpecification", listOfInstanceParameters);
-
+ HashMap<String, Object> serviceInstanceParams = getServiceLevelInstanceParams(inputs);
+ resourceSpecification.put("serviceInstanceParams", serviceInstanceParams);
+ HashMap<String, Object> vnfInstanceParams = getUserDefinedVFLevelInstanceParams(groupProperties, listOfInstanceParameters);
+ resourceSpecification.put("InstanceSpecification", vnfInstanceParams);
}
}
}
+
+ // Get List of Service Level InputParams as Key Value
+ private HashMap<String, Object> getServiceLevelInstanceParams(List<Input> listOfServiceLevelInputs) {
+
+ HashMap<String, Object> serviceLevelInstanceParams = new HashMap<>();
+
+ for (Input input : listOfServiceLevelInputs) {
+ serviceLevelInstanceParams.put(input.getName(), input.getDefault());
+ }
+
+ return serviceLevelInstanceParams;
+ }
+
+ private HashMap<String, Object> getUserDefinedVFLevelInstanceParams(
+ Map<String, org.onap.sdc.toscaparser.api.Property> groupProperties, Map listOfVFLevelInputs) {
+
+ HashMap<String, Object> vnfLevelInstanceParams = new HashMap<>();
+
+ for (Entry<String, org.onap.sdc.toscaparser.api.Property> entry : groupProperties.entrySet()) {
+
+ org.onap.sdc.toscaparser.api.Property property = entry.getValue();
+
+ if ((property.getValue().getClass() == GetInput.class)) {
+ GetInput getInput = (GetInput) property.getValue();
+ listOfVFLevelInputs.put(getInput.getInputName(), getInput.result());
+ listOfVFLevelInputs.remove(property.getName());
+ }
+ }
+
+ return (HashMap<String, Object>) listOfVFLevelInputs;
+ }
+
private static String testNull(Object object) {
if (object == null) {
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java
index e590afc..17b72e4 100644
--- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java
@@ -20,6 +20,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
import org.onap.nbi.apis.servicecatalog.ServiceSpecificationService;
import org.onap.nbi.apis.serviceorder.SoClient;
@@ -248,21 +250,31 @@ public class PostSoProcessor {
Map<String, Object> resourseSpecificationMap = resourseSpecificationArray.get(0);
+ Map serviceInstanceParam = (Map) resourseSpecificationMap.get("serviceInstanceParams");
Map instanceSpecification = (Map) resourseSpecificationMap.get("InstanceSpecification");
ArrayList<VFModelInfo> childResourceSpecification = (ArrayList<VFModelInfo>) resourseSpecificationMap
.get("childResourceSpecification");
+
+ HashMap<String, Object> instanceParamsFromServiceCharacteristics = retrieveInstanceParamsFromServiceCharacteristics(
+ orderItem.getService().getServiceCharacteristic());
+
+ HashMap<String, Object> instanceParams = (HashMap<String, Object>) buildAndDistinguishServiceAndVnfLevelParams(
+ instanceParamsFromServiceCharacteristics, instanceSpecification, serviceInstanceParam);
+ HashMap<String, Object> vnfInstanceParams = (HashMap<String, Object>) instanceParams.get("vnf");
List<Object> serviceObject = new ArrayList<>();
ArrayList<Object> vnfInstanceParam = new ArrayList<>();
//Differentiating vnf with cnf(Can be discussed and improved)
if (instanceSpecification.get("public_net_id") != null) {
+ Map<String, Object> instanceParam = new HashMap<>();
+ //Merge instanceSpecification with vnfInstanceParams
+ instanceSpecification.putAll(vnfInstanceParams);
vnfInstanceParam.add(instanceSpecification);
} else {
- Map<String, Object> instanceParam = new HashMap<>();
- instanceParam.put("k8s-rb-profile-name", k8sRbProfileName);
- vnfInstanceParam.add(instanceParam);
+ vnfInstanceParams.put("k8s-rb-profile-name", k8sRbProfileName);
+ vnfInstanceParam.add(vnfInstanceParams);
}
List resSpec = (ArrayList) sdcInfos.get("resourceSpecification");
@@ -349,7 +361,7 @@ public class PostSoProcessor {
// For now it is empty to comply with so request
List<Map<String, String>> listOfServiceLevelInstanceParams = new ArrayList<>();
- Map<String, String> serviceInstanceParams= new HashMap<>();
+ Map<String, String> serviceInstanceParams = (HashMap<String, String>) instanceParams.get("service");
listOfServiceLevelInstanceParams.add(serviceInstanceParams);
Map<String, Object> serviceData = new HashMap<>();
@@ -563,5 +575,89 @@ public class PostSoProcessor {
return userParams;
}
+
+ /**
+ * Build a list of InstanceParams for the SO Macro request by browsing a list of
+ * ServiceCharacteristics
+ */
+ private HashMap<String, Object> retrieveInstanceParamsFromServiceCharacteristics(
+ List<ServiceCharacteristic> characteristics) {
+
+ HashMap<String, Object> instanceParams = new HashMap<>();
+
+ if (!CollectionUtils.isEmpty(characteristics)) {
+ for (ServiceCharacteristic characteristic : characteristics) {
+ // Check is the characteristic is of type object, if proceed as before to allow
+ // for
+ // backwards compatibility.
+ if (characteristic.getValueType() != null && !characteristic.getValueType().isEmpty()
+ && characteristic.getValueType().equals("object")) {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode jsonNode = null;
+ try {
+ jsonNode = mapper.readTree(characteristic.getValue().getServiceCharacteristicValue());
+ } catch (IOException e) {
+ LOGGER.error("Failed to read object json {} , exception is ",
+ characteristic.getValue().getServiceCharacteristicValue(), e.getMessage());
+ }
+ ObjectNode objectNode = (ObjectNode) jsonNode;
+ Iterator<Map.Entry<String, JsonNode>> iter = objectNode.fields();
+ while (iter.hasNext()) {
+ Map.Entry<String, JsonNode> entry = iter.next();
+ if (!entry.getValue().isArray()) {
+ instanceParams.put(entry.getKey(), entry.getValue().asText());
+ } else {
+ ArrayNode arrayNode = (ArrayNode) entry.getValue();
+ String arrayNodeValueString = arrayNode.toString();
+ instanceParams.put(entry.getKey(), arrayNodeValueString);
+ }
+ }
+ } else {
+ instanceParams.put(characteristic.getName(),
+ characteristic.getValue().getServiceCharacteristicValue());
+ }
+ }
+ }
+
+ return instanceParams;
+ }
+
+ /**
+ * Build and distinguish InstanceParams at VNF Level and Service level and overwrite values from ServiceOrder JSON Request.
+ * Can be used as buildAndDistinguishServiceAndVnfLevelParams.get("vnf"); or buildAndDistinguishServiceAndVnfLevelParams.get("cnf");
+ */
+ private Map<String, Object> buildAndDistinguishServiceAndVnfLevelParams(
+ Map<String, Object> instanceParamsFromServiceCharacteristic, Map<String, Object> existingVNFParams,
+ Map<String, Object> existingServiceParams) {
+
+ //To be used by passing key as "vnf" or "service" for respective instanceParams
+ Map<String, Object> serviceAndVNFLevelInstanceParams = new HashMap<>();
+
+ Map<String, Object> resultVNFParams = new HashMap<>();
+ Map<String, Object> resultServiceParams = new HashMap<>();
+
+ // First Filter VNF level Params From Service Characteristics and overwrite
+ // values
+ resultVNFParams = instanceParamsFromServiceCharacteristic.entrySet().stream()
+ .filter(entry -> existingVNFParams.containsKey(entry.getKey()))
+ .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
+
+ //Add it as VNF level Params
+ serviceAndVNFLevelInstanceParams.put("vnf", resultVNFParams);
+
+ // Filter VNF level Params From Service Level
+ existingServiceParams.entrySet().removeIf(e -> existingVNFParams.containsKey(e.getKey()));
+
+ // Filter Service level Params From Service Characteristics and overwrite values
+ resultServiceParams = instanceParamsFromServiceCharacteristic.entrySet().stream()
+ .filter(entry -> existingServiceParams.containsKey(entry.getKey()))
+ .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
+
+ //Add it as Service level params
+ serviceAndVNFLevelInstanceParams.put("service", resultServiceParams);
+
+ return serviceAndVNFLevelInstanceParams;
+
+ }
} \ No newline at end of file
diff --git a/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java b/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java
index 621a938..430cd84 100644
--- a/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java
+++ b/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java
@@ -161,6 +161,74 @@ public class ServiceOrderExecutionTaskAssertions {
return serviceOrder;
}
+
+ public static ServiceOrder createTestServiceOrderForMacroVnf(ActionType actionType) {
+ ServiceOrder serviceOrder = new ServiceOrder();
+ serviceOrder.setExternalId("LudONAP001");
+ serviceOrder.setPriority("1");
+ serviceOrder.setDescription("Ludo first ONAP Order");
+ serviceOrder.setCategory("Consumer");
+ serviceOrder.setRequestedStartDate(new Date());
+ serviceOrder.setRequestedCompletionDate(new Date());
+ serviceOrder.setBaseType("toto");
+ serviceOrder.setCompletionDateTime(new Date());
+ serviceOrder.setExpectedCompletionDate(new Date());
+ serviceOrder.setSchemaLocation("/tutu");
+
+ OrderRelationship orderRelationship = new OrderRelationship();
+ orderRelationship.setId("test");
+ orderRelationship.setHref("test");
+ orderRelationship.setReferredType("test");
+ orderRelationship.setType("type");
+ List<OrderRelationship> relationships = new ArrayList<>();
+ serviceOrder.setOrderRelationship(relationships);
+
+ RelatedParty party = new RelatedParty();
+ party.setId("6490");
+ party.setRole("ONAPcustomer");
+ party.setReferredType("individual");
+ party.setName("Jean Pontus");
+ List<RelatedParty> relatedPartyList = new ArrayList<>();
+ relatedPartyList.add(party);
+ serviceOrder.setRelatedParty(relatedPartyList);
+
+ List<ServiceOrderItem> items = new ArrayList<>();
+
+ ServiceOrderItem itemA = new ServiceOrderItem();
+ itemA.id("A");
+ itemA.action(actionType);
+ Service serviceA = new Service();
+
+ serviceA.setServiceState("active");
+ ServiceSpecificationRef serviceSpecificationRefA = new ServiceSpecificationRef();
+ serviceSpecificationRefA.setId("3bed38ff-a4fd-4463-9784-caf738d46dbc");
+ serviceA.setServiceSpecification(serviceSpecificationRefA);
+ itemA.setService(serviceA);
+ items.add(itemA);
+
+ ServiceOrderItem itemB = new ServiceOrderItem();
+ itemB.id("B");
+ itemB.action(actionType);
+ Service serviceB = new Service();
+ if (actionType != ActionType.ADD) {
+ serviceB.setId("e4688e5f-61a0-4f8b-ae02-a2fbde623bcb");
+ }
+ serviceB.setServiceState("active");
+ ServiceSpecificationRef serviceSpecificationRefB = new ServiceSpecificationRef();
+ serviceSpecificationRefB.setId("3bed38ff-a4fd-4463-9784-caf738d46dbc");
+ serviceB.setServiceSpecification(serviceSpecificationRefB);
+ itemB.setService(serviceB);
+ List<OrderItemRelationship> orderItemRelationships = new ArrayList<>();
+ OrderItemRelationship orderItemRelationship = new OrderItemRelationship();
+ orderItemRelationship.setId("A");
+ orderItemRelationship.setType(RelationshipType.RELIESON);
+ orderItemRelationships.add(orderItemRelationship);
+ itemB.setOrderItemRelationship(orderItemRelationships);
+ items.add(itemB);
+ serviceOrder.setOrderItem(items);
+ return serviceOrder;
+ }
+
public static ServiceOrder createTestServiceOrderForMacro(ActionType actionType) {
ServiceOrder serviceOrder = new ServiceOrder();
@@ -508,6 +576,250 @@ public class ServiceOrderExecutionTaskAssertions {
return executionTaskA;
}
+ public static ExecutionTask setUpBddForMacroExecutionTaskSucessVnf(ServiceOrderRepository serviceOrderRepository,
+ ExecutionTaskRepository executionTaskRepository, ActionType actionType) {
+
+ ServiceOrder testServiceOrder = createTestServiceOrderForMacroVnf(actionType);
+
+ for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) {
+ serviceOrderItem.setState(StateType.ACKNOWLEDGED);
+ List<ServiceCharacteristic> serviceCharacteristics = new ArrayList();
+ ServiceCharacteristic serviceCharacteristic1 = new ServiceCharacteristic();
+ serviceCharacteristic1.setName("serviceProperty1");
+ Value value1 = new Value();
+ value1.setServiceCharacteristicValue("1234765");
+ serviceCharacteristic1.setValue(value1);
+ serviceCharacteristics.add(serviceCharacteristic1);
+ ServiceCharacteristic serviceCharacteristic2 = new ServiceCharacteristic();
+ serviceCharacteristic2.setName("dummy_vsp0_vfLevelProperty2");
+ Value value2 = new Value();
+ value2.setServiceCharacteristicValue("654321");
+ serviceCharacteristic2.setValue(value2);
+ serviceCharacteristics.add(serviceCharacteristic2);
+ serviceOrderItem.getService().setServiceCharacteristic(serviceCharacteristics);
+ }
+
+ testServiceOrder.setState(StateType.ACKNOWLEDGED);
+ testServiceOrder.setId("test");
+ serviceOrderRepository.save(testServiceOrder);
+
+ LinkedHashMap<String, Object> sdcResponse = new LinkedHashMap<>();
+ sdcResponse.put("invariantUUID", "b96687b0-5353-4e4d-bbd5-a49796fc3f11");
+ sdcResponse.put("name", "dummy_service");
+ sdcResponse.put("version", "2.0");
+ sdcResponse.put("category", "Network Service");
+ sdcResponse.put("instantiationType", "Macro");
+
+ List<ResourceSpecification> resourceSpecs = new ArrayList<>();
+ ResourceSpecification resourceSpecificationA = new ResourceSpecification();
+ resourceSpecificationA.setId("725860b4-1a98-4da6-9451-6c04a581eb44");
+ resourceSpecificationA.setInstanceName("dummy_vsp");
+ resourceSpecificationA.setName("dummy_vsp");
+ resourceSpecificationA.setType("VF");
+ resourceSpecificationA.setVersion("1.0");
+ resourceSpecificationA.setResourceInvariantUUID("0fa0d33d-b268-42ce-b393-7d3c6fde6ca9");
+ resourceSpecs.add(resourceSpecificationA);
+
+ sdcResponse.put("resourceSpecification", resourceSpecs);
+
+ ServiceOrderInfo serviceOrderInfo = new ServiceOrderInfo();
+ serviceOrderInfo.setServiceOrderId("test");
+ SubscriberInfo subscriberInfo = new SubscriberInfo();
+ subscriberInfo.setGlobalSubscriberId("6490");
+ subscriberInfo.setSubscriberName("edgar");
+ serviceOrderInfo.setSubscriberInfo(subscriberInfo);
+
+ ServiceOrderItemInfo serviceOrderItemInfoA = new ServiceOrderItemInfo();
+ serviceOrderItemInfoA.setId("A");
+ serviceOrderItemInfoA.setCatalogResponse(sdcResponse);
+
+ ServiceOrderItemInfo serviceOrderItemInfoB = new ServiceOrderItemInfo();
+ serviceOrderItemInfoB.setId("B");
+ serviceOrderItemInfoB.setCatalogResponse(sdcResponse);
+ serviceOrderInfo.addServiceOrderItemInfos("A", serviceOrderItemInfoA);
+ serviceOrderInfo.addServiceOrderItemInfos("B", serviceOrderItemInfoB);
+
+
+
+ String json = JsonEntityConverter.convertServiceOrderInfoToJson(serviceOrderInfo);
+
+ ExecutionTask executionTaskA = new ExecutionTask();
+ executionTaskA.setCreateDate(new Date());
+ executionTaskA.setOrderItemId("A");
+ executionTaskA.setServiceOrderInfoJson(json);
+ executionTaskA = executionTaskRepository.save(executionTaskA);
+ ExecutionTask executionTaskB = new ExecutionTask();
+ executionTaskB.setCreateDate(new Date());
+ executionTaskB.setOrderItemId("B");
+ executionTaskB.setReliedTasks(String.valueOf(executionTaskA.getInternalId()));
+ executionTaskB.setServiceOrderInfoJson(json);
+ executionTaskRepository.save(executionTaskB);
+ return executionTaskA;
+ }
+
+ public static ServiceOrder createTestServiceOrderForMacroCNF(ActionType actionType) {
+ ServiceOrder serviceOrder = new ServiceOrder();
+ serviceOrder.setExternalId("LudONAP001");
+ serviceOrder.setPriority("1");
+ serviceOrder.setDescription("Ludo first ONAP Order");
+ serviceOrder.setCategory("Consumer");
+ serviceOrder.setRequestedStartDate(new Date());
+ serviceOrder.setRequestedCompletionDate(new Date());
+ serviceOrder.setBaseType("toto");
+ serviceOrder.setCompletionDateTime(new Date());
+ serviceOrder.setExpectedCompletionDate(new Date());
+ serviceOrder.setSchemaLocation("/tutu");
+
+ OrderRelationship orderRelationship = new OrderRelationship();
+ orderRelationship.setId("test");
+ orderRelationship.setHref("test");
+ orderRelationship.setReferredType("test");
+ orderRelationship.setType("type");
+ List<OrderRelationship> relationships = new ArrayList<>();
+ serviceOrder.setOrderRelationship(relationships);
+
+ RelatedParty party = new RelatedParty();
+ party.setId("6490");
+ party.setRole("ONAPcustomer");
+ party.setReferredType("individual");
+ party.setName("Jean Pontus");
+ List<RelatedParty> relatedPartyList = new ArrayList<>();
+ relatedPartyList.add(party);
+ serviceOrder.setRelatedParty(relatedPartyList);
+
+ List<ServiceOrderItem> items = new ArrayList<>();
+
+ ServiceOrderItem itemA = new ServiceOrderItem();
+ itemA.id("A");
+ itemA.action(actionType);
+ Service serviceA = new Service();
+
+ serviceA.setId("edf094cc-281f-4be9-a284-e047ded86066");
+ serviceA.setServicetype("vfwk8s");
+
+ serviceA.setServiceState("active");
+ ServiceSpecificationRef serviceSpecificationRefA = new ServiceSpecificationRef();
+ serviceSpecificationRefA.setId("edf094cc-281f-4be9-a284-e047ded86066");
+ serviceA.setServiceSpecification(serviceSpecificationRefA);
+ itemA.setService(serviceA);
+ items.add(itemA);
+
+ ServiceOrderItem itemB = new ServiceOrderItem();
+ itemB.id("B");
+ itemB.action(actionType);
+ Service serviceB = new Service();
+ //serviceB.setId("edf094cc-281f-4be9-a284-e047ded86066");
+
+ serviceB.setServiceState("active");
+ ServiceSpecificationRef serviceSpecificationRefB = new ServiceSpecificationRef();
+ serviceSpecificationRefB.setId("edf094cc-281f-4be9-a284-e047ded86066");
+ serviceB.setServiceSpecification(serviceSpecificationRefB);
+ itemB.setService(serviceB);
+ List<OrderItemRelationship> orderItemRelationships = new ArrayList<>();
+ OrderItemRelationship orderItemRelationship = new OrderItemRelationship();
+ orderItemRelationship.setId("A");
+ orderItemRelationship.setType(RelationshipType.RELIESON);
+ orderItemRelationships.add(orderItemRelationship);
+ itemB.setOrderItemRelationship(orderItemRelationships);
+ items.add(itemB);
+ serviceOrder.setOrderItem(items);
+ System.out.println(serviceOrder);
+ return serviceOrder;
+ }
+
+ //setup for CNF MacroFLow
+ public static ExecutionTask setUpBddForMacroExecutionTaskSucessForCNF(ServiceOrderRepository serviceOrderRepository,
+ ExecutionTaskRepository executionTaskRepository, ActionType actionType) {
+
+ ServiceOrder testServiceOrder = createTestServiceOrderForMacroCNF(actionType);
+
+ for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) {
+ serviceOrderItem.setState(StateType.ACKNOWLEDGED);
+ List<ServiceCharacteristic> serviceCharacteristics = new ArrayList();
+ ServiceCharacteristic serviceCharacteristic1 = new ServiceCharacteristic();
+ serviceCharacteristic1.setName("vfw_cnf_13080_dummy_vf_2");
+ Value value1 = new Value();
+ value1.setServiceCharacteristicValue("ggg");
+ serviceCharacteristic1.setValue(value1);
+ serviceCharacteristics.add(serviceCharacteristic1);
+ ServiceCharacteristic serviceCharacteristic2 = new ServiceCharacteristic();
+ serviceCharacteristic2.setName("vfw_cnf_13080_dummy_vf_1");
+ Value value2 = new Value();
+ value2.setServiceCharacteristicValue("hhhh");
+ serviceCharacteristic2.setValue(value2);
+ serviceCharacteristics.add(serviceCharacteristic2);
+ ServiceCharacteristic serviceCharacteristic3 = new ServiceCharacteristic();
+ serviceCharacteristic3.setName("dummy_ser_2");
+ Value value3 = new Value();
+ value3.setServiceCharacteristicValue("serv2");
+ serviceCharacteristic3.setValue(value3);
+ serviceCharacteristics.add(serviceCharacteristic3);
+ ServiceCharacteristic serviceCharacteristic4 = new ServiceCharacteristic();
+ serviceCharacteristic4.setName("dummy_ser_1");
+ Value value4 = new Value();
+ value4.setServiceCharacteristicValue("serv1");
+ serviceCharacteristic4.setValue(value4);
+ serviceCharacteristics.add(serviceCharacteristic4);
+
+ serviceOrderItem.getService().setServiceCharacteristic(serviceCharacteristics);
+ }
+
+ testServiceOrder.setState(StateType.ACKNOWLEDGED);
+ testServiceOrder.setId("test");
+ serviceOrderRepository.save(testServiceOrder);
+
+ LinkedHashMap<String, Object> sdcResponse = new LinkedHashMap<>();
+ sdcResponse.put("invariantUUID", "uuid");
+ sdcResponse.put("name", "vfw_cnf_1308");
+ sdcResponse.put("version", "1.0");
+ sdcResponse.put("category", "Network Service");
+ sdcResponse.put("instantiationType", "Macro");
+
+ List<ResourceSpecification> resourceSpecs = new ArrayList<>();
+ ResourceSpecification resourceSpecificationA = new ResourceSpecification();
+ resourceSpecificationA.setId("679effb6-35e7-425e-9272-4b4e6b2b8382");
+ resourceSpecificationA.setInstanceName("vfw_cnf_1308 0");
+ resourceSpecificationA.setName("vfw_cnf_1308 0");
+ resourceSpecificationA.setType("VF");
+ resourceSpecificationA.setVersion("1.0");
+ resourceSpecificationA.setResourceInvariantUUID("2c9870d3-21cd-4140-afa0-3ba770bef206");
+ resourceSpecs.add(resourceSpecificationA);
+
+ sdcResponse.put("resourceSpecification", resourceSpecs);
+
+ ServiceOrderInfo serviceOrderInfo = new ServiceOrderInfo();
+ serviceOrderInfo.setServiceOrderId("test");
+ SubscriberInfo subscriberInfo = new SubscriberInfo();
+ subscriberInfo.setGlobalSubscriberId("6490");
+ subscriberInfo.setSubscriberName("edgar");
+ serviceOrderInfo.setSubscriberInfo(subscriberInfo);
+
+ ServiceOrderItemInfo serviceOrderItemInfoA = new ServiceOrderItemInfo();
+ serviceOrderItemInfoA.setId("A");
+ serviceOrderItemInfoA.setCatalogResponse(sdcResponse);
+
+ ServiceOrderItemInfo serviceOrderItemInfoB = new ServiceOrderItemInfo();
+ serviceOrderItemInfoB.setId("B");
+ serviceOrderItemInfoB.setCatalogResponse(sdcResponse);
+ serviceOrderInfo.addServiceOrderItemInfos("A", serviceOrderItemInfoA);
+ serviceOrderInfo.addServiceOrderItemInfos("B", serviceOrderItemInfoB);
+
+ String json = JsonEntityConverter.convertServiceOrderInfoToJson(serviceOrderInfo);
+
+ ExecutionTask executionTaskA = new ExecutionTask();
+ executionTaskA.setCreateDate(new Date());
+ executionTaskA.setOrderItemId("A");
+ executionTaskA.setServiceOrderInfoJson(json);
+ executionTaskA = executionTaskRepository.save(executionTaskA);
+ ExecutionTask executionTaskB = new ExecutionTask();
+ executionTaskB.setCreateDate(new Date());
+ executionTaskB.setOrderItemId("B");
+ executionTaskB.setReliedTasks(String.valueOf(executionTaskA.getInternalId()));
+ executionTaskB.setServiceOrderInfoJson(json);
+ executionTaskRepository.save(executionTaskB);
+ return executionTaskA;
+ }
+
public static ExecutionTask setUpBddForMacroExecutionTaskSucess(ServiceOrderRepository serviceOrderRepository,
ExecutionTaskRepository executionTaskRepository, ActionType actionType) {
diff --git a/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java b/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java
index 026c81f..fe348de 100644
--- a/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java
+++ b/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java
@@ -379,4 +379,63 @@ public class ToscaInfosProcessorTest {
assertThat(instanceSpecificationTestData).isEqualTo(instanceSpecification);
}
+
+ @Test
+ public void testBuildAndSaveResponseWithSdcToscaParserWithServiceAndVFNFLevelParams() {
+
+ ClassLoader classLoader = getClass().getClassLoader();
+
+ // Adding Path to TOSCA File to provide as parameter
+ Path path = new File(classLoader.getResource("toscafile/service-VfwCnf1308Service-csar.csar").getFile())
+ .toPath().toAbsolutePath();
+
+ // Creating response to provide as parameter
+ LinkedHashMap response = new LinkedHashMap();
+ response.put("version", "1.0");
+ response.put("name", "vfw_cnf_1308");
+ response.put("description", "vfw_cnf_1308");
+ response.put("id", "edf094cc-281f-4be9-a284-e047ded86066");
+
+ // Resources
+ List<LinkedHashMap> resources = new ArrayList<>();
+ LinkedHashMap resource1 = new LinkedHashMap();
+ resource1.put("id", "679effb6-35e7-425e-9272-4b4e6b2b8382");
+ resources.add(resource1);
+
+ // instanceSpecification Test Data
+ Map instanceSpecificationTestData = new LinkedHashMap<>();
+ instanceSpecificationTestData.put("vfw_cnf_13080_dummy_vf_2", "xyz");
+ instanceSpecificationTestData.put("vfw_cnf_13080_dummy_vf_1", "abc");
+
+ // serviceParams Test Data
+ Map serviceParamsTestData = new LinkedHashMap<>();
+ serviceParamsTestData.put("dummy_ser_2", "jklm");
+ serviceParamsTestData.put("skip_post_instantiation_configuration", true);
+ serviceParamsTestData.put("controller_actor", "SO-REF-DATA");
+ serviceParamsTestData.put("dummy_ser_1", "pqrs");
+ serviceParamsTestData.put("cds_model_version", null);
+ serviceParamsTestData.put("cds_model_name", null);
+ serviceParamsTestData.put("vfw_cnf_13080_dummy_vf_2", "xyz");
+ serviceParamsTestData.put("vfw_cnf_13080_dummy_vf_1", "abc");
+
+ // Resources to put in response as resourceSpecification
+ response.put("resourceSpecification", resources);
+
+ try {
+ toscaInfosProcessor.buildAndSaveResponseWithSdcToscaParser(path, response);
+ } catch (SdcToscaParserException e) {
+ throw new TechnicalException("unable to build response from tosca csar using sdc-parser : "
+ + path.toString() + " " + e.getMessage());
+ }
+
+ // Getting
+ List<LinkedHashMap> resourceSpecifications = (List<LinkedHashMap>) response.get("resourceSpecification");
+
+ Map instanceSpecification = (HashMap) (resourceSpecifications.get(0)).get("InstanceSpecification");
+
+ Map serviceParams = (HashMap) (resourceSpecifications.get(0)).get("serviceInstanceParams");
+ // Test against test data and returned response's data for instanceSpecification and serviceParams
+ assertThat(instanceSpecificationTestData).isEqualTo(instanceSpecification);
+ assertThat(serviceParamsTestData).isEqualTo(serviceParams);
+ }
}
diff --git a/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java b/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java
index 2b28eff..2632872 100644
--- a/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java
+++ b/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java
@@ -331,40 +331,108 @@ public class ExecutionTaskTest {
}
- // Macro Flow Execution Task
- @Test
- public void testMacroExecutionTaskSuccess() throws Exception {
-
- ExecutionTask executionTaskA =
- ServiceOrderExecutionTaskAssertions.setUpBddForMacroExecutionTaskSucess(
- serviceOrderRepository, executionTaskRepository, ActionType.ADD);
- ExecutionTask executionTaskB;
-
- SoTaskProcessor.processOrderItem(executionTaskA);
- ServiceOrder serviceOrderChecked = getServiceOrder("test");
- assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS);
- for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
- if (serviceOrderItem.getId().equals("A")) {
- assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
- } else {
- assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED);
- }
- }
-
- executionTaskB = getExecutionTask("B");
- assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty();
- executionTaskA = getExecutionTask("A");
- assertThat(executionTaskA).isNull();
-
- SoTaskProcessor.processOrderItem(executionTaskB);
- serviceOrderChecked = getServiceOrder("test");
-
- assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED);
- for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
- assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
-
- }
- }
+ // Macro Flow Execution Task
+ @Test
+ public void testMacroExecutionTaskSuccess() throws Exception {
+
+ ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions
+ .setUpBddForMacroExecutionTaskSucess(serviceOrderRepository, executionTaskRepository, ActionType.ADD);
+ ExecutionTask executionTaskB;
+
+ SoTaskProcessor.processOrderItem(executionTaskA);
+ ServiceOrder serviceOrderChecked = getServiceOrder("test");
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ if (serviceOrderItem.getId().equals("A")) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
+ } else {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED);
+ }
+ }
+
+ executionTaskB = getExecutionTask("B");
+ assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty();
+ executionTaskA = getExecutionTask("A");
+ assertThat(executionTaskA).isNull();
+
+ SoTaskProcessor.processOrderItem(executionTaskB);
+ serviceOrderChecked = getServiceOrder("test");
+
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
+
+ }
+ }
+
+ // Macro Flow Execution Task for VNF with Service and VNF level Params
+ @Test
+ public void testMacroExecutionTaskSuccessForVNFWithServceAndVnfLevelParams() throws Exception {
+
+ ExecutionTask executionTaskA =
+ ServiceOrderExecutionTaskAssertions.setUpBddForMacroExecutionTaskSucessVnf(
+ serviceOrderRepository, executionTaskRepository, ActionType.ADD);
+ ExecutionTask executionTaskB;
+
+ SoTaskProcessor.processOrderItem(executionTaskA);
+ ServiceOrder serviceOrderChecked = getServiceOrder("test");
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ if (serviceOrderItem.getId().equals("A")) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
+ } else {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED);
+ }
+ }
+
+ executionTaskB = getExecutionTask("B");
+ assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty();
+ executionTaskA = getExecutionTask("A");
+ assertThat(executionTaskA).isNull();
+
+ SoTaskProcessor.processOrderItem(executionTaskB);
+ serviceOrderChecked = getServiceOrder("test");
+
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
+
+ }
+ }
+
+ // Macro Flow Execution Task with CNF with InstanceParams
+ @Test
+ public void testMacroExecutionTaskSuccessforCNFWithServiceAndVNFLevelParams() throws Exception {
+
+ ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions
+ .setUpBddForMacroExecutionTaskSucessForCNF(serviceOrderRepository, executionTaskRepository, ActionType.ADD);
+ ExecutionTask executionTaskB;
+
+ SoTaskProcessor.processOrderItem(executionTaskA);
+ ServiceOrder serviceOrderChecked = getServiceOrder("test");
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ if (serviceOrderItem.getId().equals("A")) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
+ } else {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED);
+ }
+ }
+
+ executionTaskB = getExecutionTask("B");
+ assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty();
+ executionTaskA = getExecutionTask("A");
+ assertThat(executionTaskA).isNull();
+
+ SoTaskProcessor.processOrderItem(executionTaskB);
+ serviceOrderChecked = getServiceOrder("test");
+
+ assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED);
+ for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) {
+ assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED);
+
+ }
+ }
@Test
public void testExecutionTaskFailed() throws Exception {
diff --git a/src/test/resources/__files/toscafile/service-DummyService-csar.csar b/src/test/resources/__files/toscafile/service-DummyService-csar.csar
new file mode 100644
index 0000000..10db0b3
--- /dev/null
+++ b/src/test/resources/__files/toscafile/service-DummyService-csar.csar
Binary files differ
diff --git a/src/test/resources/__files/toscafile/service-VfwCnf1308Service-csar.csar b/src/test/resources/__files/toscafile/service-VfwCnf1308Service-csar.csar
new file mode 100644
index 0000000..e9644e9
--- /dev/null
+++ b/src/test/resources/__files/toscafile/service-VfwCnf1308Service-csar.csar
Binary files differ
diff --git a/src/test/resources/karatetest/features/04--StatusRessourceTest.feature b/src/test/resources/karatetest/features/04--StatusRessourceTest.feature
index fdcc138..a2fddc5 100644
--- a/src/test/resources/karatetest/features/04--StatusRessourceTest.feature
+++ b/src/test/resources/karatetest/features/04--StatusRessourceTest.feature
@@ -22,6 +22,7 @@ Feature: Status Resource
Background:
* url nbiBaseUrl
* def Context = Java.type('org.onap.nbi.test.Context');
+* configure readTimeout = 10000
* call Context.startServers();
Scenario: testHealthCheck
diff --git a/src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc.json b/src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc.json
new file mode 100644
index 0000000..65df09e
--- /dev/null
+++ b/src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc.json
@@ -0,0 +1,85 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/metadata"
+ },
+ "response": {
+ "status": 200,
+ "jsonBody": {
+ "uuid": "3bed38ff-a4fd-4463-9784-caf738d46dbc",
+ "invariantUUID": "b96687b0-5353-4e4d-bbd5-a49796fc3f11",
+ "name": "dummy_service",
+ "version": "2.0",
+ "toscaModelURL": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/toscaModel",
+ "category": "Network Service",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "cs0008",
+ "distributionStatus": "DISTRIBUTED",
+ "lastUpdaterFullName": "Carlos Santana",
+ "resources": [{
+ "resourceInstanceName": "dummy_vsp 0",
+ "resourceName": "dummy_vsp",
+ "resourceInvariantUUID": "0fa0d33d-b268-42ce-b393-7d3c6fde6ca9",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "725860b4-1a98-4da6-9451-6c04a581eb44",
+ "artifacts": [{
+ "artifactName": "vf-license-model.xml",
+ "artifactType": "VF_LICENSE",
+ "artifactURL": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/resourceInstances/dummy_vsp0/artifacts/ac6dae44-91d7-4eb9-aa1d-da056f6a2c6c",
+ "artifactDescription": "VF license file",
+ "artifactChecksum": "YWZjYWY4MDIzMzRjMDFlMDg3NDcyOWNiZjU2ODk1MDU=",
+ "artifactUUID": "ac6dae44-91d7-4eb9-aa1d-da056f6a2c6c",
+ "artifactVersion": "1",
+ "artifactLabel": "vflicense",
+ "artifactGroupType": "DEPLOYMENT"
+ }, {
+ "artifactName": "dummy_vsp0_modules.json",
+ "artifactType": "VF_MODULES_METADATA",
+ "artifactURL": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/resourceInstances/dummy_vsp0/artifacts/362dd42f-3eff-45dd-8163-0821d191ebd3",
+ "artifactDescription": "Auto-generated VF Modules information artifact",
+ "artifactChecksum": "YzdlZTU5MmI1YmIwOTYzZGE2MmYyMWNmYTI3Yjc1ZWE=",
+ "artifactUUID": "362dd42f-3eff-45dd-8163-0821d191ebd3",
+ "artifactVersion": "2",
+ "artifactLabel": "vfModulesMetadata",
+ "artifactGroupType": "DEPLOYMENT"
+ }, {
+ "artifactName": "base_bono.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/resourceInstances/dummy_vsp0/artifacts/b9d286f7-cd3c-4a54-a028-c673b7028c19",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "NTYzNmFlM2ZkMWQ4Y2U3YTc5YzM3Nzc2OTRmMjBlMWU=",
+ "artifactUUID": "b9d286f7-cd3c-4a54-a028-c673b7028c19",
+ "artifactVersion": "1",
+ "artifactLabel": "heat1",
+ "artifactGroupType": "DEPLOYMENT"
+ }, {
+ "artifactName": "vendor-license-model.xml",
+ "artifactType": "VENDOR_LICENSE",
+ "artifactURL": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/resourceInstances/dummy_vsp0/artifacts/207fc34f-dc47-47ec-8dc4-669960c9e338",
+ "artifactDescription": " Vendor license file",
+ "artifactChecksum": "YmY4NDI2MTk2OTU1NWJmZDMzZmI0OWZkNzU1ZDliODQ=",
+ "artifactUUID": "207fc34f-dc47-47ec-8dc4-669960c9e338",
+ "artifactVersion": "1",
+ "artifactLabel": "vendorlicense",
+ "artifactGroupType": "DEPLOYMENT"
+ }, {
+ "artifactName": "base_bono.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/resourceInstances/dummy_vsp0/artifacts/2f18acf8-89d9-4b4f-8b98-b8143e21d485",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "ZDliY2ZhZWRkNjJlZTEzMTg4MzYwOTA3ZTMwNjM2MzI=",
+ "artifactUUID": "2f18acf8-89d9-4b4f-8b98-b8143e21d485",
+ "artifactVersion": "3",
+ "generatedFromUUID": "3fad956a-8ee5-4870-99a4-a13cfadb222b.heat1",
+ "artifactLabel": "heat1env",
+ "artifactGroupType": "DEPLOYMENT"
+ }]
+ }]
+},
+ "headers": {
+ "Content-Type": "application/json"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc_tosca.json b/src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc_tosca.json
new file mode 100644
index 0000000..cf8e2c2
--- /dev/null
+++ b/src/test/resources/mappings/sdc/sdc_get_3bed38ff-a4fd-4463-9784-caf738d46dbc_tosca.json
@@ -0,0 +1,10 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/sdc/v1/catalog/services/3bed38ff-a4fd-4463-9784-caf738d46dbc/toscaModel"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "toscafile/service-DummyService-csar.csar"
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066.json b/src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066.json
new file mode 100644
index 0000000..32f42a8
--- /dev/null
+++ b/src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066.json
@@ -0,0 +1,272 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/metadata"
+ },
+ "response": {
+ "status": 200,
+ "jsonBody": {
+ "uuid": "edf094cc-281f-4be9-a284-e047ded86066",
+ "invariantUUID": "fa8cd207-ae25-4b4d-baa7-ba841907ab69",
+ "name": "vfw_cnf_1308_service",
+ "version": "2.0",
+ "toscaModelURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/toscaModel",
+ "category": "Network Service",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "cs0008",
+ "distributionStatus": "DISTRIBUTED",
+ "lastUpdaterFullName": "Carlos Santana",
+ "resources": [
+ {
+ "resourceInstanceName": "vfw_cnf_1308 0",
+ "resourceName": "vfw_cnf_1308",
+ "resourceInvariantUUID": "2c9870d3-21cd-4140-afa0-3ba770bef206",
+ "resourceVersion": "1.0",
+ "resoucreType": "VF",
+ "resourceUUID": "679effb6-35e7-425e-9272-4b4e6b2b8382",
+ "artifacts": [
+ {
+ "artifactName": "vf-license-model.xml",
+ "artifactType": "VF_LICENSE",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/64e27d2e-108c-41a5-81a5-5e7de8279f65",
+ "artifactDescription": "VF license file",
+ "artifactChecksum": "ZGM1YjI1ODQyYzM5NGU2NWYzNTU2ZWY4ZGUwYmIwZDU=",
+ "artifactUUID": "64e27d2e-108c-41a5-81a5-5e7de8279f65",
+ "artifactVersion": "1",
+ "artifactLabel": "vflicense",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "base_template_cloudtech_k8s_charts.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/aa0020b4-5476-4c49-b2f4-3a1e63812f45",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI=",
+ "artifactUUID": "aa0020b4-5476-4c49-b2f4-3a1e63812f45",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.cloudtechnologyspecificartifact12",
+ "artifactLabel": "cloudtechnologyspecificartifact12env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vfw_cnf_13080_modules.json",
+ "artifactType": "VF_MODULES_METADATA",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/49a4cca7-0af3-4671-a5b1-5ffb1cd51ed9",
+ "artifactDescription": "Auto-generated VF Modules information artifact",
+ "artifactChecksum": "NTY1NGI4YTViNGY5OGM1MDgyNDc5NmQxNTIwMzAwM2M=",
+ "artifactUUID": "49a4cca7-0af3-4671-a5b1-5ffb1cd51ed9",
+ "artifactVersion": "2",
+ "artifactLabel": "vfModulesMetadata",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vfw_cloudtech_k8s_charts.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/0433412e-cb99-4717-ae20-2461932a7862",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI=",
+ "artifactUUID": "0433412e-cb99-4717-ae20-2461932a7862",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.cloudtechnologyspecificartifact11",
+ "artifactLabel": "cloudtechnologyspecificartifact11env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vsn_cloudtech_k8s_charts.tgz",
+ "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/dcfe1cc8-0ebf-46a3-a754-8896e97f6280",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "N2FlMmViOWU4ZTU4ZWVkYTY4ZDYwOTBmNTBkYmZmYWY=",
+ "artifactUUID": "dcfe1cc8-0ebf-46a3-a754-8896e97f6280",
+ "artifactVersion": "1",
+ "artifactLabel": "cloudtechnologyspecificartifact9",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vsn.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/2e87a975-4816-4bbe-951a-68ca36a011c8",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "NzE1Njc2ZmI5MTIzNGQwYWQ1ZWU0YjU5ZGNiZDYwM2M=",
+ "artifactUUID": "2e87a975-4816-4bbe-951a-68ca36a011c8",
+ "artifactVersion": "1",
+ "artifactLabel": "heat1",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vpkg.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/2d2b3a58-d942-424c-9b44-19ce996dead3",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "YjM5ZmU2NGUwMTQ4ZjJmYjNkYTk4ZmRmYjEwM2ZiMjI=",
+ "artifactUUID": "2d2b3a58-d942-424c-9b44-19ce996dead3",
+ "artifactVersion": "1",
+ "artifactLabel": "heat3",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vendor-license-model.xml",
+ "artifactType": "VENDOR_LICENSE",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/dd8567f8-fa6a-4f26-bf7c-9a2dcf605250",
+ "artifactDescription": " Vendor license file",
+ "artifactChecksum": "M2ZmZGI0M2JlYzljZTU4YWNmZjJmNGQ2NGNlZGNiY2I=",
+ "artifactUUID": "dd8567f8-fa6a-4f26-bf7c-9a2dcf605250",
+ "artifactVersion": "1",
+ "artifactLabel": "vendorlicense",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vfw.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/5c22f875-5425-4b0c-9823-afba9ac75d20",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "ODE4MTU4ZDc4YjZkOTAxNjBiN2Q4N2JkZDExYTRmZjM=",
+ "artifactUUID": "5c22f875-5425-4b0c-9823-afba9ac75d20",
+ "artifactVersion": "1",
+ "artifactLabel": "heat5",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "base_template.yaml",
+ "artifactType": "HEAT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/c51b7dcf-796b-4355-b35c-54b49633e89b",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "ZGYxYjZjOWY4NmFhY2Q5YTVhMThhMjNiYzEzMDk1ZGY=",
+ "artifactUUID": "c51b7dcf-796b-4355-b35c-54b49633e89b",
+ "artifactVersion": "1",
+ "artifactLabel": "heat7",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "base_template_cloudtech_k8s_charts.tgz",
+ "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/cd7f5867-fb30-4282-bd89-ca0ff33e78a9",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "NmUwYjIzMmJhZjE0OTA4OTY4ODI0MzQ1ZTU1N2RiNzA=",
+ "artifactUUID": "cd7f5867-fb30-4282-bd89-ca0ff33e78a9",
+ "artifactVersion": "1",
+ "artifactLabel": "cloudtechnologyspecificartifact12",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vpkg_cloudtech_k8s_charts.tgz",
+ "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/da443669-c1f6-4dfa-9cc8-d666b276906a",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "Nzk4NmQzZWVhYzQ5OGE0ZWQyZDYyYjBhZWM2MDcyMzk=",
+ "artifactUUID": "da443669-c1f6-4dfa-9cc8-d666b276906a",
+ "artifactVersion": "1",
+ "artifactLabel": "cloudtechnologyspecificartifact10",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vfw_cloudtech_k8s_charts.tgz",
+ "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/8ba2f2d2-cc5e-4350-989a-707a1f84d761",
+ "artifactDescription": "created from csar",
+ "artifactTimeout": 30,
+ "artifactChecksum": "M2ZhOWFkOTk4MjFiZTM4Yjk1ZGQ0YThjN2ViMTM0ZjU=",
+ "artifactUUID": "8ba2f2d2-cc5e-4350-989a-707a1f84d761",
+ "artifactVersion": "1",
+ "artifactLabel": "cloudtechnologyspecificartifact11",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "base_template.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/83a9702c-27ff-4b06-a2a8-ca08c8188317",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "YWZkMzRjZWU2MDQ1MGVhYmQ2YWRiNWFiNWMzOTlkYjc=",
+ "artifactUUID": "83a9702c-27ff-4b06-a2a8-ca08c8188317",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.heat7",
+ "artifactLabel": "heat7env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vpkg_cloudtech_k8s_charts.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/e3fb742e-eb30-4821-8adf-af3d002fe8c0",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI=",
+ "artifactUUID": "e3fb742e-eb30-4821-8adf-af3d002fe8c0",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.cloudtechnologyspecificartifact10",
+ "artifactLabel": "cloudtechnologyspecificartifact10env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "CBA.zip",
+ "artifactType": "CONTROLLER_BLUEPRINT_ARCHIVE",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/a4cac5d7-8d96-441c-afd2-4ea75e7cfd91",
+ "artifactDescription": "created from csar",
+ "artifactChecksum": "NmFiM2VjOWMxNTljNjcwYzQ2ODRlMjJmY2E3YzU4NjA=",
+ "artifactUUID": "a4cac5d7-8d96-441c-afd2-4ea75e7cfd91",
+ "artifactVersion": "1",
+ "artifactLabel": "controllerblueprintarchive13",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vsn_cloudtech_k8s_charts.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/fe315410-d43c-4168-89a2-2bc5cac9f606",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI=",
+ "artifactUUID": "fe315410-d43c-4168-89a2-2bc5cac9f606",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.cloudtechnologyspecificartifact9",
+ "artifactLabel": "cloudtechnologyspecificartifact9env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vfw.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/32d57f44-aea3-458f-b30d-080d8cc3f359",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "NTk0OWFlMWU5NGYyNmZjZjhiNzhkOTdmYmM3ZmVkZjg=",
+ "artifactUUID": "32d57f44-aea3-458f-b30d-080d8cc3f359",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.heat5",
+ "artifactLabel": "heat5env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vpkg.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/9305bcc3-4ef2-4659-9707-9a61420ac500",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "MWRhYTA5ZDBhZWYxZjEwMDExZDliOWYyMDI2NzAyYzE=",
+ "artifactUUID": "9305bcc3-4ef2-4659-9707-9a61420ac500",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.heat3",
+ "artifactLabel": "heat3env",
+ "artifactGroupType": "DEPLOYMENT"
+ },
+ {
+ "artifactName": "vsn.env",
+ "artifactType": "HEAT_ENV",
+ "artifactURL": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/resourceInstances/vfw_cnf_13080/artifacts/70cdee61-ab45-4d89-a5a8-6f450304930a",
+ "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+ "artifactChecksum": "YTQ1NTY0YzA2MTk4M2IwMGUxZThlMTBlOTRjZjgyNTA=",
+ "artifactUUID": "70cdee61-ab45-4d89-a5a8-6f450304930a",
+ "artifactVersion": "3",
+ "generatedFromUUID": "7176f506-6215-4ecb-9417-a90542cba39c.heat1",
+ "artifactLabel": "heat1env",
+ "artifactGroupType": "DEPLOYMENT"
+ }
+ ]
+ }
+ ]
+ },
+ "headers": {
+ "Content-Type": "application/json"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066_tosca.json b/src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066_tosca.json
new file mode 100644
index 0000000..d0037a9
--- /dev/null
+++ b/src/test/resources/mappings/sdc/sdc_get_edf094cc-281f-4be9-a284-e047ded86066_tosca.json
@@ -0,0 +1,10 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/sdc/v1/catalog/services/edf094cc-281f-4be9-a284-e047ded86066/toscaModel"
+ },
+ "response": {
+ "status": 200,
+ "bodyFileName": "toscafile/service-VfwCnf1308Service-csar.csar"
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/toscafile/service-VfwCnf1308Service-csar.csar b/src/test/resources/toscafile/service-VfwCnf1308Service-csar.csar
new file mode 100644
index 0000000..e9644e9
--- /dev/null
+++ b/src/test/resources/toscafile/service-VfwCnf1308Service-csar.csar
Binary files differ