diff options
author | raviteja.karumuri <raviteja.karumuri@est.tech> | 2023-02-15 00:31:29 +0000 |
---|---|---|
committer | raviteja.karumuri <raviteja.karumuri@est.tech> | 2023-02-16 11:58:20 +0000 |
commit | d0493f954a48021662b5b6d3ba45b262750690c9 (patch) | |
tree | 2b67f5f080a50726d8746d47995e60c37a6b3807 /bpmn/so-bpmn-tasks/src/main | |
parent | fa660d2d8a9b2b6f3190bf5c3c26dcf4fa15c146 (diff) |
[SO] Pending Unit test cases for create changes in SO
Issue-ID: SO-4070
Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech>
Change-Id: I75f0b41bc37f9c437fd1451a7efb85be803a001d
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/MonitorCnfmCreateJobTask.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/MonitorCnfmCreateJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/MonitorCnfmCreateJobTask.java index 06b44e4512..eb1cd1c1b6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/MonitorCnfmCreateJobTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnfm/tasks/MonitorCnfmCreateJobTask.java @@ -22,6 +22,7 @@ import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREAT import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.OPERATION_STATUS_PARAM_NAME; import java.net.URI; import java.util.Optional; +import org.onap.logging.filter.base.ONAPComponents; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.client.exception.ExceptionBuilder; import org.slf4j.Logger; @@ -61,10 +62,10 @@ public class MonitorCnfmCreateJobTask { public void getCurrentOperationStatus(final BuildingBlockExecution execution) { try { LOGGER.debug("Executing getCurrentOperationStatus ..."); - final URI operation_status_url = execution.getVariable(CNFM_REQUEST_STATUS_CHECK_URL); - LOGGER.debug("Executing getCurrentOperationStatus for CNF... :{}", operation_status_url.toString()); + final URI operationStatusURL = execution.getVariable(CNFM_REQUEST_STATUS_CHECK_URL); + LOGGER.debug("Executing getCurrentOperationStatus for CNF... :{}", operationStatusURL); final Optional<AsLcmOpOcc> instantiateOperationJobStatus = - cnfmHttpServiceProvider.getInstantiateOperationJobStatus(operation_status_url.toString()); + cnfmHttpServiceProvider.getInstantiateOperationJobStatus(operationStatusURL.toString()); if (instantiateOperationJobStatus.isPresent()) { final AsLcmOpOcc asLcmOpOccResponse = instantiateOperationJobStatus.get(); if (asLcmOpOccResponse.getOperationState() != null) { @@ -77,12 +78,12 @@ public class MonitorCnfmCreateJobTask { LOGGER.debug("Operation {} without operationStatus and operation retrieval status :{}", asLcmOpOccResponse.getId(), asLcmOpOccResponse.getOperationState()); } - execution.setVariable(CREATE_CNF_STATUS_RESPONSE_PARAM_NAME, instantiateOperationJobStatus.get()); + execution.setVariable(CREATE_CNF_STATUS_RESPONSE_PARAM_NAME, instantiateOperationJobStatus.orElseThrow()); LOGGER.debug("Finished executing getCurrentOperationStatus for CNF..."); } catch (final Exception exception) { final String message = "Unable to invoke get current Operation status"; LOGGER.error(message); - exceptionUtil.buildAndThrowWorkflowException(execution, 1209, message); + exceptionUtil.buildAndThrowWorkflowException(execution, 1209, message, ONAPComponents.SO); } } @@ -95,7 +96,7 @@ public class MonitorCnfmCreateJobTask { public void timeOutLogFailue(final BuildingBlockExecution execution) { final String message = "CNF Instantiation operation time out"; LOGGER.error(message); - exceptionUtil.buildAndThrowWorkflowException(execution, 1205, message); + exceptionUtil.buildAndThrowWorkflowException(execution, 1205, message, ONAPComponents.SO); } /** @@ -112,15 +113,14 @@ public class MonitorCnfmCreateJobTask { + (cnfInstantiateStautusResponse != null ? cnfInstantiateStautusResponse.getId() : "null") + "Unable to retrieve OperationStatus"; LOGGER.error(message); - exceptionUtil.buildAndThrowWorkflowException(execution, 1206, message); + exceptionUtil.buildAndThrowWorkflowException(execution, 1206, message, ONAPComponents.SO); } else { - final OperationStateEnum operationStatus = operationStatusOption; - if (operationStatus != OperationStateEnum.COMPLETED) { + if (operationStatusOption != OperationStateEnum.COMPLETED) { final String message = "Unable to instantiate jobId: " + (cnfInstantiateStautusResponse != null ? cnfInstantiateStautusResponse.getId() : "null") - + " OperationStatus: " + operationStatus; + + " OperationStatus: " + operationStatusOption; LOGGER.error(message); - exceptionUtil.buildAndThrowWorkflowException(execution, 1207, message); + exceptionUtil.buildAndThrowWorkflowException(execution, 1207, message, ONAPComponents.SO); } LOGGER.debug("Successfully completed CNF instatiation of job status {}", cnfInstantiateStautusResponse); } |