summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-06-05 16:24:37 -0400
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2019-06-06 11:26:38 -0400
commit560e84158798cb884de65e3cf33ab657f0e6e6df (patch)
tree83a5aedb750eed64fcff623742bebc63a2a07161 /bpmn/so-bpmn-tasks
parent5f4c4f3f3215eb136f9c4f84f51dc8fcd5fe0353 (diff)
parent59eff996497691e0fc82b627dcda306e861655b3 (diff)
Merge remote-tracking branch 'origin/dublin' into 'origin/master'
Change-Id: I551ea3f29a76dc99532455ea4d7e84a316f9bf38 Issue-ID: SO-1980 Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java16
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java33
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java129
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java)62
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java28
18 files changed, 416 insertions, 82 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 71bcd58fee..79672404d2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -196,7 +196,7 @@ public class AAICreateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- execution.setVariable("callHoming", Boolean.TRUE.equals(vnf.isCallHoming()));
+ execution.setVariable("homing", Boolean.TRUE.equals(vnf.isCallHoming()));
aaiVnfResources.createVnfandConnectServiceInstance(vnf, serviceInstance);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
index d39e58b778..cea9d54631 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
@@ -32,6 +32,7 @@ import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables;
import org.camunda.bpm.engine.variable.VariableMap;
import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionBBTasks;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
@@ -56,6 +57,7 @@ public class ExecuteActivity implements JavaDelegate {
private static final String G_REQUEST_ID = "mso-request-id";
private static final String VNF_ID = "vnfId";
private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
+ private static final String WORKFLOW_SYNC_ACK_SENT = "workflowSyncAckSent";
private static final String SERVICE_TASK_IMPLEMENTATION_ATTRIBUTE = "implementation";
private static final String ACTIVITY_PREFIX = "activity:";
@@ -66,12 +68,19 @@ public class ExecuteActivity implements JavaDelegate {
private RuntimeService runtimeService;
@Autowired
private ExceptionBuilder exceptionBuilder;
+ @Autowired
+ private WorkflowActionBBTasks workflowActionBBTasks;
@Override
public void execute(DelegateExecution execution) throws Exception {
final String requestId = (String) execution.getVariable(G_REQUEST_ID);
try {
+ Boolean workflowSyncAckSent = (Boolean) execution.getVariable(WORKFLOW_SYNC_ACK_SENT);
+ if (workflowSyncAckSent == null || workflowSyncAckSent == false) {
+ workflowActionBBTasks.sendSyncAck(execution);
+ execution.setVariable(WORKFLOW_SYNC_ACK_SENT, Boolean.TRUE);
+ }
final String implementationString =
execution.getBpmnModelElementInstance().getAttributeValue(SERVICE_TASK_IMPLEMENTATION_ATTRIBUTE);
logger.debug("activity implementation String: {}", implementationString);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java
new file mode 100644
index 0000000000..b885cc2ee5
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+@Component
+public class MonitorInstantiateVnfmNodeTask extends MonitorVnfmNodeTask {
+
+ @Autowired
+ public MonitorInstantiateVnfmNodeTask(final ExtractPojosForBB extractPojosForBB,
+ final ExceptionBuilder exceptionUtil, final AAIVnfResources aaiVnfResources) {
+ super(extractPojosForBB, exceptionUtil, aaiVnfResources);
+ }
+
+ @Override
+ public String getNodeStatusVariableName() {
+ return CREATE_VNF_NODE_STATUS;
+ }
+
+ @Override
+ public boolean isOrchestrationStatusValid(final String orchestrationStatus) {
+ return VNF_CREATED.equalsIgnoreCase(orchestrationStatus);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java
new file mode 100644
index 0000000000..34296c20d6
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+@Component
+public class MonitorTerminateVnfmNodeTask extends MonitorVnfmNodeTask {
+
+ @Autowired
+ public MonitorTerminateVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil,
+ final AAIVnfResources aaiVnfResources) {
+ super(extractPojosForBB, exceptionUtil, aaiVnfResources);
+ }
+
+ @Override
+ public String getNodeStatusVariableName() {
+ return DELETE_VNF_NODE_STATUS;
+ }
+
+ @Override
+ public boolean isOrchestrationStatusValid(final String orchestrationStatus) {
+ return VNF_ASSIGNED.equalsIgnoreCase(orchestrationStatus);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
index 4645680fc2..4c84bcaa1f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
@@ -55,11 +55,18 @@ public class MonitorVnfmCreateJobTask extends MonitorVnfmJobTask {
* @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
*/
public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
- LOGGER.debug("Executing getCurrentOperationStatus ...");
- final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
- execution.setVariable(OPERATION_STATUS_PARAM_NAME,
- getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
- LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ try {
+ LOGGER.debug("Executing getCurrentOperationStatus ...");
+ final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
+ execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+ getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
+ LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ } catch (final Exception exception) {
+ final String message = "Unable to invoke get current Operation status";
+ LOGGER.error(message);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1209, message);
+
+ }
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
index e91f362d53..34e3efa8f5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
@@ -56,10 +56,18 @@ public class MonitorVnfmDeleteJobTask extends MonitorVnfmJobTask {
* @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
*/
public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
- LOGGER.debug("Executing getCurrentOperationStatus ...");
- final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME);
- execution.setVariable(OPERATION_STATUS_PARAM_NAME, getOperationStatus(execution, deleteVnfResponse.getJobId()));
- LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ try {
+ LOGGER.debug("Executing getCurrentOperationStatus ...");
+ final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME);
+ execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+ getOperationStatus(execution, deleteVnfResponse.getJobId()));
+ LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ } catch (final Exception exception) {
+ final String message = "Unable to invoke get current Operation status";
+ LOGGER.error(message);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1216, message);
+
+ }
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java
index 65b05e21f5..a7a4eadb33 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java
@@ -19,38 +19,39 @@
*/
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID;
+import java.util.Optional;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.exception.GenericVnfNotFoundException;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
/**
*
* @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ * @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-@Component
-public class MonitorVnfmNodeTask {
+public abstract class MonitorVnfmNodeTask {
private static final Logger LOGGER = LoggerFactory.getLogger(MonitorVnfmNodeTask.class);
private final ExtractPojosForBB extractPojosForBB;
private final ExceptionBuilder exceptionUtil;
+ private final AAIVnfResources aaiVnfResources;
@Autowired
- public MonitorVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil) {
+ public MonitorVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil,
+ final AAIVnfResources aaiVnfResources) {
this.exceptionUtil = exceptionUtil;
this.extractPojosForBB = extractPojosForBB;
+ this.aaiVnfResources = aaiVnfResources;
}
/**
@@ -61,11 +62,23 @@ public class MonitorVnfmNodeTask {
public void getNodeStatus(final BuildingBlockExecution execution) {
try {
LOGGER.debug("Executing getNodeStatus ...");
- final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
- String orchestrationStatus = vnf.getOrchestrationStatus();
- LOGGER.debug("Orchestration Status in AAI {}", orchestrationStatus);
- execution.setVariable(CREATE_VNF_NODE_STATUS, VNF_CREATED.equalsIgnoreCase(orchestrationStatus));
- execution.setVariable(DELETE_VNF_NODE_STATUS, VNF_ASSIGNED.equalsIgnoreCase(orchestrationStatus));
+
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf =
+ extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
+
+ final String vnfId = vnf.getVnfId();
+ LOGGER.debug("Query A&AI for generic VNF using vnfID: {}", vnfId);
+ final Optional<GenericVnf> aaiGenericVnfOptional = aaiVnfResources.getGenericVnf(vnfId);
+
+ if (!aaiGenericVnfOptional.isPresent()) {
+ throw new GenericVnfNotFoundException("Unable to find generic vnf in A&AI using vnfID: " + vnfId);
+ }
+ final GenericVnf genericVnf = aaiGenericVnfOptional.get();
+ final String orchestrationStatus = genericVnf.getOrchestrationStatus();
+ LOGGER.debug("Found generic vnf with orchestration status : {}", orchestrationStatus);
+
+ execution.setVariable(getNodeStatusVariableName(), isOrchestrationStatusValid(orchestrationStatus));
+
} catch (final Exception exception) {
LOGGER.error("Unable to get vnf from AAI", exception);
exceptionUtil.buildAndThrowWorkflowException(execution, 1220, exception);
@@ -73,6 +86,20 @@ public class MonitorVnfmNodeTask {
}
/**
+ * Get variable to store in execution context
+ *
+ * @return the variable name
+ */
+ public abstract String getNodeStatusVariableName();
+
+ /**
+ * @param orchestrationStatus the orchestration status from A&AI
+ * @return true if valid
+ */
+ public abstract boolean isOrchestrationStatusValid(final String orchestrationStatus);
+
+
+ /**
* Log and throw exception on timeout for job status
*
* @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
index e0176eb802..32516c1dcb 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
@@ -146,7 +146,7 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide
return Optional.of(response.getBody());
} catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
LOGGER.error("Unexpected error while processing job request", httpInvocationException);
- return Optional.absent();
+ throw httpInvocationException;
}
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java
new file mode 100644
index 0000000000..d33d0bc895
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.exception;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+public class GenericVnfNotFoundException extends Exception {
+ private static final long serialVersionUID = -2049370314818025597L;
+
+ public GenericVnfNotFoundException(final String message) {
+ super(message);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
index b2058b25a0..bc71fc6f67 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java
@@ -91,8 +91,9 @@ public class ConfigAssignVnf {
configAssignRequestVnf.setResolutionKey(vnf.getVnfName());
configAssignRequestVnf.setConfigAssignPropertiesForVnf(configAssignPropertiesForVnf);
- String blueprintName = vnf.getBlueprintName();
- String blueprintVersion = vnf.getBlueprintVersion();
+ String blueprintName = vnf.getModelInfoGenericVnf().getBlueprintName();
+ String blueprintVersion = vnf.getModelInfoGenericVnf().getBlueprintVersion();
+ logger.debug(" BlueprintName : " + blueprintName + " BlueprintVersion : " + blueprintVersion);
AbstractCDSPropertiesBean abstractCDSPropertiesBean = new AbstractCDSPropertiesBean();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java
index 4ec8b932c0..dd36900139 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java
@@ -92,8 +92,10 @@ public class ConfigDeployVnf {
configDeployRequestVnf.setResolutionKey(vnf.getVnfName());
configDeployRequestVnf.setConfigDeployPropertiesForVnf(configDeployPropertiesForVnf);
- String blueprintName = vnf.getBlueprintName();
- String blueprintVersion = vnf.getBlueprintVersion();
+ String blueprintName = vnf.getModelInfoGenericVnf().getBlueprintName();
+ String blueprintVersion = vnf.getModelInfoGenericVnf().getBlueprintVersion();
+ logger.debug(" BlueprintName : " + blueprintName + " BlueprintVersion : " + blueprintVersion);
+
AbstractCDSPropertiesBean abstractCDSPropertiesBean = new AbstractCDSPropertiesBean();
abstractCDSPropertiesBean.setBlueprintName(blueprintName);
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 2fc301f9d7..70726f2014 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
@@ -415,7 +415,7 @@ public class WorkflowAction {
protected boolean isConfiguration(List<OrchestrationFlow> orchFlows) {
for (OrchestrationFlow flow : orchFlows) {
- if (flow.getFlowName().contains("Configuration")) {
+ if (flow.getFlowName().contains("Configuration") && !flow.getFlowName().equals("ConfigurationScaleOutBB")) {
return true;
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index 753a050c03..e1c0d57b10 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -87,11 +87,10 @@ public class WorkflowActionBBTasks {
if (ebb.getBuildingBlock().getBpmnFlowName().equals("ConfigAssignVnfBB")
|| ebb.getBuildingBlock().getBpmnFlowName().equals("ConfigDeployVnfBB")) {
- String serviceInstanceId = ebb.getWorkflowResourceIds().getServiceInstanceId();
String vnfCustomizationUUID = ebb.getBuildingBlock().getKey();
- List<VnfResourceCustomization> vnfResourceCustomizations =
- catalogDbClient.getVnfResourceCustomizationByModelUuid(serviceInstanceId);
+ List<VnfResourceCustomization> vnfResourceCustomizations = catalogDbClient
+ .getVnfResourceCustomizationByModelUuid(ebb.getRequestDetails().getModelInfo().getModelUuid());
if (vnfResourceCustomizations != null && vnfResourceCustomizations.size() >= 1) {
VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(vnfCustomizationUUID,
vnfResourceCustomizations);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index 94e95687db..b0ba0595d5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -205,14 +205,22 @@ public class VnfAdapterVfModuleObjectMapper {
private void buildDirectivesParamFromMap(Map<String, Object> paramsMap, String directive,
Map<String, Object> srcMap) {
StringBuilder directives = new StringBuilder();
- if (srcMap.size() > 0) {
+ int no_directives_size = 0;
+ if (directives.equals(MsoMulticloudUtils.USER_DIRECTIVES)
+ && srcMap.containsKey(MsoMulticloudUtils.OOF_DIRECTIVES)) {
+ no_directives_size = 1;
+ }
+ if (srcMap.size() > no_directives_size) {
directives.append("{ \"attributes\": [ ");
int i = 0;
for (String attributeName : srcMap.keySet()) {
- directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
- if (i < (srcMap.size() - 1))
- directives.append(", ");
- i++;
+ if (!(MsoMulticloudUtils.USER_DIRECTIVES.equals(directives)
+ && attributeName.equals(MsoMulticloudUtils.OOF_DIRECTIVES))) {
+ directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
+ if (i < (srcMap.size() - 1 + no_directives_size))
+ directives.append(", ");
+ i++;
+ }
}
directives.append("] }");
} else {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java
new file mode 100644
index 0000000000..effcf24a8d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
+import java.util.Optional;
+import java.util.UUID;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.client.orchestration.AAIVnfResources;
+
+/**
+ *
+ * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
+public class MonitorInstantiateVnfmNodeTaskTest extends BaseTaskTest {
+
+ private static final String VNF_ID = UUID.randomUUID().toString();
+
+ private static final String VNF_NAME = "VNF_NAME";
+
+ private MonitorVnfmNodeTask objUnderTest;
+
+ @Mock
+ private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
+
+ @Mock
+ private AAIVnfResources mockedAaiVnfResources;
+
+ private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
+
+ @Before
+ public void setUp() {
+ objUnderTest = getEtsiVnfMonitorNodeJobTask();
+ }
+
+ @Test
+ public void testGetNodeStatus_genericVnfWithOrchStatusCreated_executionVariableSetToCreate() throws Exception {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+ final GenericVnf aaiGenericVnf = getAAIGenericVnf();
+ aaiGenericVnf.setOrchestrationStatus(VNF_CREATED);
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf));
+ objUnderTest.getNodeStatus(stubbedxecution);
+ assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
+ }
+
+ @Test
+ public void testGetNodeStatus_noGenericVnfFoundInAAI_throwException() throws Exception {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.empty());
+ objUnderTest.getNodeStatus(stubbedxecution);
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220),
+ any(Exception.class));
+ assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
+
+ }
+
+ @Test
+ public void testGetNodeStatusException() throws Exception {
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+ objUnderTest.getNodeStatus(stubbedxecution);
+ assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220),
+ any(Exception.class));
+ }
+
+ @Test
+ public void testTimeOutLogFailue() throws Exception {
+ objUnderTest.timeOutLogFailue(stubbedxecution);
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221),
+ eq("Node operation time out"));
+ }
+
+ private GenericVnf getAAIGenericVnf() {
+ final GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ genericVnf.setVnfName(VNF_NAME);
+ return genericVnf;
+ }
+
+ private org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf getGenericVnf() {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ return genericVnf;
+
+ }
+
+ private MonitorInstantiateVnfmNodeTask getEtsiVnfMonitorNodeJobTask() {
+ return new MonitorInstantiateVnfmNodeTask(extractPojosForBB, exceptionUtil, mockedAaiVnfResources);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java
index 6b84f6a918..04831733e1 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java
@@ -20,16 +20,15 @@
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
+import java.util.Optional;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
@@ -38,13 +37,14 @@ import org.onap.aai.domain.yang.GenericVnf;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.client.orchestration.AAIVnfResources;
/**
*
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ * @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-public class MonitorVnfmNodeJobTest extends BaseTaskTest {
+public class MonitorTerminateVnfmNodeTaskTest extends BaseTaskTest {
private static final String VNF_ID = UUID.randomUUID().toString();
@@ -55,6 +55,9 @@ public class MonitorVnfmNodeJobTest extends BaseTaskTest {
@Mock
private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
+ @Mock
+ private AAIVnfResources mockedAaiVnfResources;
+
private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
@Before
@@ -63,49 +66,48 @@ public class MonitorVnfmNodeJobTest extends BaseTaskTest {
}
@Test
- public void testGetNodeStatusCreate() throws Exception {
- GenericVnf vnf = getGenericVnf();
- vnf.setOrchestrationStatus(VNF_CREATED);
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
- objUnderTest.getNodeStatus(stubbedxecution);
- assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
- }
-
- @Test
public void testGetNodeStatusDelete() throws Exception {
- GenericVnf vnf = getGenericVnf();
- vnf.setOrchestrationStatus(VNF_ASSIGNED);
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+ final GenericVnf aaiGenericVnf = getAAIGenericVnf();
+ aaiGenericVnf.setOrchestrationStatus(VNF_ASSIGNED);
+
when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf));
+
objUnderTest.getNodeStatus(stubbedxecution);
assertTrue(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS));
}
@Test
- public void testGetNodeStatusException() throws Exception {
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+ public void testGetNodeStatus_noGenericVnfFoundInAAI_throwException() throws Exception {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.empty());
objUnderTest.getNodeStatus(stubbedxecution);
- assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
- assertNull(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS));
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220),
any(Exception.class));
- }
+ assertNull(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS));
- @Test
- public void testTimeOutLogFailue() throws Exception {
- objUnderTest.timeOutLogFailue(stubbedxecution);
- verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221),
- eq("Node operation time out"));
}
- private GenericVnf getGenericVnf() {
+ private GenericVnf getAAIGenericVnf() {
final GenericVnf genericVnf = new GenericVnf();
genericVnf.setVnfId(VNF_ID);
genericVnf.setVnfName(VNF_NAME);
return genericVnf;
}
- private MonitorVnfmNodeTask getEtsiVnfMonitorNodeJobTask() {
- return new MonitorVnfmNodeTask(extractPojosForBB, exceptionUtil);
+ private org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf getGenericVnf() {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ return genericVnf;
+
+ }
+
+ private MonitorTerminateVnfmNodeTask getEtsiVnfMonitorNodeJobTask() {
+ return new MonitorTerminateVnfmNodeTask(extractPojosForBB, exceptionUtil, mockedAaiVnfResources);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
index 7bd6435b60..e94d7c2923 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
@@ -228,7 +228,7 @@ public class VnfmAdapterServiceProviderImplTest {
assertFalse(actual.isPresent());
}
- @Test
+ @Test(expected = RestProcessingException.class)
public void testGetInstantiateOperationJobStatus_Exception() {
when(mockedHttpServiceProvider.getHttpResponse(eq(TestConstants.JOB_STATUS_EXPECTED_URL),
@@ -237,8 +237,7 @@ public class VnfmAdapterServiceProviderImplTest {
final VnfmAdapterServiceProvider objUnderTest =
new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
- final Optional<QueryJobResponse> actual = objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID);
- assertFalse(actual.isPresent());
+ objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID);
}
private QueryJobResponse getQueryJobResponse() {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
index a60927d694..1013cc8330 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
@@ -48,6 +48,8 @@ import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.serviceinstancebeans.ModelInfo;
+import org.onap.so.serviceinstancebeans.RequestDetails;
import org.springframework.core.env.Environment;
public class WorkflowActionBBTasksTest extends BaseTaskTest {
@@ -95,14 +97,16 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
ExecuteBuildingBlock ebb = new ExecuteBuildingBlock();
String vnfCustomizationUUID = "1234567";
- String serviceInstanceId = "1234567";
+ String modelUuid = "1234567";
BuildingBlock buildingBlock = new BuildingBlock();
buildingBlock.setBpmnFlowName("ConfigAssignVnfBB");
buildingBlock.setKey(vnfCustomizationUUID);
ebb.setBuildingBlock(buildingBlock);
- WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
- workflowResourceIds.setServiceInstanceId(serviceInstanceId);
- ebb.setWorkflowResourceIds(workflowResourceIds);
+ RequestDetails rd = new RequestDetails();
+ ModelInfo mi = new ModelInfo();
+ mi.setModelUuid(modelUuid);
+ rd.setModelInfo(mi);
+ ebb.setRequestDetails(rd);
flowsToExecute.add(ebb);
List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList();
@@ -112,8 +116,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
vnfResourceCustomizations.add(vrc);
GenericVnf genericVnf = new GenericVnf();
genericVnf.setModelCustomizationId(vnfCustomizationUUID);
- doReturn(vnfResourceCustomizations).when(catalogDbClient)
- .getVnfResourceCustomizationByModelUuid(serviceInstanceId);
+ doReturn(vnfResourceCustomizations).when(catalogDbClient).getVnfResourceCustomizationByModelUuid(modelUuid);
doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID,
vnfResourceCustomizations);
@@ -138,14 +141,16 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock();
String vnfCustomizationUUID = "1234567";
- String serviceInstanceId = "1234567";
+ String modelUuid = "1234567";
BuildingBlock buildingBlock = new BuildingBlock();
buildingBlock.setBpmnFlowName("ConfigDeployVnfBB");
buildingBlock.setKey(vnfCustomizationUUID);
ebb.setBuildingBlock(buildingBlock);
- WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
- workflowResourceIds.setServiceInstanceId(serviceInstanceId);
- ebb.setWorkflowResourceIds(workflowResourceIds);
+ RequestDetails rd = new RequestDetails();
+ ModelInfo mi = new ModelInfo();
+ mi.setModelUuid(modelUuid);
+ rd.setModelInfo(mi);
+ ebb.setRequestDetails(rd);
flowsToExecute.add(ebb);
List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList();
@@ -155,8 +160,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
vnfResourceCustomizations.add(vrc);
GenericVnf genericVnf = new GenericVnf();
genericVnf.setModelCustomizationId(vnfCustomizationUUID);
- doReturn(vnfResourceCustomizations).when(catalogDbClient)
- .getVnfResourceCustomizationByModelUuid(serviceInstanceId);
+ doReturn(vnfResourceCustomizations).when(catalogDbClient).getVnfResourceCustomizationByModelUuid(modelUuid);
doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID,
vnfResourceCustomizations);