aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-17 11:14:35 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-17 12:01:30 -0400
commit08c27a288e961c1ffd4151384ef0f609bb855e10 (patch)
tree5a139d4624226dcf543e14afeef284dec352be70 /bpmn
parent184e1ed3e83effc39b6f7f92c9f4b9d874c4cfe7 (diff)
more stability fixes
Remove conditional to not check VNF topology add empty string verification for serviceName field Add junits for CNRCR and NtwkAdptr changes. Add search in new CollNtwkResCust tbl to get NtwkResource. - Updated test data files to include 'pre-load' flag in both VfModuleOperation and NetworkOperation json test data files. - MSO to not to send <preload>boolean</from-preload> to SDNC in network-topology-opertion and vf-module-topology-operation. Updated GeneralTopologyObjectMapper to set 'from-preload' to null so that elements with Nulls are not sent to SDNC. Updated buildNetworkInformation() and buildVfModuleInformation() methods. update flow stats to not cause bpmn flow to crash Fix headers so SDNC does not return XML Add implementation of deleteVolumeGroupResponse parsing; fix JUnits that worked by accident. Change-Id: Ia96d552d731e112505fcf739029a6fd4d0134546 Issue-ID: SO-1061 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroUtils.groovy1
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java29
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java48
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformation.json1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationNoNetworkName.json1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationUnAssign.json1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json5
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml53
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/DeleteVfModuleVolumeCallbackResponse.xml5
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VNFAdapterRestDeleteResponse.xml56
16 files changed, 210 insertions, 29 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroUtils.groovy
index 9b144323c0..5ff49fbae8 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SniroUtils.groovy
@@ -322,7 +322,6 @@ class SniroUtils{
}
if((isBlank(placements) || placements.equalsIgnoreCase("[]")) && (isBlank(licenses) || licenses.equalsIgnoreCase("[]"))){
msoLogger.debug("Sniro Async Response does not contain: licenses or placements")
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Sniro Async Callback Response does not contain: licenses or placements")
}else{
return
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
index 66de6b389d..7bc48519b0 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
@@ -244,8 +244,8 @@ public class SniroHomingV2 {
ModelInfoServiceInstance modelInfo = serviceInstance.getModelInfoServiceInstance();
if(isNotBlank(modelInfo.getModelInvariantUuid()) && isNotBlank(modelInfo.getModelUuid())){
info.put("serviceInstanceId", serviceInstance.getServiceInstanceId());
- if(modelInfo.getServiceType() != null){ //temp solution
- info.put("serviceName", serviceInstance.getModelInfoServiceInstance().getServiceType());
+ if(modelInfo.getServiceType() != null && modelInfo.getServiceType().length() > 0){ //temp solution
+ info.put("serviceName", modelInfo.getServiceType());
}
info.put("modelInfo", buildModelInfo(serviceInstance.getModelInfoServiceInstance()));
}else{
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
index 554af37924..db54b219a9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
@@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils;
import org.onap.so.adapters.vnfrest.CreateVfModuleResponse;
import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse;
import org.onap.so.adapters.vnfrest.DeleteVfModuleResponse;
+import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
@@ -72,8 +73,8 @@ public class VnfAdapterImpl {
}
public void postProcessVnfAdapter(BuildingBlockExecution execution) {
- try {
- String vnfAdapterResponse = execution.getVariable("vnfAdapterRestV1Response");
+ try {
+ String vnfAdapterResponse = execution.getVariable("vnfAdapterRestV1Response");
if (!StringUtils.isEmpty( vnfAdapterResponse)) {
Object vnfRestResponse = unMarshal(vnfAdapterResponse);
if(vnfRestResponse instanceof CreateVfModuleResponse) {
@@ -98,8 +99,15 @@ public class VnfAdapterImpl {
execution.setVariable("heatStackId", heatStackId);
}else{
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "HeatStackId is missing from create VolumeGroup Vnf Adapter response.");
- }
- }
+ }
+ } else if(vnfRestResponse instanceof DeleteVolumeGroupResponse) {
+ VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
+ Boolean volumeGroupDelete = ((DeleteVolumeGroupResponse) vnfRestResponse).getVolumeGroupDeleted();
+ if(null!= volumeGroupDelete && volumeGroupDelete) {
+ volumeGroup.setHeatStackId(null);
+ execution.setVariable("heatStackId", null);
+ }
+ }
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
@@ -116,7 +124,7 @@ public class VnfAdapterImpl {
XMLReader xmlReader = spf.newSAXParser().getXMLReader();
JAXBContext jaxbContext = JAXBContext.newInstance(CreateVfModuleResponse.class,
- CreateVolumeGroupResponse.class,DeleteVfModuleResponse.class);
+ CreateVolumeGroupResponse.class,DeleteVfModuleResponse.class,DeleteVolumeGroupResponse.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
InputSource inputSource = new InputSource(new StringReader(input));
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index ab29e21dea..9e4b01eea5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -30,13 +30,13 @@ import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
-
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.logger.MsoLogger;
import org.onap.so.serviceinstancebeans.RequestReferences;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -50,7 +50,7 @@ public class WorkflowActionBBTasks {
private static final String G_REQUEST_ID = "mso-request-id";
private static final String G_ALACARTE = "aLaCarte";
private static final String G_ACTION = "requestAction";
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowActionBBTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBTasks.class);
@Autowired
private RequestsDbClient requestDbclient;
@@ -84,10 +84,14 @@ public class WorkflowActionBBTasks {
}
public void updateFlowStatistics(DelegateExecution execution) {
- int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
- if(currentSequence > 1) {
- InfraActiveRequests request = this.getUpdatedRequest(execution, currentSequence);
- requestDbclient.updateInfraActiveRequests(request);
+ try{
+ int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+ if(currentSequence > 1) {
+ InfraActiveRequests request = this.getUpdatedRequest(execution, currentSequence);
+ requestDbclient.updateInfraActiveRequests(request);
+ }
+ }catch (Exception ex){
+ logger.warn("Bpmn Flow Statistics was unable to update Request Db with the new completion percentage. Competion percentage may be invalid.");
}
}
@@ -146,7 +150,7 @@ public class WorkflowActionBBTasks {
.getProcessDefinition(execution.getProcessDefinitionId()).getKey();
WorkflowContextHolder.getInstance().processCallback(processKey, execution.getProcessInstanceId(), requestId,
callbackResponse);
- msoLogger.info("Successfully sent sync ack.");
+ logger.info("Successfully sent sync ack.");
}
public void sendErrorSyncAck(DelegateExecution execution) {
@@ -169,7 +173,7 @@ public class WorkflowActionBBTasks {
callbackResponse);
execution.setVariable("sentSyncResponse", true);
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage());
+ logger.error(" Sending Sync Error Activity Failed. {}" , ex.getMessage(), ex);
}
}
@@ -265,8 +269,7 @@ public class WorkflowActionBBTasks {
public void abortCallErrorHandling(DelegateExecution execution) {
String msg = "Flow has failed. Rainy day handler has decided to abort the process.";
- Exception exception = new Exception(msg);
- msoLogger.error(exception);
+ logger.error(msg);
throw new BpmnError(msg);
}
@@ -280,14 +283,14 @@ public class WorkflowActionBBTasks {
request.setStatusMessage(exception.getErrorMessage());
} catch (Exception ex) {
//log error and attempt to extact WorkflowExceptionMessage
- msoLogger.error(ex);
+ logger.error("Failed to extract workflow exception from execution.",ex);
}
if (errorMsg == null){
try {
errorMsg = (String) execution.getVariable("WorkflowExceptionErrorMessage");
request.setStatusMessage(errorMsg);
} catch (Exception ex) {
- msoLogger.error(ex);
+ logger.error("Failed to extract workflow exception message from WorkflowException",ex);
request.setStatusMessage("Unexpected Error in BPMN");
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index 11a694140c..bc4831c804 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -161,7 +161,7 @@ public class VnfAdapterVfModuleObjectMapper {
GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfmoduletopologyVfModuleTopology.class);
Map<String,String> paramsMap = new HashMap<>();
- if(vnfTopology.getSdncGeneratedCloudResources() && vfModuleTopology.getSdncGeneratedCloudResources()) {
+ if( vfModuleTopology.getSdncGeneratedCloudResources()) {
buildParamsMapFromVfModuleSdncResponse(paramsMap, vfModuleTopology, true);
buildParamsMapFromVnfSdncResponse(paramsMap, vnfTopology, null, true);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
index d35296af9b..aefb84c606 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java
@@ -20,7 +20,9 @@
package org.onap.so.client.sdnc;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpStatus;
@@ -29,10 +31,16 @@ import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.MapperException;
import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
+import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
+import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
+import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -79,6 +87,9 @@ public class SdnCommonTasks {
HttpHeaders httpHeader = new HttpHeaders();
httpHeader.set("Authorization", auth);
httpHeader.setContentType(MediaType.APPLICATION_JSON);
+ List<MediaType> acceptMediaTypes = new ArrayList<MediaType>();
+ acceptMediaTypes.add(MediaType.APPLICATION_JSON);
+ httpHeader.setAccept(acceptMediaTypes);
return httpHeader;
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
index 84f056dc4d..432399b1b8 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
@@ -83,6 +83,8 @@ public class GeneralTopologyObjectMapper {
onapModelInformation.setModelCustomizationUuid(network.getModelInfoNetwork().getModelCustomizationUUID());
networkInformation.setOnapModelInformation(onapModelInformation);
}
+
+ networkInformation.setFromPreload(null);
networkInformation.setNetworkId(network.getNetworkId());
//TODO fix this after network type filed included in L3Network object type
//networkInformation.setNetworkType(network.getNetwork);
@@ -130,6 +132,7 @@ public class GeneralTopologyObjectMapper {
vfModuleInformation.setVfModuleType(vfModule.getModelInfoVfModule().getModelName());
}
vfModuleInformation.setVfModuleId(vfModule.getVfModuleId());
+ vfModuleInformation.setFromPreload(null);
return vfModuleInformation;
}
public GenericResourceApiSdncrequestheaderSdncRequestHeader buildSdncRequestHeader(SDNCSvcAction svcAction, String sdncReqId){
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java
index 24a99c97f4..2a8046b1be 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java
@@ -46,8 +46,9 @@ public class VnfAdapterImplTest extends BaseTaskTest {
private static final String VNF_ADAPTER_REST_DELETE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/VNFAdapterRestDeleteResponse.xml");
private static final String VNF_ADAPTER_REST_CREATE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/VNFAdapterRestCreateCallback.xml");
private static final String VNF_ADAPTER_VOLUME_CREATE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml");
+ private static final String VNF_ADAPTER_VOLUME_DELETE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/DeleteVfModuleVolumeCallbackResponse.xml");
private static final String TEST_VFMODULE_HEATSTACK_ID = "slowburn";
- private static final String TEST_VOLUME_HEATSTACK_ID = "testHeatStackId1";
+ private static final String TEST_VOLUME_HEATSTACK_ID = "testHeatStackId1";
@Before
public void before() {
@@ -56,6 +57,7 @@ public class VnfAdapterImplTest extends BaseTaskTest {
vfModule = setVfModule();
volumeGroup = setVolumeGroup();
vfModule.setHeatStackId(null);
+ volumeGroup.setHeatStackId(null);
}
@Test
@@ -98,13 +100,14 @@ public class VnfAdapterImplTest extends BaseTaskTest {
@Test
public void postProcessVnfAdapter_DeleteResponseTest() {
+ vfModule.setHeatStackId(TEST_VFMODULE_HEATSTACK_ID);
execution.setVariable("vnfAdapterRestV1Response", VNF_ADAPTER_REST_DELETE_RESPONSE);
vnfAdapterImpl.postProcessVnfAdapter(execution);
assertNull(vfModule.getHeatStackId());
}
@Test
- public void postProcessVnfAdapter_ResponseNullTest() {
+ public void postProcessVnfAdapter_ResponseNullTest() {
execution.setVariable("vnfAdapterRestV1Response", null);
vnfAdapterImpl.postProcessVnfAdapter(execution);
assertNull(vfModule.getHeatStackId());
@@ -119,9 +122,10 @@ public class VnfAdapterImplTest extends BaseTaskTest {
@Test
public void postProcessVnfAdapter_DeleteResponseTest_VfModuleDeletedFalse() {
+ vfModule.setHeatStackId(TEST_VFMODULE_HEATSTACK_ID);
execution.setVariable("vnfAdapterRestV1Response", "<deleteVfModuleResponse><vfModuleDeleted>false</vfModuleDeleted></deleteVfModuleResponse>");
vnfAdapterImpl.postProcessVnfAdapter(execution);
- assertNull(vfModule.getHeatStackId());
+ assertEquals(TEST_VFMODULE_HEATSTACK_ID, vfModule.getHeatStackId());
}
@Test
@@ -133,9 +137,10 @@ public class VnfAdapterImplTest extends BaseTaskTest {
@Test
public void postProcessVnfAdapter_DeleteResponseTest_EmptyVfModuleDeletedTag() {
+ vfModule.setHeatStackId(TEST_VFMODULE_HEATSTACK_ID);
execution.setVariable("vnfAdapterRestV1Response", "<deleteVfModuleResponse></deleteVfModuleResponse>");
vnfAdapterImpl.postProcessVnfAdapter(execution);
- assertNull(vfModule.getHeatStackId());
+ assertEquals(TEST_VFMODULE_HEATSTACK_ID, vfModule.getHeatStackId());
}
@Test
@@ -157,10 +162,43 @@ public class VnfAdapterImplTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
execution.setVariable("vnfAdapterRestV1Response", "<createVolumeGroupResponse></createVolumeGroupResponse>");
vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertNull(volumeGroup.getHeatStackId());
}
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_DeleteVolumeGroup() {
+ volumeGroup.setHeatStackId(TEST_VOLUME_HEATSTACK_ID);
+ execution.setVariable("vnfAdapterRestV1Response", VNF_ADAPTER_VOLUME_DELETE_RESPONSE);
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertNull(volumeGroup.getHeatStackId());
+ }
+
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_VolumeGroupDeletedFalse() {
+ volumeGroup.setHeatStackId(TEST_VOLUME_HEATSTACK_ID);
+ execution.setVariable("vnfAdapterRestV1Response", "<deleteVolumeGroupResponse><volumeGroupDeleted>false</volumeGroupDeleted></deleteVolumeGroupResponse>");
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertEquals(TEST_VOLUME_HEATSTACK_ID, volumeGroup.getHeatStackId());
+ }
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_EmptyDeleteVolumeGroupResponseTag() {
+ expectedException.expect(BpmnError.class);
+ execution.setVariable("vnfAdapterRestV1Response", "<volumeGroupDeleted></volumeGroupDeleted>");
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ }
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_EmptyVolumeGroupDeletedTag() {
+ volumeGroup.setHeatStackId(TEST_VOLUME_HEATSTACK_ID);
+ execution.setVariable("vnfAdapterRestV1Response", "<deleteVolumeGroupResponse></deleteVolumeGroupResponse>");
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertEquals(TEST_VOLUME_HEATSTACK_ID, volumeGroup.getHeatStackId());
+ }
@Test
- public void postProcessVnfAdapterExceptionTest() {
+ public void postProcessVnfAdapterExceptionTest() {
execution.setVariable("vnfAdapterRestV1Response", VNF_ADAPTER_REST_CREATE_RESPONSE);
expectedException.expect(BpmnError.class);
lookupKeyMap.clear();
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformation.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformation.json
index cc32040f38..91d64b98ca 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformation.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformation.json
@@ -47,6 +47,7 @@
"model-uuid" : "modelUuid",
"model-invariant-uuid" : "modelInvariantUuid"
},
+ "from-preload": null,
"network-id" : "TEST_NETWORK_ID",
"network-type" : null
}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationNoNetworkName.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationNoNetworkName.json
index 40946725d9..95a2af3880 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationNoNetworkName.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationNoNetworkName.json
@@ -46,6 +46,7 @@
"model-uuid" : "modelUuid",
"model-invariant-uuid" : "modelInvariantUuid"
},
+ "from-preload": null,
"network-id" : "TEST_NETWORK_ID",
"network-type" : null
}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationUnAssign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationUnAssign.json
index 7ca8153def..a7cf1e1434 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationUnAssign.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiNetworkOperationInformationUnAssign.json
@@ -47,6 +47,7 @@
"model-uuid" : "modelUuid",
"model-invariant-uuid" : "modelInvariantUuid"
},
+ "from-preload": null,
"network-id" : "TEST_NETWORK_ID",
"network-type" : null
}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json
index 50d5642fee..a344e8081e 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationAssign.json
@@ -55,6 +55,7 @@
"model-invariant-uuid" : "vfModuleModelInvariantUuid"
},
"vf-module-id" : "testVfModuleId",
+ "from-preload" : null,
"vf-module-type": "vfModuleModelName"
},
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json
index 64192ff8d0..f06d72a806 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/genericResourceApiVfModuleOperationInformationUnassign.json
@@ -21,8 +21,9 @@
"svc-action" : "unassign"
},
"vf-module-information" : {
- "vf-module-id" : "testVfModuleId"
- },
+ "vf-module-id" : "testVfModuleId",
+ "from-preload": null
+ },
"vnf-information" : {
"vnf-id" : "testVnfId",
"vnf-type" : "testVnfType"
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml
new file mode 100644
index 0000000000..feb7ede50b
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<createVolumeGroupResponse>
+ <messageId>{{MESSAGE-ID}}</messageId>
+ <volumeGroupCreated>true</volumeGroupCreated>
+ <volumeGroupId>d485ecee-957c-4a0a-8b95-27a22b90103f</volumeGroupId>
+ <volumeGroupOutputs>
+ <entry>
+ <key>mmsc_vol_1</key>
+ <value>a73e0fe9-1ce8-49c2-8fef-e2788605be29</value>
+ </entry>
+ <entry>
+ <key>mmsc_vol_2</key>
+ <value>37b6455a-5ea8-463a-89e3-0efeaf7b7c6d</value>
+ </entry>
+ <entry>
+ <key>nemsfe_vol_1</key>
+ <value>b7ff1c21-d138-49a3-bf13-4cfd91efaf48</value>
+ </entry>
+ <entry>
+ <key>nemsbe_vol_1</key>
+ <value>a5988471-cd42-44d8-b078-64f2f13d3d4c</value>
+ </entry>
+ <entry>
+ <key>mmsc_vol_5</key>
+ <value>f7b91c1e-ab8c-413a-a850-ba80a246c7e0</value>
+ </entry>
+ <entry>
+ <key>nemsfe_vol_2</key>
+ <value>957ea3f3-2d4a-4707-bfd2-ba66f42037c2</value>
+ </entry>
+ <entry>
+ <key>mmsc_vol_3</key>
+ <value>de6fccfe-d61a-48b0-b03b-87bf1bf749b3</value>
+ </entry>
+ <entry>
+ <key>mmsc_vol_4</key>
+ <value>76162310-2c38-4c32-981c-5c2880190077</value>
+ </entry>
+ </volumeGroupOutputs>
+ <volumeGroupRollback>
+ <cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <messageId>e585e4f4-9452-437a-b294-45a2d6d3b7a3</messageId>
+ <msoRequest>
+ <requestId>c30b9453-4b68-4c2e-aacf-58a5ba648bf5</requestId>
+ <serviceInstanceId>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</serviceInstanceId>
+ </msoRequest>
+ <tenantId>1bbab536a19b4756926e7d0ec1eb543c</tenantId>
+ <volumeGroupCreated>true</volumeGroupCreated>
+ <volumeGroupId>78987</volumeGroupId>
+ <volumeGroupStackId>ZRDM1MMSC01_base_vol/7f74e5e1-5fc1-4593-ac7e-cc9899a106ef</volumeGroupStackId>
+ </volumeGroupRollback>
+ <volumeGroupStackId>testHeatStackId1</volumeGroupStackId>
+</createVolumeGroupResponse>
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/DeleteVfModuleVolumeCallbackResponse.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/DeleteVfModuleVolumeCallbackResponse.xml
new file mode 100644
index 0000000000..25aa45afd9
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/DeleteVfModuleVolumeCallbackResponse.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<deleteVolumeGroupResponse>
+ <messageId>{{MESSAGE-ID}}</messageId>
+ <volumeGroupDeleted>true</volumeGroupDeleted>
+</deleteVolumeGroupResponse>
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VNFAdapterRestDeleteResponse.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VNFAdapterRestDeleteResponse.xml
new file mode 100644
index 0000000000..b5b61192f7
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VNFAdapterRestDeleteResponse.xml
@@ -0,0 +1,56 @@
+<deleteVfModuleResponse>
+ <messageId>testMessageId</messageId>
+ <vfModuleDeleted>true</vfModuleDeleted>
+ <vfModuleId>testVfModuleId</vfModuleId>
+ <vfModuleOutputs>
+ <entry>
+ <key>key1</key>
+ <value>value1</value>
+ </entry>
+ <entry>
+ <key>key2</key>
+ <value>value2</value>
+ </entry>
+ <entry>
+ <key>server1_private_ip</key>
+ <value>192.168.28.3</value>
+ </entry>
+ <entry>
+ <key>contrail-service-instance-fqdn</key>
+ <value>default-domain:MSOTest:MsoNW-RA</value>
+ </entry>
+ <entry>
+ <key>policyKey1_contrail_network_policy_fqdn</key>
+ <value>MSOTest:DefaultPolicyFQDN1</value>
+ </entry>
+ <entry>
+ <key>policyKey2_contrail_network_policy_fqdn</key>
+ <value>MSOTest:DefaultPolicyFQDN2</value>
+ </entry>
+ <entry>
+ <key>oam_management_v6_address</key>
+ <value>2000:abc:bce:1111</value>
+ </entry>
+ <entry>
+ <key>oam_management_v4_address</key>
+ <value>127.0.0.1</value>
+ </entry>
+ <entry>
+ <key>internal_security_group</key>
+ <value>test_internal_security_group</value>
+ </entry>
+ <entry>
+ <key>int_internal_net_id</key>
+ <value>test_int_internal_net_id</value>
+ </entry>
+ <entry>
+ <key>dsx_server_group_id</key>
+ <value>test_dsx_server_group_id</value>
+ </entry>
+ <entry>
+ <key>mcas_host_key</key>
+ <value>test_mcas_host_key</value>
+ </entry>
+ </vfModuleOutputs>
+ <vnfId>testVnfId</vnfId>
+</deleteVfModuleResponse> \ No newline at end of file