summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-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.java93
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java8
-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.java31
-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/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java36
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java23
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/l3NetworkBbObject.json8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/payloadUpdateCreated.json8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion25.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegionError.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponse.json8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryIdAAIResponse.xml8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/unassignNetworkBB_queryAAIResponse_.json4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/updateContrailAAIPayloadRequest.xml8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/generalBB.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/queryAAINetwork.json8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiQueryAAIResponse-Wrapper.json8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/queryAAICloudRegion.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/sniroCallbackInfraVnf2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/SDNCClientResponseIncorrectPath.json29
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VfModule-supercool.xml2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VolumeGroup.xml2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml11
33 files changed, 455 insertions, 121 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 24246273e8..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";
@@ -162,18 +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));
- }
- }
- }
-
if (aLaCarte) {
if (orchFlows == null || orchFlows.isEmpty()) {
orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte);
@@ -268,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);
}
@@ -281,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.");
}
@@ -664,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/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
index 57c760b01f..79a75c532a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
@@ -27,6 +27,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.UUID;
+import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.modelmapper.PropertyMap;
import org.onap.so.adapters.nwrest.ContrailNetwork;
@@ -129,7 +130,12 @@ public class NetworkAdapterObjectMapper {
deleteNetworkRequest.setMsoRequest(createMsoRequest(requestContext, serviceInstance));
deleteNetworkRequest.setNetworkId(l3Network.getNetworkId());
- deleteNetworkRequest.setNetworkStackId(l3Network.getHeatStackId());
+ if (!StringUtils.isEmpty(l3Network.getHeatStackId())){
+ deleteNetworkRequest.setNetworkStackId(l3Network.getHeatStackId());
+ }
+ else {
+ deleteNetworkRequest.setNetworkStackId(l3Network.getNetworkName());
+ }
deleteNetworkRequest.setNetworkType(l3Network.getNetworkType());
deleteNetworkRequest.setSkipAAI(true);
deleteNetworkRequest.setTenantId(cloudRegion.getTenantId());
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 560f2a91bf..1a302c29a7 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
@@ -169,6 +169,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);
@@ -179,7 +180,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);
@@ -191,6 +205,7 @@ public class AAIUpdateTasksTest extends BaseTaskTest{
@Test
public void updateOrchestrationStatusAssignedOrPendingActivationVfModuleExceptionTest() throws Exception {
+ execution.setVariable("aLaCarte", true);
doThrow(Exception.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 dabdc6811c..85915bd4b4 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
@@ -22,6 +22,7 @@ package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -34,6 +35,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.UUID;
+import org.camunda.bpm.engine.delegate.BpmnError;
import org.junit.Before;
import org.junit.Test;
import org.onap.appc.client.lcm.model.Action;
@@ -79,9 +81,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());
@@ -101,9 +103,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");
@@ -121,5 +123,54 @@ 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(Exception.class).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 9f0bb910e6..e5e092aace 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
@@ -22,6 +22,7 @@ package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -29,6 +30,7 @@ import java.util.HashMap;
import java.util.Optional;
import java.util.UUID;
+import org.camunda.bpm.engine.delegate.BpmnError;
import org.junit.Before;
import org.junit.Test;
import org.onap.appc.client.lcm.model.Action;
@@ -100,4 +102,33 @@ 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(Exception.class).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 fa5081da2f..5ef020d6ed 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
@@ -51,7 +51,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();
@@ -91,6 +91,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
si.setConfigurations(configurations);
execution.setVariable("flowToBeCalled", flowToBeCalled);
+ execution.setVariable("aLaCarte", true);
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
buildingBlockDetail.setBuildingBlockName("UnassignFabricConfigurationBB");
@@ -188,6 +189,7 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest {
String flowToBeCalled = "UnassignServiceInstanceBB";
execution.setVariable("flowToBeCalled", flowToBeCalled);
+ execution.setVariable("aLaCarte", true);
BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail();
buildingBlockDetail.setBuildingBlockName("UnassignServiceInstanceBB");
@@ -209,7 +211,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();
@@ -246,7 +248,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();
@@ -282,7 +284,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();
@@ -318,7 +320,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();
@@ -354,7 +356,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();
@@ -384,4 +386,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 65d16adb40..c27b5dd655 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
@@ -1318,7 +1318,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);
@@ -1344,6 +1344,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/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
index 8f0d00ff86..1283d3ab1a 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
@@ -301,6 +301,42 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{
}
@Test
+ public void deleteNetworkRequestNoHeatIdMapperTest() throws Exception {
+ DeleteNetworkRequest expectedDeleteNetworkRequest = new DeleteNetworkRequest();
+
+ String messageId = "messageId";
+ expectedDeleteNetworkRequest.setMessageId(messageId);
+ doReturn(messageId).when(SPY_networkAdapterObjectMapper).getRandomUuid();
+
+ ModelInfoNetwork modelInfoNetwork = new ModelInfoNetwork();
+ l3Network.setModelInfoNetwork(modelInfoNetwork);
+ modelInfoNetwork.setModelCustomizationUUID("modelCustomizationUuid");
+ expectedDeleteNetworkRequest.setModelCustomizationUuid(modelInfoNetwork.getModelCustomizationUUID());
+
+ MsoRequest msoRequest = new MsoRequest();
+ msoRequest.setRequestId(requestContext.getMsoRequestId());
+ msoRequest.setServiceInstanceId(serviceInstance.getServiceInstanceId());
+ expectedDeleteNetworkRequest.setMsoRequest(msoRequest);
+
+ expectedDeleteNetworkRequest.setNetworkId(l3Network.getNetworkId());
+
+ l3Network.setNetworkName("heatStackId");
+ expectedDeleteNetworkRequest.setNetworkStackId("heatStackId");
+
+ expectedDeleteNetworkRequest.setNetworkType(l3Network.getNetworkType());
+
+ expectedDeleteNetworkRequest.setSkipAAI(true);
+
+ expectedDeleteNetworkRequest.setTenantId(cloudRegion.getTenantId());
+
+ expectedDeleteNetworkRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId());
+
+ DeleteNetworkRequest deleteNetworkRequest = SPY_networkAdapterObjectMapper.deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network);
+
+ assertThat(expectedDeleteNetworkRequest, sameBeanAs(deleteNetworkRequest));
+ }
+
+ @Test
public void buildOpenstackSubnetListTest() throws Exception {
ObjectMapper omapper = new ObjectMapper();
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
index 04397c499d..f492ba3ead 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
@@ -27,7 +27,10 @@ import static org.junit.Assert.assertNull;
import java.nio.file.Files;
import java.nio.file.Paths;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
@@ -40,6 +43,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
@@ -80,8 +84,8 @@ public class VfModuleTopologyOperationRequestMapperTest {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
//
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
- userParams.put("key1", "value1");
+ HashMap<String,String> userParams = new HashMap<String,String>();
+ userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
@@ -108,7 +112,7 @@ public class VfModuleTopologyOperationRequestMapperTest {
modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
vfModule.setModelInfoVfModule(modelInfoVfModule);
HashMap<String, String> cloudParams = new HashMap<String, String>();
- userParams.put("key2", "value2");
+ cloudParams.put("key2", "value2");
vfModule.setCloudParams(cloudParams);
VolumeGroup volumeGroup = new VolumeGroup();
@@ -189,9 +193,14 @@ public class VfModuleTopologyOperationRequestMapperTest {
customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
//
RequestContext requestContext = new RequestContext();
- HashMap<String, String> userParams = new HashMap<String, String>();
- userParams.put("key1", "value1");
- requestContext.setUserParams(userParams);
+ RequestParameters requestParameters = new RequestParameters();
+ HashMap<String,Object> userParams1 = new HashMap<String,Object>();
+ userParams1.put("key1", "value1");
+ List<Map<String,Object>> userParams = new ArrayList<Map<String,Object>>();
+ userParams.add(userParams1);
+
+ requestParameters.setUserParams(userParams);
+ requestContext.setRequestParameters(requestParameters);
requestContext.setProductFamilyId("productFamilyId");
GenericVnf vnf = new GenericVnf();
@@ -225,7 +234,7 @@ public class VfModuleTopologyOperationRequestMapperTest {
assertNull(vfModuleSDNCrequest.getServiceInformation().getOnapModelInformation().getModelCustomizationUuid());
assertEquals("vnfModelCustomizationUuid", vfModuleSDNCrequest.getVnfInformation().getOnapModelInformation().getModelCustomizationUuid());
- assertEquals("vfModuleModelCustomizationUuid", vfModuleSDNCrequest.getVfModuleInformation().getOnapModelInformation().getModelCustomizationUuid());
+ assertEquals("vfModuleModelCustomizationUuid", vfModuleSDNCrequest.getVfModuleInformation().getOnapModelInformation().getModelCustomizationUuid());
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/l3NetworkBbObject.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/l3NetworkBbObject.json
index d5d234cbf6..e052360c6c 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/l3NetworkBbObject.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/l3NetworkBbObject.json
@@ -107,11 +107,11 @@
},
{
"related-to": "cloud-region",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
@@ -127,11 +127,11 @@
},
{
"related-to": "tenant",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/payloadUpdateCreated.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/payloadUpdateCreated.json
index aa6320801e..84ce037a2d 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/payloadUpdateCreated.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/payloadUpdateCreated.json
@@ -102,11 +102,11 @@
},
{
"related-to": "cloud-region",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
@@ -122,11 +122,11 @@
},
{
"related-to": "tenant",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion.json
index 5addff2d70..0185d56d06 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion.json
@@ -1,5 +1,5 @@
{
- "cloud-owner": "att-aic",
+ "cloud-owner": "CloudOwner",
"cloud-region-id": "mtn6",
"cloud-type": "openstack",
"owner-defined-type": "LCP",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion25.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion25.json
index fadbf9c244..d850e51593 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion25.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion25.json
@@ -1,5 +1,5 @@
{
- "cloud-owner": "att-aic",
+ "cloud-owner": "CloudOwner",
"cloud-region-id": "mtn6",
"cloud-type": "openstack",
"owner-defined-type": "LCP",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegionError.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegionError.json
index 97611c1d62..ab98fa4b70 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegionError.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegionError.json
@@ -1,5 +1,5 @@
{
- "cloud-owner": "att-aic",
+ "cloud-owner": "CloudOwner",
"cloud-region-id": "ERROR",
"cloud-type": "openstack",
"owner-defined-type": "LCP",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json
index 181494dff2..5432133631 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json
@@ -73,11 +73,11 @@
{
"related-to": "cloud-region",
"relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/DYH1A",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/DYH1A",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
@@ -94,11 +94,11 @@
{
"related-to": "tenant",
"relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/att-aic/DYH1A/tenants/tenant/2871503957144f72b3cf481b379828ec",
+ "related-link": "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/DYH1A/tenants/tenant/2871503957144f72b3cf481b379828ec",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponse.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponse.json
index b22f389c40..81f9a78e86 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponse.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponse.json
@@ -73,11 +73,11 @@
},
{
"related-to": "cloud-region",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
@@ -91,11 +91,11 @@
},
{
"related-to": "tenant",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryIdAAIResponse.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryIdAAIResponse.xml
index 6dd91c64c9..5e1e2f62a3 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryIdAAIResponse.xml
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/queryIdAAIResponse.xml
@@ -68,10 +68,10 @@
</relationship>
<relationship>
<related-to>cloud-region</related-to>
- <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6</related-link>
+ <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6</related-link>
<relationship-data>
<relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
+ <relationship-value>CloudOwner</relationship-value>
</relationship-data>
<relationship-data>
<relationship-key>cloud-region.cloud-region-id</relationship-key>
@@ -84,10 +84,10 @@
</relationship>
<relationship>
<related-to>tenant</related-to>
- <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8</related-link>
+ <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8</related-link>
<relationship-data>
<relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
+ <relationship-value>CloudOwner</relationship-value>
</relationship-data>
<relationship-data>
<relationship-key>cloud-region.cloud-region-id</relationship-key>
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/unassignNetworkBB_queryAAIResponse_.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/unassignNetworkBB_queryAAIResponse_.json
index f076c9044c..a99d25bdc9 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/unassignNetworkBB_queryAAIResponse_.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/unassignNetworkBB_queryAAIResponse_.json
@@ -73,11 +73,11 @@
},
{
"related-to": "cloud-region",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/updateContrailAAIPayloadRequest.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/updateContrailAAIPayloadRequest.xml
index 92fec2dc64..8b70a139e6 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/updateContrailAAIPayloadRequest.xml
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/Network/updateContrailAAIPayloadRequest.xml
@@ -71,10 +71,10 @@
</relationship>
<relationship>
<related-to>cloud-region</related-to>
- <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6</related-link>
+ <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6</related-link>
<relationship-data>
<relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
+ <relationship-value>CloudOwner</relationship-value>
</relationship-data>
<relationship-data>
<relationship-key>cloud-region.cloud-region-id</relationship-key>
@@ -87,10 +87,10 @@
</relationship>
<relationship>
<related-to>tenant</related-to>
- <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8</related-link>
+ <related-link>/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8</related-link>
<relationship-data>
<relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
+ <relationship-value>CloudOwner</relationship-value>
</relationship-data>
<relationship-data>
<relationship-key>cloud-region.cloud-region-id</relationship-key>
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/generalBB.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/generalBB.json
index 4817dfb74d..6c6981b96a 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/generalBB.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/generalBB.json
@@ -133,7 +133,7 @@
},
"cloudRegion" : {
"lcp-cloud-region-id" : "DYH1A",
- "cloud-owner" : "att-aic",
+ "cloud-owner" : "CloudOwner",
"tenant-id" : "7f3db563322146a688601ade1294a749",
"complex" : "c1",
"cloud-region-version" : "aic3.0"
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/queryAAINetwork.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/queryAAINetwork.json
index 36bc04b6c6..2a5a18f613 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/queryAAINetwork.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/queryAAINetwork.json
@@ -73,11 +73,11 @@
{
"related-to": "cloud-region",
"relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/att-aic/DYH1A",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/DYH1A",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
@@ -94,11 +94,11 @@
{
"related-to": "tenant",
"relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/att-aic/DYH1A/tenants/tenant/7f3db563322146a688601ade1294a749",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/DYH1A/tenants/tenant/7f3db563322146a688601ade1294a749",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiQueryAAIResponse-Wrapper.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiQueryAAIResponse-Wrapper.json
index b22f389c40..81f9a78e86 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiQueryAAIResponse-Wrapper.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiQueryAAIResponse-Wrapper.json
@@ -73,11 +73,11 @@
},
{
"related-to": "cloud-region",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
@@ -91,11 +91,11 @@
},
{
"related-to": "tenant",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn6/tenants/tenant/0422ffb57ba042c0800a29dc85ca70f8",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
- "relationship-value": "att-aic"
+ "relationship-value": "CloudOwner"
},
{
"relationship-key": "cloud-region.cloud-region-id",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/queryAAICloudRegion.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/queryAAICloudRegion.json
index 5addff2d70..0185d56d06 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/queryAAICloudRegion.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/queryAAICloudRegion.json
@@ -1,5 +1,5 @@
{
- "cloud-owner": "att-aic",
+ "cloud-owner": "CloudOwner",
"cloud-region-id": "mtn6",
"cloud-type": "openstack",
"owner-defined-type": "LCP",
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/sniroCallbackInfraVnf b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/sniroCallbackInfraVnf
index 9159d80c43..f1ba9c52fe 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/sniroCallbackInfraVnf
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/sniroCallbackInfraVnf
@@ -15,7 +15,7 @@
"assignmentInfo": [
{
"variableName": "cloudOwner",
- "variableValue": "att-aic"
+ "variableValue": "CloudOwner"
},
{
"variableName": "vnfHostName",
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
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VfModule-supercool.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VfModule-supercool.xml
index 5a2b7300b1..2d1ce54f9d 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VfModule-supercool.xml
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VfModule-supercool.xml
@@ -12,7 +12,7 @@
<related-to>volume-group</related-to>
<relationship-data>
<relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
+ <relationship-value>CloudOwner</relationship-value>
</relationship-data>
<relationship-data>
<relationship-key>cloud-region.cloud-region-id</relationship-key>
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VolumeGroup.xml b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VolumeGroup.xml
index 7e913dd418..ff33ca3e07 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VolumeGroup.xml
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/VfModularity/VolumeGroup.xml
@@ -10,7 +10,7 @@
<related-to>tenant</related-to>
<relationship-data>
<relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>att-aic</relationship-value>
+ <relationship-value>CloudOwner</relationship-value>
</relationship-data>
<relationship-data>
<relationship-key>cloud-region.cloud-region-id</relationship-key>
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml
index 6f67a9ccc4..d9ad1363e4 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml
+++ b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml
@@ -1,6 +1,7 @@
aai:
auth: 26AFB797A6A57960D5D718491925C50F77CDC22AC394B3DBA09950D8FD1C0764
endpoint: http://localhost:${wiremock.server.port}
+ pnfEntryNotificationTimeout: P14D
appc:
client:
key: iaEMAfjsVsZnraBP
@@ -29,6 +30,16 @@ log:
sdncAdapter: 'true'
vnfAdapterCreateV1: 'true'
vnfAdapterRestV1: 'true'
+pnf:
+ dmaap:
+ host: hostTest
+ port: 1234
+ protocol: http
+ uriPathPrefix: events
+ topicName: pnfReady
+ consumerGroup: consumerGroup
+ consumerId: consumerId
+ topicListenerDelayInSeconds: 5
mso:
adapters:
requestDb: