aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-11-07 18:30:09 -0500
committerRob Daugherty <rd472p@att.com>2018-11-07 20:45:00 -0500
commiteec3403e1439f536a2aaf89474a6d4b1ca08df29 (patch)
tree9f86c14d0a4bc5e5ebc8f519ad452502451ba5e7 /bpmn/so-bpmn-tasks/src
parent61affc6311906aee71b16ee8632c1e7468cd1990 (diff)
parent29641940921b96ed1367958c14e6da2be6577575 (diff)
11/7: merge casablanca to master
Commit: dbb53cabbff772880134699eb81dee775d7df8df Subject: Send correct resourceModuleName Issue: SO-1178 Commit: d3759e15184562647ea83b92cf02140fc705cb0d by ss835w Subject: Update Regex Logic to take into account new scale out URI... Issue: SO-117 Commit: 5dadc2c5790c961a74085d3d10b6f5aec6b7ba30 Subject: Fix msb url in homing cloudsite Issue: SO-1180 Commit: 9a9b0fa23afe8d46171fe95f1090de5a7f701d3d Subject: Updated Reference data for AutoScaleOut Issue: SO-1174 Commit: 3178cad6c756140b18eb658277598e3e2d2d3dcf Subject: ConfigurationParameter is empty for scaleout Issue: SO-1083 Commit: 402bf528e9a796f6ce31ad36c16316c2b31acc48 Subject: Added Null check for gtConfigurationParameter Issue: SO-1179 Commit: fb6ab40a64e74876ba1f08c4d3bdb6a040c21b94 Subject: Bug fixes November 5th Issue: SO-1188 Commit: ce37ae979311ed4e55150426d477db262773beb0 Subject: Removed slashes and added catch block Issue: SO-1183 Commit: 16aa0b6cc42c7287fc080c81451e301c0acc14cf Subject: removed retry from rainy day table Issue: SO-1185 Commit: 2073a3b4c20965252c7f3a0c1aea8e4407e876fa Subject: Fixing scaleOut workflow looping issue Issue: SO-1182 Commit: 5ca364a5e975877244ee51796602043a4b078a23 Subject: Make homingBB optinal and fix homing process Issue: SO-1168 Commit: 1c554c3332ccf6be4e576e9159bbb0f901197379 Subject: bug fixing with reading dmaap message Issue: SO-1191 Change-Id: Id747bc05b791787f304316396bc5fcd20d350b6f Issue-ID: SO-1190 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java59
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java30
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java23
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java96
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOutTest.java63
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheckTest.java30
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java50
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientResponseIncorrectPath.json29
12 files changed, 343 insertions, 73 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
new file mode 100644
index 0000000000..612051f903
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2018 Bell Canada.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.so.bpmn.buildingblock;
+
+import java.util.Map;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HomingV2 {
+
+ @Autowired
+ private OofHomingV2 oofHomingV2;
+ @Autowired
+ private SniroHomingV2 sniroHomingV2;
+
+ private static final String HOMINGSOLUTION = "Homing_Solution";
+
+ public void callHoming(BuildingBlockExecution execution) {
+ if (isOof(execution)) {
+ oofHomingV2.callOof(execution);
+ } else {
+ sniroHomingV2.callSniro(execution);
+ }
+ }
+
+ public void processSolution(BuildingBlockExecution execution, String asyncResponse) {
+ if (isOof(execution)) {
+ oofHomingV2.processSolution(execution, asyncResponse);
+ } else {
+ sniroHomingV2.processSolution(execution, asyncResponse);
+ }
+ }
+
+ // Default solution is SNIRO. OOF gets called only if specified.
+ private boolean isOof(BuildingBlockExecution execution) {
+ for (Map<String, Object> params : execution.getGeneralBuildingBlock().getRequestContext().getRequestParameters()
+ .getUserParams()) {
+ if (params.containsKey(HOMINGSOLUTION) && params.get(HOMINGSOLUTION).equals("oof")) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
index 87c04d7ecc..38261c0f1a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
@@ -54,6 +54,7 @@ import org.springframework.stereotype.Component;
@Component
public class AAIUpdateTasks {
private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIUpdateTasks.class);
+ private static final String ALACARTE = "aLaCarte";
private static final String MULTI_STAGE_DESIGN_OFF = "false";
private static final String MULTI_STAGE_DESIGN_ON = "true";
@Autowired
@@ -196,7 +197,8 @@ public class AAIUpdateTasks {
if (vnf.getModelInfoGenericVnf() != null) {
multiStageDesign = vnf.getModelInfoGenericVnf().getMultiStageDesign();
}
- if (multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) {
+ boolean aLaCarte = (boolean) execution.getVariable(ALACARTE);
+ if (aLaCarte && multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) {
aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule,vnf,OrchestrationStatus.PENDING_ACTIVATION);
}
else {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java
index d13c5db871..615b7279dc 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java
@@ -37,6 +37,7 @@ import org.onap.so.client.appc.ApplicationControllerAction;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -95,10 +96,13 @@ public class ConfigurationScaleOut {
for (Map.Entry<String,String> entry : param.entrySet()) {
key = entry.getKey();
paramValue = entry.getValue();
- configScaleOutParam = JsonPath.parse(sdncVfModuleQueryResponse).read(paramValue);
- if(configScaleOutParam != null){
- paramsMap.put(key, configScaleOutParam);
+ try{
+ configScaleOutParam = JsonPath.parse(sdncVfModuleQueryResponse).read(paramValue);
+ }catch(ClassCastException e){
+ configScaleOutParam = null;
+ msoLogger.warnSimple("Incorrect JSON path. Path points to object rather than value causing: ", e);
}
+ paramsMap.put(key, configScaleOutParam);
}
}
}
@@ -107,7 +111,6 @@ public class ConfigurationScaleOut {
configPayload.setConfigurationParameters(paramsMap);
configPayload.setRequestParameters(requestParameters);
configScaleOutPayloadString = mapper.writeValueAsString(configPayload);
- configScaleOutPayloadString = configScaleOutPayloadString.replaceAll("\"", "\\\\\"");
execution.setVariable(ACTION, actionCategory);
execution.setVariable(MSO_REQUEST_ID, gBBInput.getRequestContext().getMsoRequestId());
@@ -122,6 +125,9 @@ public class ConfigurationScaleOut {
}
public void callAppcClient(BuildingBlockExecution execution) {
+ msoLogger.trace("Start runAppcCommand ");
+ String appcCode = "1002";
+ String appcMessage = "";
try{
Action commandAction = Action.valueOf(execution.getVariable(ACTION));
String msoRequestId = execution.getVariable(MSO_REQUEST_ID);
@@ -135,10 +141,22 @@ public class ConfigurationScaleOut {
HashMap<String, String> payloadInfo = new HashMap<>();
payloadInfo.put(VNF_NAME, execution.getVariable(VNF_NAME));
payloadInfo.put(VFMODULE_ID,execution.getVariable(VFMODULE_ID));
+ msoLogger.debug("Running APP-C action: " + commandAction.toString());
+ msoLogger.debug("VNFID: " + vnfId);
//PayloadInfo contains extra information that adds on to payload before making request to appc
appCClient.runAppCCommand(commandAction, msoRequestId, vnfId, payloadString, payloadInfo, controllerType);
- }catch(Exception ex){
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ appcCode = appCClient.getErrorCode();
+ appcMessage = appCClient.getErrorMessage();
+
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand in ConfigurationScaleOut", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+ appcMessage = e.getMessage();
+ }
+ msoLogger.error("Error Message: " + appcMessage);
+ msoLogger.error("ERROR CODE: " + appcCode);
+ msoLogger.trace("End of runAppCommand ");
+ if (appcCode != null && !appcCode.equals("0")) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
index 61162f4d85..2dae820e95 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
@@ -32,6 +32,7 @@ import org.onap.so.client.appc.ApplicationControllerAction;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.onap.so.logger.MessageEnum;
import org.onap.so.logger.MsoLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -78,7 +79,9 @@ public class GenericVnfHealthCheck {
}
public void callAppcClient(BuildingBlockExecution execution) {
-
+ msoLogger.trace("Start runAppcCommand ");
+ String appcCode = "1002";
+ String appcMessage = "";
try {
Action action = null;
action = Action.valueOf(execution.getVariable("action"));
@@ -95,11 +98,23 @@ public class GenericVnfHealthCheck {
payloadInfo.put("vfModuleId",execution.getVariable("vfModuleId"));
payloadInfo.put("oamIpAddress",execution.getVariable("oamIpAddress"));
payloadInfo.put("vnfHostIpAddress",execution.getVariable("vnfHostIpAddress"));
+
+ msoLogger.debug("Running APP-C action: " + action.toString());
+ msoLogger.debug("VNFID: " + vnfId);
//PayloadInfo contains extra information that adds on to payload before making request to appc
appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType);
+ appcCode = appCClient.getErrorCode();
+ appcMessage = appCClient.getErrorMessage();
- } catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
- }
+ } catch (Exception e) {
+ msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+ appcMessage = e.getMessage();
+ }
+ msoLogger.error("Error Message: " + appcMessage);
+ msoLogger.error("ERROR CODE: " + appcCode);
+ msoLogger.trace("End of runAppCommand ");
+ if (appcCode != null && !appcCode.equals("0")) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
+ }
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
index 88ae3746ab..b0063c1da1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
@@ -45,6 +45,7 @@ public class OrchestrationStatusValidator {
private static final String UNKNOWN_RESOURCE_TYPE = "Building Block (%s) not set up correctly in Orchestration_Status_Validation table in CatalogDB. ResourceType=(%s), TargetAction=(%s)";
private static final String ORCHESTRATION_VALIDATION_FAIL = "Orchestration Status Validation failed. ResourceType=(%s), TargetAction=(%s), OrchestrationStatus=(%s)";
private static final String ORCHESTRATION_STATUS_VALIDATION_RESULT = "orchestrationStatusValidationResult";
+ private static final String ALACARTE = "aLaCarte";
private static final String MULTI_STAGE_DESIGN_OFF = "false";
private static final String MULTI_STAGE_DESIGN_ON = "true";
@@ -62,8 +63,10 @@ public class OrchestrationStatusValidator {
execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, null);
- String buildingBlockFlowName = execution.getFlowToBeCalled();
+ boolean aLaCarte = (boolean) execution.getVariable(ALACARTE);
+ String buildingBlockFlowName = execution.getFlowToBeCalled();
+
BuildingBlockDetail buildingBlockDetail = catalogDbClient.getBuildingBlockDetail(buildingBlockFlowName);
if (buildingBlockDetail == null) {
@@ -112,7 +115,7 @@ public class OrchestrationStatusValidator {
}
OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = catalogDbClient.getOrchestrationStatusStateTransitionDirective(buildingBlockDetail.getResourceType(), orchestrationStatus, buildingBlockDetail.getTargetAction());
- if(ResourceType.VF_MODULE.equals(buildingBlockDetail.getResourceType()) && OrchestrationAction.CREATE.equals(buildingBlockDetail.getTargetAction()) &&
+ if(aLaCarte && ResourceType.VF_MODULE.equals(buildingBlockDetail.getResourceType()) && OrchestrationAction.CREATE.equals(buildingBlockDetail.getTargetAction()) &&
OrchestrationStatus.PENDING_ACTIVATION.equals(orchestrationStatus)) {
org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
orchestrationStatusStateTransitionDirective = processPossibleSecondStageofVfModuleCreate(execution, previousOrchestrationStatusValidationResult,
@@ -138,11 +141,11 @@ public class OrchestrationStatusValidator {
private OrchestrationStatusStateTransitionDirective processPossibleSecondStageofVfModuleCreate(BuildingBlockExecution execution, OrchestrationStatusValidationDirective previousOrchestrationStatusValidationResult,
org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf, OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective) {
if (previousOrchestrationStatusValidationResult != null && previousOrchestrationStatusValidationResult.equals(OrchestrationStatusValidationDirective.SILENT_SUCCESS)) {
- String multiStageDesign = "false";
+ String multiStageDesign = MULTI_STAGE_DESIGN_OFF;
if (genericVnf.getModelInfoGenericVnf() != null) {
multiStageDesign = genericVnf.getModelInfoGenericVnf().getMultiStageDesign();
}
- if (multiStageDesign != null && multiStageDesign.equalsIgnoreCase("true")) {
+ if (multiStageDesign != null && multiStageDesign.equalsIgnoreCase(MULTI_STAGE_DESIGN_ON)) {
orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.CONTINUE);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index ee5f2e806a..e9dcdade9f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -81,6 +81,7 @@ public class WorkflowAction {
private static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage";
private static final String SERVICE_INSTANCES = "serviceInstances";
+ private static final String VF_MODULES = "vfModules";
private static final String WORKFLOW_ACTION_WAS_UNABLE_TO_VERIFY_IF_THE_INSTANCE_NAME_ALREADY_EXIST_IN_AAI = "WorkflowAction was unable to verify if the instance name already exist in AAI.";
private static final String G_ORCHESTRATION_FLOW = "gOrchestrationFlow";
private static final String G_ACTION = "requestAction";
@@ -104,7 +105,7 @@ public class WorkflowAction {
private static final String USERPARAMSERVICE = "service";
private static final String supportedTypes = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances";
private static final String HOMINGSOLUTION = "Homing_Solution";
- private static final String FABRIC_CONFIGURATION = "FabricConfiguration";
+ private static final String FABRIC_CONFIGURATION = "FabricConfiguration";
private static final Logger logger = LoggerFactory.getLogger(WorkflowAction.class);
@Autowired
@@ -162,19 +163,6 @@ public class WorkflowAction {
execution.setVariable("resourceId", resourceId);
execution.setVariable("resourceType", resourceType);
- if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) {
- List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters()
- .getUserParams();
- for (Map<String, Object> params : userParams) {
- if (params.containsKey(HOMINGSOLUTION)) {
- execution.setVariable("homing", true);
- execution.setVariable("callHoming", true);
- execution.setVariable("homingSolution", params.get(HOMINGSOLUTION));
- execution.setVariable("homingService", params.get(HOMINGSOLUTION));
- }
- }
- }
-
if (aLaCarte) {
if (orchFlows == null || orchFlows.isEmpty()) {
orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte);
@@ -269,9 +257,10 @@ public class WorkflowAction {
logger.info("Sorting for Vlan Tagging");
flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction);
}
+ // By default, enable homing at VNF level for CREATEINSTANCE and ASSIGNINSTANCE
if (resourceType == WorkflowType.SERVICE
- && (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE))
- && !resourceCounter.stream().filter(x -> WorkflowType.VNF.equals(x.getResourceType())).collect(Collectors.toList()).isEmpty()) {
+ && (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE))
+ && !resourceCounter.stream().filter(x -> WorkflowType.VNF.equals(x.getResourceType())).collect(Collectors.toList()).isEmpty()) {
execution.setVariable("homing", true);
execution.setVariable("calledHoming", false);
}
@@ -282,6 +271,20 @@ public class WorkflowAction {
}
}
+ // If the user set "Homing_Solution" to "none", disable homing, else if "Homing_Solution" is specified, enable it.
+ if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) {
+ List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams();
+ for (Map<String, Object> params : userParams) {
+ if (params.containsKey(HOMINGSOLUTION)) {
+ if (params.get(HOMINGSOLUTION).equals("none")) {
+ execution.setVariable("homing", false);
+ } else {
+ execution.setVariable("homing", true);
+ }
+ }
+ }
+ }
+
if (flowsToExecute.isEmpty()) {
throw new IllegalStateException("Macro did not come up with a valid execution path.");
}
@@ -665,35 +668,38 @@ public class WorkflowAction {
}
protected Resource extractResourceIdAndTypeFromUri(String uri) {
- Pattern patt = Pattern.compile(
- "[vV]\\d+.*?(?:(?:/(?<type>" + supportedTypes + ")(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?)?$");
- Matcher m = patt.matcher(uri);
- Boolean generated = false;
-
- if (m.find()) {
- logger.debug("found match on {} : {} " , uri , m);
- String type = m.group("type");
- String id = m.group("id");
- String action = m.group("action");
- if (type == null) {
- throw new IllegalArgumentException("Uri could not be parsed. No type found. " + uri);
- }
- if (action == null) {
- if (type.equals(SERVICE_INSTANCES) && (id == null || id.equals("assign"))) {
- id = UUID.randomUUID().toString();
- generated = true;
- }
- } else {
- if (action.matches(supportedTypes)) {
- id = UUID.randomUUID().toString();
- generated = true;
- type = action;
- }
- }
- return new Resource(WorkflowType.fromString(convertTypeFromPlural(type)), id, generated);
- } else {
- throw new IllegalArgumentException("Uri could not be parsed: " + uri);
- }
+ Pattern patt = Pattern.compile(
+ "[vV]\\d+.*?(?:(?:/(?<type>" + supportedTypes + ")(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?)?$");
+ Matcher m = patt.matcher(uri);
+ Boolean generated = false;
+
+ if (m.find()) {
+ logger.debug("found match on {} : {} " , uri , m);
+ String type = m.group("type");
+ String id = m.group("id");
+ String action = m.group("action");
+ if (type == null) {
+ throw new IllegalArgumentException("Uri could not be parsed. No type found. " + uri);
+ }
+ if (action == null) {
+ if (type.equals(SERVICE_INSTANCES) && (id == null || id.equals("assign"))) {
+ id = UUID.randomUUID().toString();
+ generated = true;
+ }else if (type.equals(VF_MODULES) && id.equals("scaleOut")) {
+ id = UUID.randomUUID().toString();
+ generated = true;
+ }
+ } else {
+ if (action.matches(supportedTypes)) {
+ id = UUID.randomUUID().toString();
+ generated = true;
+ type = action;
+ }
+ }
+ return new Resource(WorkflowType.fromString(convertTypeFromPlural(type)), id, generated);
+ } else {
+ throw new IllegalArgumentException("Uri could not be parsed: " + uri);
+ }
}
protected String validateResourceIdInAAI(String generatedResourceId, WorkflowType type, String instanceName,
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
index bf66283b17..6c20938780 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
@@ -184,6 +184,7 @@ public class AAIUpdateTasksTest extends BaseTaskTest{
@Test
public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleNoMultiStageTest() throws Exception {
+ execution.setVariable("aLaCarte", true);
ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
modelInfoGenericVnf.setMultiStageDesign("false");
genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
@@ -194,7 +195,20 @@ public class AAIUpdateTasksTest extends BaseTaskTest{
}
@Test
+ public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleMultiStageButNotAlacarteTest() throws Exception {
+ execution.setVariable("aLaCarte", false);
+ ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+ modelInfoGenericVnf.setMultiStageDesign("true");
+ genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
+ doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
+ aaiUpdateTasks.updateOrchestrationStatusAssignedOrPendingActivationVfModule(execution);
+ verify(aaiVfModuleResources, times(1)).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
+ assertEquals("", vfModule.getHeatStackId());
+ }
+
+ @Test
public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleWithMultiStageTest() throws Exception {
+ execution.setVariable("aLaCarte", true);
ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
modelInfoGenericVnf.setMultiStageDesign("true");
genericVnf.setModelInfoGenericVnf(modelInfoGenericVnf);
@@ -206,6 +220,7 @@ public class AAIUpdateTasksTest extends BaseTaskTest{
@Test
public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleExceptionTest() throws Exception {
+ execution.setVariable("aLaCarte", true);
doThrow(RuntimeException.class).when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.ASSIGNED);
expectedException.expect(BpmnError.class);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOutTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOutTest.java
index 00a91f0ce2..ad848a4d49 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOutTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOutTest.java
@@ -93,9 +93,9 @@ public class ConfigurationScaleOutTest extends BaseTaskTest {
controllerSelectionReference.setActionCategory("testAction");
controllerSelectionReference.setVnfType("testVnfType");
String sdncResponse = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNCClientGetResponse.json")));
- String expectedPayload = "{\\\"request-parameters\\\":{\\\"vnf-host-ip-address\\\":\\\"10.222.22.2\\\","
- + "\\\"vf-module-id\\\":\\\"testVfModuleId1\\\"},\\\"configuration-parameters\\\""
- + ":{\\\"vnf-id\\\":\\\"66dac89b-2a5b-4cb9-b22e-a7e4488fb3db\\\",\\\"availability-zone\\\":\\\"AZ-MN02\\\"}}";
+ String expectedPayload = "{\"request-parameters\":{\"vnf-host-ip-address\":\"10.222.22.2\","
+ + "\"vf-module-id\":\"testVfModuleId1\"},\"configuration-parameters\""
+ + ":{\"vnf-id\":\"66dac89b-2a5b-4cb9-b22e-a7e4488fb3db\",\"availability-zone\":\"AZ-MN02\"}}";
execution.setVariable("SDNCQueryResponse_" + vfModule.getVfModuleId(), sdncResponse);
doReturn(controllerSelectionReference).when(catalogDbClient).getControllerSelectionReferenceByVnfTypeAndActionCategory(genericVnf.getVnfType(), Action.ConfigScaleOut.toString());
@@ -115,9 +115,9 @@ public class ConfigurationScaleOutTest extends BaseTaskTest {
Action action = Action.ConfigScaleOut;
String vnfId = genericVnf.getVnfId();
String controllerType = "testType";
- String payload = "{\\\"request-parameters\\\":{\\\"vnf-host-ip-address\\\":\\\"10.222.22.2\\\","
- + "\\\"vf-module-id\\\":\\\"testVfModuleId1\\\"},\\\"configuration-parameters\\\""
- + ":{\\\"vnf-id\\\":\\\"66dac89b-2a5b-4cb9-b22e-a7e4488fb3db\\\",\\\"availability-zone\\\":\\\"AZ-MN02\\\"}}";
+ String payload = "{\"request-parameters\":{\"vnf-host-ip-address\":\"10.222.22.2\","
+ + "\"vf-module-id\":\"testVfModuleId1\"},\"configuration-parameters\""
+ + ":{\"vnf-id\":\"66dac89b-2a5b-4cb9-b22e-a7e4488fb3db\",\"availability-zone\":\"AZ-MN02\"}}";
HashMap<String, String> payloadInfo = new HashMap<String, String>();
payloadInfo.put("vnfName", "testVnfName");
payloadInfo.put("vfModuleId", "testVfModuleId");
@@ -135,5 +135,56 @@ public class ConfigurationScaleOutTest extends BaseTaskTest {
configurationScaleOut.callAppcClient(execution);
verify(appCClient, times(1)).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
}
+ @Test
+ public void setParamsForConfigurationScaleOutBadPathTest() throws Exception {
+ ControllerSelectionReference controllerSelectionReference = new ControllerSelectionReference();
+ controllerSelectionReference.setControllerName("testName");
+ controllerSelectionReference.setActionCategory("testAction");
+ controllerSelectionReference.setVnfType("testVnfType");
+ String sdncResponse = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNCClientResponseIncorrectPath.json")));
+ String expectedPayload = "{\"request-parameters\":{\"vnf-host-ip-address\":\"10.222.22.2\","
+ + "\"vf-module-id\":\"testVfModuleId1\"},\"configuration-parameters\""
+ + ":{\"vnf-id\":\"66dac89b-2a5b-4cb9-b22e-a7e4488fb3db\",\"availability-zone\":null}}";
+ execution.setVariable("SDNCQueryResponse_" + vfModule.getVfModuleId(), sdncResponse);
+
+ doReturn(controllerSelectionReference).when(catalogDbClient).getControllerSelectionReferenceByVnfTypeAndActionCategory(genericVnf.getVnfType(), Action.ConfigScaleOut.toString());
+
+ configurationScaleOut.setParamsForConfigurationScaleOut(execution);
+
+ assertEquals(genericVnf.getVnfId(), execution.getVariable("vnfId"));
+ assertEquals(genericVnf.getVnfName(), execution.getVariable("vnfName"));
+ assertEquals("ConfigScaleOut", execution.getVariable("action"));
+ assertEquals(requestContext.getMsoRequestId(), execution.getVariable("msoRequestId"));
+ assertEquals(controllerSelectionReference.getControllerName(), execution.getVariable("controllerType"));
+ assertEquals(vfModule.getVfModuleId(), execution.getVariable("vfModuleId"));
+ assertEquals(expectedPayload, execution.getVariable("payload"));
+ }
+ @Test
+ public void callAppcClientExceptionTest() throws Exception {
+ expectedException.expect(BpmnError.class);
+ Action action = Action.ConfigScaleOut;
+ String vnfId = genericVnf.getVnfId();
+ String controllerType = "testType";
+ String payload = "{\"request-parameters\":{\"vnf-host-ip-address\":\"10.222.22.2\","
+ + "\"vf-module-id\":\"testVfModuleId1\"},\"configuration-parameters\""
+ + ":{\"vnf-id\":\"66dac89b-2a5b-4cb9-b22e-a7e4488fb3db\",\"availability-zone\":\"AZ-MN02\"}}";
+ HashMap<String, String> payloadInfo = new HashMap<String, String>();
+ payloadInfo.put("vnfName", "testVnfName");
+ payloadInfo.put("vfModuleId", "testVfModuleId");
+
+ execution.setVariable("action", Action.ConfigScaleOut.toString());
+ execution.setVariable("msoRequestId", msoRequestId);
+ execution.setVariable("controllerType", controllerType);
+ execution.setVariable("vnfId", "testVnfId1");
+ execution.setVariable("vnfName", "testVnfName");
+ execution.setVariable("vfModuleId", "testVfModuleId");
+ execution.setVariable("payload", payload);
+
+
+ doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1002), eq("APPC Client Failed"));
+ doThrow(new RuntimeException("APPC Client Failed")).when(appCClient).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
+ configurationScaleOut.callAppcClient(execution);
+ verify(appCClient, times(1)).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheckTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheckTest.java
index af390d1d76..e17859969d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheckTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheckTest.java
@@ -112,4 +112,34 @@ public class GenericVnfHealthCheckTest extends BaseTaskTest {
genericVnfHealthCheck.callAppcClient(execution);
verify(appCClient, times(1)).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
}
+
+ @Test
+ public void callAppcClientExceptionTest() throws Exception {
+ expectedException.expect(BpmnError.class);
+ Action action = Action.HealthCheck;
+ String vnfId = genericVnf.getVnfId();
+ String payload = "{\"testName\":\"testValue\",}";
+ String controllerType = "testType";
+ HashMap<String, String> payloadInfo = new HashMap<String, String>();
+ payloadInfo.put("vnfName", "testVnfName");
+ payloadInfo.put("vfModuleId", "testVfModuleId");
+ payloadInfo.put("oamIpAddress", "testOamIpAddress");
+ payloadInfo.put("vnfHostIpAddress", "testOamIpAddress");
+ execution.setVariable("action", Action.HealthCheck.toString());
+ execution.setVariable("msoRequestId", msoRequestId);
+ execution.setVariable("controllerType", controllerType);
+ execution.setVariable("vnfId", "testVnfId1");
+ execution.setVariable("vnfName", "testVnfName");
+ execution.setVariable("vfModuleId", "testVfModuleId");
+ execution.setVariable("oamIpAddress", "testOamIpAddress");
+ execution.setVariable("vnfHostIpAddress", "testOamIpAddress");
+ execution.setVariable("payload", payload);
+
+ doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1002), eq("APPC Client Failed"));
+ doThrow(new RuntimeException("APPC Client Failed")).when(appCClient).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
+
+
+ genericVnfHealthCheck.callAppcClient(execution);
+ verify(appCClient, times(1)).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java
index 5496eed11d..60d456e2b5 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java
@@ -63,7 +63,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
public void test_validateOrchestrationStatus() throws Exception {
String flowToBeCalled = "AssignServiceInstanceBB";
setServiceInstance().setOrchestrationStatus(OrchestrationStatus.PRECREATED);
-
+ execution.setVariable("aLaCarte", true);
execution.setVariable("flowToBeCalled", flowToBeCalled);
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
@@ -103,6 +103,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
si.setConfigurations(configurations);
execution.setVariable("flowToBeCalled", flowToBeCalled);
+ execution.setVariable("aLaCarte", true);
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
buildingBlockDetail.setBuildingBlockName("UnassignFabricConfigurationBB");
@@ -200,6 +201,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "UnassignServiceInstanceBB";
execution.setVariable("flowToBeCalled", flowToBeCalled);
+ execution.setVariable("aLaCarte", true);
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
buildingBlockDetail.setBuildingBlockName("UnassignServiceInstanceBB");
@@ -221,7 +223,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "CreateVfModuleBB";
execution.setVariable("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
-
+ execution.setVariable("aLaCarte", true);
execution.setVariable("flowToBeCalled", flowToBeCalled);
GenericVnf genericVnf = buildGenericVnf();
@@ -258,7 +260,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "CreateVfModuleBB";
execution.setVariable("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.CONTINUE);
-
+ execution.setVariable("aLaCarte", true);
execution.setVariable("flowToBeCalled", flowToBeCalled);
GenericVnf genericVnf = buildGenericVnf();
@@ -294,7 +296,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "CreateVfModuleBB";
execution.setVariable("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
-
+ execution.setVariable("aLaCarte", true);
execution.setVariable("flowToBeCalled", flowToBeCalled);
GenericVnf genericVnf = buildGenericVnf();
@@ -330,7 +332,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "CreateVfModuleBB";
execution.setVariable("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
-
+ execution.setVariable("aLaCarte", true);
execution.setVariable("flowToBeCalled", flowToBeCalled);
GenericVnf genericVnf = buildGenericVnf();
@@ -366,7 +368,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "CreateVfModuleBB";
execution.setVariable("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
-
+ execution.setVariable("aLaCarte", true);
execution.setVariable("flowToBeCalled", flowToBeCalled);
GenericVnf genericVnf = buildGenericVnf();
@@ -396,4 +398,40 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult"));
}
+
+ @Test
+ public void test_validateOrchestrationStatusSecondStageOfMultiStageWrongAlacarteValueVfModule() throws Exception {
+ String flowToBeCalled = "CreateVfModuleBB";
+
+ execution.setVariable("orchestrationStatusValidationResult", OrchestrationStatusValidationDirective.SILENT_SUCCESS);
+ execution.setVariable("aLaCarte", false);
+ execution.setVariable("flowToBeCalled", flowToBeCalled);
+
+ GenericVnf genericVnf = buildGenericVnf();
+ ModelInfoGenericVnf modelInfoGenericVnf = genericVnf.getModelInfoGenericVnf();
+ modelInfoGenericVnf.setMultiStageDesign("true");
+ setGenericVnf().setModelInfoGenericVnf(modelInfoGenericVnf);
+ setVfModule().setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+
+ BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
+ buildingBlockDetail.setBuildingBlockName("CreateVfModuleBB");
+ buildingBlockDetail.setId(1);
+ buildingBlockDetail.setResourceType(ResourceType.VF_MODULE);
+ buildingBlockDetail.setTargetAction(OrchestrationAction.CREATE);
+
+ doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled);
+
+ OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = new OrchestrationStatusStateTransitionDirective();
+ orchestrationStatusStateTransitionDirective.setFlowDirective(OrchestrationStatusValidationDirective.SILENT_SUCCESS);
+ orchestrationStatusStateTransitionDirective.setId(1);
+ orchestrationStatusStateTransitionDirective.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION);
+ orchestrationStatusStateTransitionDirective.setResourceType(ResourceType.VF_MODULE);
+ orchestrationStatusStateTransitionDirective.setTargetAction(OrchestrationAction.ACTIVATE);
+
+ doReturn(orchestrationStatusStateTransitionDirective).when(catalogDbClient).getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.PENDING_ACTIVATION, OrchestrationAction.CREATE);
+
+ orchestrationStatusValidator.validateOrchestrationStatus(execution);
+
+ assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult"));
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
index 14398710f3..76a807056c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
@@ -821,7 +821,7 @@ public class WorkflowActionTest extends BaseTaskTest {
String uri5 = "'/v6/serviceInstances/123/vnfs";
String uri6 = "/v6/serviceInstances/123/vnfs/1234/someAction";
String uri7 = "/v6/serviceInstances/123/vnfs/1234/vfModules/5678/replace";
-
+ String uri8 = "/v6/serviceInstances/123/vnfs/1234/vfModules/scaleOut";
Resource expected1 = new Resource(WorkflowType.SERVICE, "123", true);
Resource expected2 = new Resource(WorkflowType.VNF, "1234", false);
Resource expected3 = new Resource(WorkflowType.VNF, "1234", false);
@@ -847,6 +847,10 @@ public class WorkflowActionTest extends BaseTaskTest {
result = workflowAction.extractResourceIdAndTypeFromUri(uri7);
assertEquals(expected4.getResourceId(),result.getResourceId());
assertEquals(expected4.getResourceType(),result.getResourceType());
+ result = workflowAction.extractResourceIdAndTypeFromUri(uri8);
+ assertEquals(UUID.randomUUID().toString().length(),result.getResourceId().length());
+ assertEquals("VfModule", result.getResourceType().toString());
+
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientResponseIncorrectPath.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientResponseIncorrectPath.json
new file mode 100644
index 0000000000..7e263b4465
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientResponseIncorrectPath.json
@@ -0,0 +1,29 @@
+{
+ "vnf-topology": {
+ "tenant": "0422ffb57ba042c0800a29dc85ca70f8",
+ "vnf-topology-identifier-structure": {
+ "vnf-id": "66dac89b-2a5b-4cb9-b22e-a7e4488fb3db",
+ "vnf-type": "InfraMSO_vSAMP10a_Service/InfraMSO_vSAMP10a-2 0",
+ "vnf-name": "MSO-DEV-VNF-1806HF1-InfraMSO_vSAMP10a-1XXX-GR_21"
+ },
+ "aic-clli": "AUSTTXGR",
+ "vnf-resource-assignments": {
+ "availability-zones": {
+ "availability-zone": [
+ {
+ "test":"AZ-MN02"
+ }
+ ],
+ "max-count": 1
+ }
+ },
+ "aic-cloud-region": "mtn6",
+ "onap-model-information": {
+ "model-customization-uuid": "034226ae-879a-46b5-855c-d02babcb6cb6",
+ "model-uuid": "cb79c25f-b30d-4d95-afb5-97be4021f3db",
+ "model-invariant-uuid": "e93d3a7a-446d-486b-ae48-d474a9156064",
+ "model-name": "InfraMSO_vSAMP10a-2",
+ "model-version": "1.0"
+ }
+ }
+} \ No newline at end of file