diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
17 files changed, 252 insertions, 274 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy index 484be19137..4670b11b71 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy @@ -148,7 +148,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess } catch (BpmnError e) { throw e } catch (Exception e) { - logger.error('Caught exception in ' + method, e) + logger.error('Caught exception in {}: {}', method, e.getMessage(), e) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message") } } @@ -416,7 +416,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess *@param name *@return **/ - public String getVariable(DelegateExecution execution, String name) { + public static String getVariable(DelegateExecution execution, String name) { def myObj = execution.getVariable(name) if(myObj instanceof VariableMap){ VariableMap serializedObjectMap = (VariableMap) myObj @@ -522,8 +522,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess throw bpmnError } catch(Exception e) { - e.printStackTrace() - logger.debug('Unexpected error encountered - ' + e.getMessage()) + logger.debug('Unexpected error encountered - {}', e.getMessage(), e) (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 9999, e.getMessage()) } finally { @@ -645,7 +644,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess rollbackEnabled = defaultRollback } } - + execution.setVariable(prefix+"backoutOnFailure", rollbackEnabled) logger.debug('rollbackEnabled (aka backoutOnFailure): ' + rollbackEnabled) } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy index c1f9f5b0b3..e9e7d1ed7c 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy @@ -63,8 +63,8 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("CAAIVfMod_moduleExists",false) execution.setVariable("CAAIVfMod_baseModuleConflict", false) execution.setVariable("CAAIVfMod_vnfNameFromAAI", null) - - + + // CreateAAIVfModule workflow response variable placeholders execution.setVariable("CAAIVfMod_queryGenericVnfResponseCode",null) execution.setVariable("CAAIVfMod_queryGenericVnfResponse","") @@ -80,14 +80,14 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("CreateAAIVfModuleResponse","") execution.setVariable("RollbackData", null) - } - + } + // parse the incoming CREATE_VF_MODULE request and store the Generic VNF // and VF Module data in the flow DelegateExecution public void preProcessRequest(DelegateExecution execution) { initProcessVariables(execution) - def vnfId = execution.getVariable("vnfId") + def vnfId = execution.getVariable("vnfId") if (vnfId == null || vnfId.isEmpty()) { execution.setVariable("CAAIVfMod_newGenericVnf", true) execution.setVariable("CAAIVfMod_vnfId","") @@ -96,14 +96,14 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("CAAIVfMod_vnfId",vnfId) } - def vnfName = execution.getVariable("vnfName") + def vnfName = execution.getVariable("vnfName") execution.setVariable("CAAIVfMod_vnfName", vnfName) String vnfType = execution.getVariable("vnfType") execution.setVariable("CAAIVfMod_vnfType", StringUtils.defaultString(vnfType)) execution.setVariable("CAAIVfMod_serviceId", execution.getVariable("serviceId")) - + String personaModelId = execution.getVariable("personaModelId") execution.setVariable("CAAIVfMod_personaId",StringUtils.defaultString(personaModelId)) @@ -219,8 +219,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("CAAIVfMod_createGenericVnfResponseCode", 201) execution.setVariable("CAAIVfMod_createGenericVnfResponse", "Vnf Created") } catch (Exception ex) { - ex.printStackTrace() - logger.debug("Exception occurred while executing AAI PUT:" + ex.getMessage()) + logger.debug("Exception occurred while executing AAI PUT: {}", ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Internal Error - Occured in createGenericVnf.") } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy index dc4871119e..7e46784af2 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy @@ -121,8 +121,7 @@ public class CreateAAIVfModuleVolumeGroup extends AbstractServiceTaskProcessor { execution.setVariable('CAAIVfModVG_getVfModuleResponse', "VF-Module Not found!!") } }catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) execution.setVariable('CAAIVfModVG_getVfModuleResponseCode', 500) execution.setVariable('CAAIVfModVG_getVfModuleResponse', 'AAI GET Failed:' + ex.getMessage()) } @@ -174,8 +173,7 @@ public class CreateAAIVfModuleVolumeGroup extends AbstractServiceTaskProcessor { logger.debug("CreateAAIVfModule Response code: " + 200) logger.debug("CreateAAIVfModule Response: " + "Success") } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI PUT:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI PUT: {}', ex.getMessage(), ex) execution.setVariable('CAAIVfModVG_updateVfModuleResponseCode', 500) execution.setVariable('CAAIVfModVG_updateVfModuleResponse', 'AAI PUT Failed:' + ex.getMessage()) } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy index 83f31450b8..4bce23eff7 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy @@ -76,7 +76,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{ // send a GET request to AA&I to retrieve the Generic Vnf/Vf Module information based on a Vnf Id // expect a 200 response with the information in the response body or a 404 if the Generic Vnf does not exist public void queryAAIForGenericVnf(DelegateExecution execution) { - + def vnfId = execution.getVariable("DAAIVfMod_vnfId") try { @@ -112,8 +112,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("DAAIVfMod_deleteGenericVnfResponseCode", 200) execution.setVariable("DAAIVfMod_deleteGenericVnfResponse", "Vnf Deleted") } catch (Exception ex) { - ex.printStackTrace() - logger.debug("Exception occurred while executing AAI DELETE:" + ex.getMessage()) + logger.debug("Exception occurred while executing AAI DELETE: {}", ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Internal Error - Occured during deleteGenericVnf") } } @@ -131,8 +130,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("DAAIVfMod_deleteVfModuleResponseCode", 200) execution.setVariable("DAAIVfMod_deleteVfModuleResponse", "Vf Module Deleted") } catch (Exception ex) { - ex.printStackTrace() - logger.debug("Exception occurred while executing AAI PUT:" + ex.getMessage()) + logger.debug("Exception occurred while executing AAI PUT: {}", ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Internal Error - Occured during deleteVfModule") } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy index 740d9f70b6..f008130c32 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy @@ -151,8 +151,7 @@ public class GenerateVfModuleName extends AbstractServiceTaskProcessor{ } } } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy index 92c1579aa0..f371ccef4d 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy @@ -126,7 +126,7 @@ class MsoUtils { /***** Utilities when using XmlParser *****/ - + /** * Convert a Node into a String by deserializing it and formatting it. * @@ -883,7 +883,7 @@ class MsoUtils { callbackUrlToUse = callbackUrlToUse.replaceAll("(http://)(.*)(:28080*)", {orig, first, torepl, last -> "${first}${qualifiedHostName}${last}"}) } }catch(Exception e){ - log("DEBUG", "unable to grab qualified host name, using what's in urn properties for callbackurl. Exception was: " + e.printStackTrace()) + logger.debug("Unable to grab qualified host name, using what's in urn properties for callbackurl. Exception was: {}", e.getMessage(), e) } return callbackUrlToUse diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy index d909a77cc2..a7bb707dff 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapter.groovy @@ -166,7 +166,7 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor { logger.debug(UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint", execution)) }catch(Exception e){ - logger.debug('Internal Error occured during PreProcess Method: ', e) + logger.debug('Internal Error occured during PreProcess Method: {}', e.getMessage(), e) exceptionUtil.buildAndThrowWorkflowException(execution, 9999, 'Internal Error occured during PreProcess Method') // TODO: what message and error code? } logger.trace("End pre Process SDNCRequestScript ") diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy index 9d7ce8234b..69d5f02df5 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy @@ -165,7 +165,7 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor { logger.debug(getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter") logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter", - "BPMN", ErrorCode.UnknownError.getValue()); + "BPMN", ErrorCode.UnknownError.getValue(), ex); } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy index c1d68c5f7c..f91bf54edc 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy @@ -161,7 +161,7 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 { logger.debug(getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter") logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), getProcessKey(execution) + ": Unable to encode BasicAuth credentials for SDNCAdapter", - "BPMN", ErrorCode.UnknownError.getValue()); + "BPMN", ErrorCode.UnknownError.getValue(), ex); } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtils.groovy index e6d54b8681..eb832224db 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtils.groovy @@ -47,22 +47,19 @@ class SDNCAdapterUtils { ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() + MsoUtils msoUtils = new MsoUtils() - private AbstractServiceTaskProcessor taskProcessor - - public SDNCAdapterUtils(AbstractServiceTaskProcessor taskProcessor) { - this.taskProcessor = taskProcessor + public SDNCAdapterUtils() { } String SDNCAdapterFeatureRequest(DelegateExecution execution, String requestName, String action, String callbackURL, String serviceOperation, String timeoutValueInMinutes) { - def utils=new MsoUtils() def prefix = execution.getVariable('prefix') - def request = taskProcessor.getVariable(execution, requestName) - def requestInformation = utils.getNodeXml(request, 'request-information', false) - def serviceInformation = utils.getNodeXml(request, 'service-information', false) - def featureInformation = utils.getNodeXml(request, 'feature-information', false) - def featureParameters = utils.getNodeXml(request, 'feature-parameters', false) + def request = AbstractServiceTaskProcessor.getVariable(execution, requestName) + def requestInformation = msoUtils.getNodeXml(request, 'request-information', false) + def serviceInformation = msoUtils.getNodeXml(request, 'service-information', false) + def featureInformation = msoUtils.getNodeXml(request, 'feature-information', false) + def featureParameters = msoUtils.getNodeXml(request, 'feature-parameters', false) def requestId = execution.getVariable('testReqId') // for junits if(requestId==null){ @@ -71,10 +68,10 @@ class SDNCAdapterUtils { def svcInstanceId = execution.getVariable("mso-service-instance-id") - def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation) - def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation) - def nnsFeatureInformation = utils.removeXmlNamespaces(featureInformation) - def nnsFeatureParameters = utils.removeXmlNamespaces(featureParameters) + def nnsRequestInformation = msoUtils.removeXmlNamespaces(requestInformation) + def nnsServiceInformation = msoUtils.removeXmlNamespaces(serviceInformation) + def nnsFeatureInformation = msoUtils.removeXmlNamespaces(featureInformation) + def nnsFeatureParameters = msoUtils.removeXmlNamespaces(featureParameters) String sdncAdapterFeatureRequest = """ <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1" @@ -95,18 +92,17 @@ class SDNCAdapterUtils { <sdncadapterworkflow:SDNCTimeOutValueInMinutes>${MsoUtils.xmlEscape(timeoutValueInMinutes)}</sdncadapterworkflow:SDNCTimeOutValueInMinutes> </sdncadapterworkflow:SDNCAdapterWorkflowRequest> """ - sdncAdapterFeatureRequest = utils.removeXmlPreamble(utils.formatXML(sdncAdapterFeatureRequest)) + sdncAdapterFeatureRequest = msoUtils.removeXmlPreamble(msoUtils.formatXml(sdncAdapterFeatureRequest)) return sdncAdapterFeatureRequest } String SDNCAdapterActivateVnfRequest(DelegateExecution execution, String action, String callbackURL, String serviceOperation, String msoAction, String timeoutValueInMinutes) { - def utils=new MsoUtils() def prefix = execution.getVariable('prefix') - def request = taskProcessor.getVariable(execution, prefix+'Request') - def requestInformation = utils.getNodeXml(request, 'request-information', false) - def serviceInformation = utils.getNodeXml(request, 'service-information', false) - def vnfInformationList = utils.getNodeXml(request, 'vnf-information-list', false) + def request = AbstractServiceTaskProcessor.getVariable(execution, prefix+'Request') + def requestInformation = msoUtils.getNodeXml(request, 'request-information', false) + def serviceInformation = msoUtils.getNodeXml(request, 'service-information', false) + def vnfInformationList = msoUtils.getNodeXml(request, 'vnf-information-list', false) def requestId = execution.getVariable('testReqId') // for junits if(requestId==null){ @@ -115,9 +111,9 @@ class SDNCAdapterUtils { def svcInstanceId = execution.getVariable("mso-service-instance-id") - def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation) - def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation) - def nnsVnfInformationList = utils.removeXmlNamespaces(vnfInformationList) + def nnsRequestInformation = msoUtils.removeXmlNamespaces(requestInformation) + def nnsServiceInformation = msoUtils.removeXmlNamespaces(serviceInformation) + def nnsVnfInformationList = msoUtils.removeXmlNamespaces(vnfInformationList) String sdncAdapterActivateVnfRequest = """ <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1" @@ -138,15 +134,14 @@ class SDNCAdapterUtils { <sdncadapterworkflow:SDNCTimeOutValueInMinutes>${MsoUtils.xmlEscape(timeoutValueInMinutes)}</sdncadapterworkflow:SDNCTimeOutValueInMinutes> </sdncadapterworkflow:SDNCAdapterWorkflowRequest> """ - sdncAdapterActivateVnfRequest = utils.removeXmlPreamble(utils.formatXML(sdncAdapterActivateVnfRequest)) + sdncAdapterActivateVnfRequest = msoUtils.removeXmlPreamble(msoUtils.formatXml(sdncAdapterActivateVnfRequest)) return sdncAdapterActivateVnfRequest } String SDNCAdapterL3ToHigherLayerRequest(DelegateExecution execution, String action, String callbackURL, String serviceOperation, String timeoutValueInMinutes) { - def utils=new MsoUtils() def prefix = execution.getVariable('prefix') - def request = taskProcessor.getVariable(execution, prefix+'Request') + def request = AbstractServiceTaskProcessor.getVariable(execution, prefix+'Request') String requestInformation = """<request-information> <request-id>${MsoUtils.xmlEscape(execution.getVariable("mso-request-id"))}</request-id> @@ -164,8 +159,8 @@ class SDNCAdapterUtils { }else if("delete".equalsIgnoreCase(action)){ xml.'request-action'.replaceBody('deleteTrinityBonding') } - requestInformation = utils.removeXmlPreamble(groovy.xml.XmlUtil.serialize(xml)) - def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation) + requestInformation = msoUtils.removeXmlPreamble(groovy.xml.XmlUtil.serialize(xml)) + def nnsRequestInformation = msoUtils.removeXmlNamespaces(requestInformation) def requestId = execution.getVariable('testReqId') // for junits if(requestId==null){ @@ -234,7 +229,7 @@ class SDNCAdapterUtils { <sdncadapterworkflow:SDNCTimeOutValueInMinutes>${MsoUtils.xmlEscape(timeoutValueInMinutes)}</sdncadapterworkflow:SDNCTimeOutValueInMinutes> </sdncadapterworkflow:SDNCAdapterWorkflowRequest> """ - sdncAdapterL3ToHLRequest = utils.removeXmlPreamble(utils.formatXML(sdncAdapterL3ToHLRequest)) + sdncAdapterL3ToHLRequest = msoUtils.removeXmlPreamble(msoUtils.formatXml(sdncAdapterL3ToHLRequest)) return sdncAdapterL3ToHLRequest } @@ -243,13 +238,12 @@ class SDNCAdapterUtils { private void SDNCAdapterActivateRequest(DelegateExecution execution, String resultVar, String svcAction, String svcOperation, String additionalData) { - def utils=new MsoUtils() def prefix = execution.getVariable('prefix') - def request = taskProcessor.getVariable(execution, prefix+'Request') - def requestInformation = utils.getNodeXml(request, 'request-information', false) - def serviceInformation = utils.getNodeXml(request, 'service-information', false) - def serviceParameters = utils.getNodeXml(request, 'service-parameters', false) + def request = AbstractServiceTaskProcessor.getVariable(execution, prefix+'Request') + def requestInformation = msoUtils.getNodeXml(request, 'request-information', false) + def serviceInformation = msoUtils.getNodeXml(request, 'service-information', false) + def serviceParameters = msoUtils.getNodeXml(request, 'service-parameters', false) def requestId = execution.getVariable('testReqId') // for junits if(requestId==null){ @@ -269,18 +263,18 @@ class SDNCAdapterUtils { workflowException(execution, 'Internal Error', 9999) // TODO: what message and error code? } - def l2HomingInformation = utils.getNodeXml(serviceParameters, 'l2-homing-information', false) - def internetEvcAccessInformation = utils.getNodeXml(serviceParameters, 'internet-evc-access-information', false) - def vrLan = utils.getNodeXml(serviceParameters, 'vr-lan', false) - def upceVmsServiceInformation = utils.getNodeXml(serviceParameters, 'ucpe-vms-service-information', false) + def l2HomingInformation = msoUtils.getNodeXml(serviceParameters, 'l2-homing-information', false) + def internetEvcAccessInformation = msoUtils.getNodeXml(serviceParameters, 'internet-evc-access-information', false) + def vrLan = msoUtils.getNodeXml(serviceParameters, 'vr-lan', false) + def upceVmsServiceInformation = msoUtils.getNodeXml(serviceParameters, 'ucpe-vms-service-information', false) - def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation) - def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation) - def nnsl2HomingInformation = utils.removeXmlNamespaces(l2HomingInformation) - def nnsInternetEvcAccessInformation = utils.removeXmlNamespaces(internetEvcAccessInformation) - def nnsVrLan = utils.removeXmlNamespaces(vrLan) - def nnsUpceVmsServiceInformation = utils.removeXmlNamespaces(upceVmsServiceInformation) + def nnsRequestInformation = msoUtils.removeXmlNamespaces(requestInformation) + def nnsServiceInformation = msoUtils.removeXmlNamespaces(serviceInformation) + def nnsl2HomingInformation = msoUtils.removeXmlNamespaces(l2HomingInformation) + def nnsInternetEvcAccessInformation = msoUtils.removeXmlNamespaces(internetEvcAccessInformation) + def nnsVrLan = msoUtils.removeXmlNamespaces(vrLan) + def nnsUpceVmsServiceInformation = msoUtils.removeXmlNamespaces(upceVmsServiceInformation) if (additionalData == null) { additionalData = "" @@ -319,7 +313,7 @@ class SDNCAdapterUtils { </sdncadapterworkflow:SDNCAdapterWorkflowRequest> """ - content = utils.removeXmlPreamble(utils.formatXML(content)) + content = msoUtils.removeXmlPreamble(msoUtils.formatXml(content)) execution.setVariable(resultVar, content) } @@ -343,7 +337,7 @@ class SDNCAdapterUtils { * @param isAic3 boolean to indicate whether request is for AIC3.0 */ public void sdncReservePrep(DelegateExecution execution, String action, String resultVar, boolean isAic3) { - sdncPrep(execution, resultVar, action , 'service-configuration-operation', null, isAic3, this.taskProcessor) + sdncPrep(execution, resultVar, action , 'service-configuration-operation', null, isAic3) } /** @@ -356,8 +350,8 @@ class SDNCAdapterUtils { * RequestData element (may be null) */ public void sdncPrep(DelegateExecution execution, String resultVar, String svcAction, - String svcOperation, String additionalData, AbstractServiceTaskProcessor taskProcessor) { - sdncPrep(execution, resultVar, svcAction, svcOperation, additionalData, false, taskProcessor) + String svcOperation, String additionalData) { + sdncPrep(execution, resultVar, svcAction, svcOperation, additionalData, false) } /** @@ -370,7 +364,7 @@ class SDNCAdapterUtils { * @param isAic3 boolean to indicate whether request is for AIC3.0 */ public void sdncPrep(DelegateExecution execution, String resultVar, String svcAction, - String svcOperation, String additionalData, boolean isAic3, AbstractServiceTaskProcessor taskProcessor) { + String svcOperation, String additionalData, boolean isAic3) { def method = getClass().getSimpleName() + '.sdncPrep(' + 'execution=' + execution.getId() + ', resultVar=' + resultVar + @@ -380,14 +374,14 @@ class SDNCAdapterUtils { ')' logger.trace('Entered ' + method) - MsoUtils utils = taskProcessor.utils + try { def prefix = execution.getVariable('prefix') - def request = taskProcessor.getVariable(execution, prefix+'Request') - def requestInformation = utils.getNodeXml(request, 'request-information', false) - def serviceInformation = utils.getNodeXml(request, 'service-information', false) - def serviceParameters = utils.getChildNodes(request, 'service-parameters') - def requestAction = utils.getNodeText(request, 'request-action') + def request = AbstractServiceTaskProcessor.getVariable(execution, prefix+'Request') + def requestInformation = msoUtils.getNodeXml(request, 'request-information', false) + def serviceInformation = msoUtils.getNodeXml(request, 'service-information', false) + def serviceParameters = msoUtils.getChildNodes(request, 'service-parameters') + def requestAction = msoUtils.getNodeText(request, 'request-action') def timeoutInMinutes = UrnPropertiesReader.getVariable('mso.sdnc.timeout.firewall.minutes',execution) @@ -407,23 +401,23 @@ class SDNCAdapterUtils { exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Internal Error - During PreProcess Request") } - def l2HomingInformation = utils.getNodeXml(request, 'l2-homing-information', false) - def internetEvcAccessInformation = utils.getNodeXml(request, 'internet-evc-access-information', false) - def vrLan = utils.getNodeXml(request, 'vr-lan', false) - def upceVmsServiceInfo = utils.getNodeXml(request, 'ucpe-vms-service-information', false) - def vnfInformationList = utils.getNodeXml(request, 'vnf-information-list', false) - - def nnsRequestInformation = utils.removeXmlNamespaces(requestInformation) - def nnsServiceInformation = utils.removeXmlNamespaces(serviceInformation) - def nnsl2HomingInformation = utils.removeXmlNamespaces(l2HomingInformation) - def nnsInternetEvcAccessInformation = utils.removeXmlNamespaces(internetEvcAccessInformation) - def nnsVrLan = utils.removeXmlNamespaces(vrLan) - def nnsUpceVmsServiceInfo = utils.removeXmlNamespaces(upceVmsServiceInfo) - def nnsVnfInformationList = utils.removeXmlNamespaces(vrLan) + def l2HomingInformation = msoUtils.getNodeXml(request, 'l2-homing-information', false) + def internetEvcAccessInformation = msoUtils.getNodeXml(request, 'internet-evc-access-information', false) + def vrLan = msoUtils.getNodeXml(request, 'vr-lan', false) + def upceVmsServiceInfo = msoUtils.getNodeXml(request, 'ucpe-vms-service-information', false) + def vnfInformationList = msoUtils.getNodeXml(request, 'vnf-information-list', false) + + def nnsRequestInformation = msoUtils.removeXmlNamespaces(requestInformation) + def nnsServiceInformation = msoUtils.removeXmlNamespaces(serviceInformation) + def nnsl2HomingInformation = msoUtils.removeXmlNamespaces(l2HomingInformation) + def nnsInternetEvcAccessInformation = msoUtils.removeXmlNamespaces(internetEvcAccessInformation) + def nnsVrLan = msoUtils.removeXmlNamespaces(vrLan) + def nnsUpceVmsServiceInfo = msoUtils.removeXmlNamespaces(upceVmsServiceInfo) + def nnsVnfInformationList = msoUtils.removeXmlNamespaces(vrLan) def nnsinternetSvcChangeDetails = "" if(requestAction!=null && requestAction.equals("ChangeLayer3ServiceProvRequest")){ - def internetSvcChangeDetails = utils.removeXmlNamespaces(serviceParameters) + def internetSvcChangeDetails = msoUtils.removeXmlNamespaces(serviceParameters) nnsinternetSvcChangeDetails = """<internet-service-change-details> ${internetSvcChangeDetails} </internet-service-change-details>""" @@ -466,7 +460,7 @@ class SDNCAdapterUtils { </sdncadapterworkflow:SDNCAdapterWorkflowRequest> """ - content = utils.removeXmlPreamble(utils.formatXML(content)) + content = msoUtils.removeXmlPreamble(msoUtils.formatXml(content)) execution.setVariable(resultVar, content) logger.debug(resultVar + ' = ' + System.lineSeparator() + content) @@ -506,7 +500,6 @@ class SDNCAdapterUtils { * RequestData element (may be null) */ public String sdncTopologyRequestV2 (DelegateExecution execution, String requestXML, String serviceInstanceId, String callbackUrl, String action, String requestAction, String cloudRegionId, networkId, L3Network queryAAIResponse, String additionalData) { - def utils=new MsoUtils() // SNDC is expecting request Id for header as unique each call. String hdrRequestId = "" @@ -521,17 +514,17 @@ class SDNCAdapterUtils { try { requestId = execution.getVariable("mso-request-id") } catch (Exception ex) { - requestId = utils.getNodeText(requestXML, "request-id") + requestId = msoUtils.getNodeText(requestXML, "request-id") } String aicCloudRegion = cloudRegionId String tenantId = "" - if (utils.nodeExists(requestXML, "tenant-id")) { - tenantId = utils.getNodeText(requestXML, "tenant-id") + if (msoUtils.nodeExists(requestXML, "tenant-id")) { + tenantId = msoUtils.getNodeText(requestXML, "tenant-id") } String networkType = "" - if (utils.nodeExists(requestXML, "network-type")) { - networkType = utils.getNodeText(requestXML, "network-type") + if (msoUtils.nodeExists(requestXML, "network-type")) { + networkType = msoUtils.getNodeText(requestXML, "network-type") } // Replace/Use the value of network-type from aai query (vs input) during Delete Network flows. @@ -540,20 +533,20 @@ class SDNCAdapterUtils { } String serviceId = "" - if (utils.nodeExists(requestXML, "service-id")) { - serviceId = utils.getNodeText(requestXML, "service-id") + if (msoUtils.nodeExists(requestXML, "service-id")) { + serviceId = msoUtils.getNodeText(requestXML, "service-id") } String networkName = "" // Replace/Use the value of network-name from aai query (vs input) if it was already set in AAI if (queryAAIResponse != null) { networkName = queryAAIResponse.getNetworkName() } - if (networkName.isEmpty() && utils.nodeExists(requestXML, "network-name")) { - networkName = utils.getNodeText(requestXML, "network-name") + if (networkName.isEmpty() && msoUtils.nodeExists(requestXML, "network-name")) { + networkName = msoUtils.getNodeText(requestXML, "network-name") } String source = "" - if (utils.nodeExists(requestXML, "source")) { - source = utils.getNodeText(requestXML, "source") + if (msoUtils.nodeExists(requestXML, "source")) { + source = msoUtils.getNodeText(requestXML, "source") } // get resourceLink from subflow execution variable @@ -631,7 +624,6 @@ class SDNCAdapterUtils { * RequestData element (may be null) */ public String sdncTopologyRequestRsrc (DelegateExecution execution, String requestXML, String serviceInstanceId, String callbackUrl, String action, String requestAction, String cloudRegionId, networkId, String additionalData) { - def utils=new MsoUtils() // SNDC is expecting request Id for header as unique each call. String hdrRequestId = "" @@ -655,35 +647,35 @@ class SDNCAdapterUtils { String aicCloudRegion = cloudRegionId String tenantId = "" - if (utils.nodeExists(requestXML, "tenant-id")) { - tenantId = utils.getNodeText(requestXML, "tenant-id") + if (msoUtils.nodeExists(requestXML, "tenant-id")) { + tenantId = msoUtils.getNodeText(requestXML, "tenant-id") } String networkType = "" - if (utils.nodeExists(requestXML, "network-type")) { - networkType = utils.getNodeText(requestXML, "network-type") + if (msoUtils.nodeExists(requestXML, "network-type")) { + networkType = msoUtils.getNodeText(requestXML, "network-type") } String subscriptionServiceType = "" - if (utils.nodeExists(requestXML, "subscription-service-type")) { - subscriptionServiceType = utils.getNodeText(requestXML, "subscription-service-type") + if (msoUtils.nodeExists(requestXML, "subscription-service-type")) { + subscriptionServiceType = msoUtils.getNodeText(requestXML, "subscription-service-type") } String globalCustomerId = "" - if (utils.nodeExists(requestXML, "global-customer-id")) { - globalCustomerId = utils.getNodeText(requestXML, "global-customer-id") + if (msoUtils.nodeExists(requestXML, "global-customer-id")) { + globalCustomerId = msoUtils.getNodeText(requestXML, "global-customer-id") } String serviceId = "" - if (utils.nodeExists(requestXML, "service-id")) { - serviceId = utils.getNodeText(requestXML, "service-id") + if (msoUtils.nodeExists(requestXML, "service-id")) { + serviceId = msoUtils.getNodeText(requestXML, "service-id") } String networkName = "" - if (utils.nodeExists(requestXML, "network-name")) { - networkName = utils.getNodeText(requestXML, "network-name") + if (msoUtils.nodeExists(requestXML, "network-name")) { + networkName = msoUtils.getNodeText(requestXML, "network-name") } String source = "" - if (utils.nodeExists(requestXML, "source")) { - source = utils.getNodeText(requestXML, "source") + if (msoUtils.nodeExists(requestXML, "source")) { + source = msoUtils.getNodeText(requestXML, "source") } // get resourceLink from subflow execution variable @@ -704,28 +696,28 @@ class SDNCAdapterUtils { } // network-information from 'networkModelInfo' // verify the DB Catalog response - String networkModelInfo = utils.getNodeXml(requestXML, "networkModelInfo", false).replace("tag0:","").replace(":tag0","") - String modelInvariantUuid = utils.getNodeText(networkModelInfo, "modelInvariantUuid") !=null ? - utils.getNodeText(networkModelInfo, "modelInvariantUuid") : "" - String modelCustomizationUuid = utils.getNodeText(networkModelInfo, "modelCustomizationUuid") !=null ? - utils.getNodeText(networkModelInfo, "modelCustomizationUuid") : "" - String modelUuid = utils.getNodeText(networkModelInfo, "modelUuid") !=null ? - utils.getNodeText(networkModelInfo, "modelUuid") : "" - String modelVersion = utils.getNodeText(networkModelInfo, "modelVersion") !=null ? - utils.getNodeText(networkModelInfo, "modelVersion") : "" - String modelName = utils.getNodeText(networkModelInfo, "modelName") !=null ? - utils.getNodeText(networkModelInfo, "modelName") : "" + String networkModelInfo = msoUtils.getNodeXml(requestXML, "networkModelInfo", false).replace("tag0:","").replace(":tag0","") + String modelInvariantUuid = msoUtils.getNodeText(networkModelInfo, "modelInvariantUuid") !=null ? + msoUtils.getNodeText(networkModelInfo, "modelInvariantUuid") : "" + String modelCustomizationUuid = msoUtils.getNodeText(networkModelInfo, "modelCustomizationUuid") !=null ? + msoUtils.getNodeText(networkModelInfo, "modelCustomizationUuid") : "" + String modelUuid = msoUtils.getNodeText(networkModelInfo, "modelUuid") !=null ? + msoUtils.getNodeText(networkModelInfo, "modelUuid") : "" + String modelVersion = msoUtils.getNodeText(networkModelInfo, "modelVersion") !=null ? + msoUtils.getNodeText(networkModelInfo, "modelVersion") : "" + String modelName = msoUtils.getNodeText(networkModelInfo, "modelName") !=null ? + msoUtils.getNodeText(networkModelInfo, "modelName") : "" // service-information from 'networkModelInfo' // verify the DB Catalog response - String serviceModelInfo = utils.getNodeXml(requestXML, "serviceModelInfo", false).replace("tag0:","").replace(":tag0","") - String serviceModelInvariantUuid = utils.getNodeText(serviceModelInfo, "modelInvariantUuid") !=null ? - utils.getNodeText(serviceModelInfo, "modelInvariantUuid") : "" - String serviceModelUuid = utils.getNodeText(serviceModelInfo, "modelUuid") !=null ? - utils.getNodeText(serviceModelInfo, "modelUuid") : "" - String serviceModelVersion = utils.getNodeText(serviceModelInfo, "modelVersion") !=null ? - utils.getNodeText(serviceModelInfo, "modelVersion") : "" - String serviceModelName = utils.getNodeText(serviceModelInfo, "modelName") !=null ? - utils.getNodeText(serviceModelInfo, "modelName") : "" + String serviceModelInfo = msoUtils.getNodeXml(requestXML, "serviceModelInfo", false).replace("tag0:","").replace(":tag0","") + String serviceModelInvariantUuid = msoUtils.getNodeText(serviceModelInfo, "modelInvariantUuid") !=null ? + msoUtils.getNodeText(serviceModelInfo, "modelInvariantUuid") : "" + String serviceModelUuid = msoUtils.getNodeText(serviceModelInfo, "modelUuid") !=null ? + msoUtils.getNodeText(serviceModelInfo, "modelUuid") : "" + String serviceModelVersion = msoUtils.getNodeText(serviceModelInfo, "modelVersion") !=null ? + msoUtils.getNodeText(serviceModelInfo, "modelVersion") : "" + String serviceModelName = msoUtils.getNodeText(serviceModelInfo, "modelName") !=null ? + msoUtils.getNodeText(serviceModelInfo, "modelName") : "" String content = @@ -808,27 +800,27 @@ class SDNCAdapterUtils { }else{ // we need to peer into the request data for error - def String sdncAdapterWorkflowResponse = taskProcessor.utils.getNodeXml(response, 'response-data', false) + def String sdncAdapterWorkflowResponse = msoUtils.getNodeXml(response, 'response-data', false) def String decodedXml = sdncAdapterWorkflowResponse.replace('<?xml version="1.0" encoding="UTF-8"?>', "") - decodedXml = taskProcessor.utils.getNodeXml(response, 'RequestData') + decodedXml = msoUtils.getNodeXml(response, 'RequestData') logger.debug("decodedXml:\n" + decodedXml) int requestDataResponseCode = 200 def String requestDataResponseMessage = '' try{ - if (taskProcessor.utils.nodeExists(decodedXml, "response-message")) { - requestDataResponseMessage = taskProcessor.utils.getNodeText(decodedXml, "response-message") - } else if (taskProcessor.utils.nodeExists(sdncAdapterWorkflowResponse, "ResponseMessage")) { - requestDataResponseMessage = taskProcessor.utils.getNodeText(sdncAdapterWorkflowResponse, "ResponseMessage") + if (msoUtils.nodeExists(decodedXml, "response-message")) { + requestDataResponseMessage = msoUtils.getNodeText(decodedXml, "response-message") + } else if (msoUtils.nodeExists(sdncAdapterWorkflowResponse, "ResponseMessage")) { + requestDataResponseMessage = msoUtils.getNodeText(sdncAdapterWorkflowResponse, "ResponseMessage") } }catch(Exception e){ logger.debug('Error caught while decoding resposne ' + e.getMessage()) } - if(taskProcessor.utils.nodeExists(decodedXml, "response-code")) { + if(msoUtils.nodeExists(decodedXml, "response-code")) { logger.debug("response-code node Exist ") - String code = taskProcessor.utils.getNodeText(decodedXml, "response-code") + String code = msoUtils.getNodeText(decodedXml, "response-code") if(code.isEmpty() || code.equals("")){ // if response-code is blank then Success logger.debug("response-code node is empty") @@ -837,9 +829,9 @@ class SDNCAdapterUtils { requestDataResponseCode = code.toInteger() logger.debug("response-code is: " + requestDataResponseCode) } - }else if(taskProcessor.utils.nodeExists(sdncAdapterWorkflowResponse, "ResponseCode")){ + }else if(msoUtils.nodeExists(sdncAdapterWorkflowResponse, "ResponseCode")){ logger.debug("ResponseCode node Exist ") - String code = taskProcessor.utils.getNodeText(sdncAdapterWorkflowResponse, "ResponseCode") + String code = msoUtils.getNodeText(sdncAdapterWorkflowResponse, "ResponseCode") if(code.isEmpty() || code.equals("")){ // if ResponseCode blank then Success logger.debug("ResponseCode node is empty") @@ -918,7 +910,7 @@ class SDNCAdapterUtils { if (success) { // we need to look inside the request data for error - def String callbackRequestData = taskProcessor.utils.getNodeXml(response, 'RequestData', false) + def String callbackRequestData = msoUtils.getNodeXml(response, 'RequestData', false) def String decodedXml = callbackRequestData logger.debug("decodedXml:\n" + decodedXml) @@ -926,17 +918,17 @@ class SDNCAdapterUtils { def requestDataResponseMessage = '' int intDataResponseCode = 200 - if (taskProcessor.utils.nodeExists(decodedXml, "response-code")) { + if (msoUtils.nodeExists(decodedXml, "response-code")) { - requestDataResponseCode = ((String) taskProcessor.utils.getNodeText(decodedXml, "response-code")) - if (taskProcessor.utils.nodeExists(decodedXml, "response-message")) { - requestDataResponseMessage = taskProcessor.utils.getNodeText(decodedXml, "response-message") + requestDataResponseCode = ((String) msoUtils.getNodeText(decodedXml, "response-code")) + if (msoUtils.nodeExists(decodedXml, "response-message")) { + requestDataResponseMessage = msoUtils.getNodeText(decodedXml, "response-message") } - }else if(taskProcessor.utils.nodeExists(decodedXml, "ResponseCode")){ - requestDataResponseCode = ((String) taskProcessor.utils.getNodeText(decodedXml, "ResponseCode")).toInteger() - }else if(taskProcessor.utils.nodeExists(response, "ResponseCode")){ - requestDataResponseCode = ((String) taskProcessor.utils.getNodeText(response, "ResponseCode")).toInteger() - requestDataResponseMessage = taskProcessor.utils.getNodeText(response, "ResponseMessage") + }else if(msoUtils.nodeExists(decodedXml, "ResponseCode")){ + requestDataResponseCode = ((String) msoUtils.getNodeText(decodedXml, "ResponseCode")).toInteger() + }else if(msoUtils.nodeExists(response, "ResponseCode")){ + requestDataResponseCode = ((String) msoUtils.getNodeText(response, "ResponseCode")).toInteger() + requestDataResponseMessage = msoUtils.getNodeText(response, "ResponseMessage") } logger.debug("SDNC callback response-code: " + requestDataResponseCode) @@ -944,8 +936,8 @@ class SDNCAdapterUtils { // Get the AAI Status to determine if rollback is needed on ASSIGN def aai_status = '' - if (taskProcessor.utils.nodeExists(decodedXml, "aai-status")) { - aai_status = ((String) taskProcessor.utils.getNodeText(decodedXml, "aai-status")) + if (msoUtils.nodeExists(decodedXml, "aai-status")) { + aai_status = ((String) msoUtils.getNodeText(decodedXml, "aai-status")) logger.debug("SDNC sent AAI STATUS code: " + aai_status) } if (aai_status != null && !aai_status.equals("")) { @@ -955,8 +947,8 @@ class SDNCAdapterUtils { // Get the result string to determine if rollback is needed on ASSIGN in Add Bonding flow only def sdncResult = '' - if (taskProcessor.utils.nodeExists(decodedXml, "result")) { - sdncResult = ((String) taskProcessor.utils.getNodeText(decodedXml, "result")) + if (msoUtils.nodeExists(decodedXml, "result")) { + sdncResult = ((String) msoUtils.getNodeText(decodedXml, "result")) logger.debug("SDNC sent result: " + sdncResult) } if (sdncResult != null && !sdncResult.equals("")) { diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy index 796ee43cf4..a40bf59097 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy @@ -206,7 +206,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { // Construct payload managementV6AddressEntry = updateGenericVnfNode(origRequest, 'management-v6-address') } - + // Handle orchestration-status String orchestrationStatus = execution.getVariable('UAAIGenVnf_orchestrationStatus') String orchestrationStatusEntry = null @@ -214,7 +214,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { // Construct payload orchestrationStatusEntry = updateGenericVnfNode(origRequest, 'orchestration-status') } - + org.onap.aai.domain.yang.GenericVnf payload = new org.onap.aai.domain.yang.GenericVnf(); payload.setVnfId(vnfId) payload.setPersonaModelVersion(personaModelVersionEntry) @@ -227,8 +227,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { try { getAAIClient().update(uri,payload) } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI PATCH:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI PATCH: {}', ex.getMessage(), ex) execution.setVariable('UAAIGenVnf_updateGenericVnfResponseCode', 500) execution.setVariable('UAAIGenVnf_updateGenericVnfResponse', 'AAI PATCH Failed:' + ex.getMessage()) } @@ -258,9 +257,9 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { return "" } else { - return elementValue + return elementValue } - + } /** diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VidUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VidUtils.groovy index 259a7872a3..1960cafb0f 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VidUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VidUtils.groovy @@ -69,7 +69,7 @@ class VidUtils { public String createXmlVolumeRequest(Map requestMap, String action, String serviceInstanceId) { createXmlVolumeRequest(requestMap, action, serviceInstanceId, '') } - + /** * Create a volume-request XML using a map @@ -84,9 +84,9 @@ class VidUtils { def serviceName = '' def modelCustomizationName = '' def asdcServiceModelVersion = '' - + def suppressRollback = requestMap.requestDetails.requestInfo.suppressRollback - + def backoutOnFailure = "" if(suppressRollback != null){ if ( suppressRollback == true) { @@ -95,7 +95,7 @@ class VidUtils { backoutOnFailure = "true" } } - + def volGrpName = requestMap.requestDetails.requestInfo?.instanceName ?: '' def serviceId = requestMap.requestDetails.requestParameters?.serviceId ?: '' def relatedInstanceList = requestMap.requestDetails.relatedInstanceList @@ -108,16 +108,16 @@ class VidUtils { modelCustomizationName = it.relatedInstance.modelInfo?.modelInstanceName } } - + vnfType = serviceName + '/' + modelCustomizationName - + def userParams = requestMap.requestDetails?.requestParameters?.userParams def userParamsNode = '' if(userParams != null) { userParamsNode = buildUserParams(userParams) } def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationUuid ?: '' - + String xmlReq = """ <volume-request xmlns="http://www.w3.org/2001/XMLSchema"> <request-info> @@ -145,9 +145,9 @@ class VidUtils { // return a pretty-print of the volume-request xml without the preamble return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "") } - + /** - * A common method that can be used to build volume-params node from a map. + * A common method that can be used to build volume-params node from a map. * @param Map userParams * @return */ @@ -166,9 +166,9 @@ class VidUtils { } /** - * A common method that can be used to extract 'requestDetails' + * A common method that can be used to extract 'requestDetails' * @param String json - * @return String json requestDetails + * @return String json requestDetails */ @Deprecated public getJsonRequestDetails(String jsonInput) { @@ -183,10 +183,10 @@ class VidUtils { return rtn } else { return rtn - } + } } } - + /** * A common method that can be used to extract 'requestDetails' in Xml * @param String json @@ -203,17 +203,17 @@ class VidUtils { return XmlTool.normalize(XML.toString(jsonObj)) } } - + /** * Create a network-request XML using a map - * @param execution - * @param xmlRequestDetails - requestDetails in xml + * @param execution + * @param xmlRequestDetails - requestDetails in xml * @return * Note: See latest version: createXmlNetworkRequestInstance() */ public String createXmlNetworkRequestInfra(execution, def networkJsonIncoming) { - + def requestId = execution.getVariable("requestId") def serviceInstanceId = execution.getVariable("serviceInstanceId") def requestAction = execution.getVariable("requestAction") @@ -225,13 +225,13 @@ class VidUtils { def instanceName = reqMap.requestDetails.requestInfo.instanceName def modelCustomizationId = reqMap.requestDetails.modelInfo.modelCustomizationId if (modelCustomizationId == null) { - modelCustomizationId = reqMap.requestDetails.modelInfo.modelCustomizationUuid !=null ? + modelCustomizationId = reqMap.requestDetails.modelInfo.modelCustomizationUuid !=null ? reqMap.requestDetails.modelInfo.modelCustomizationUuid : "" } def modelName = reqMap.requestDetails.modelInfo.modelName def lcpCloudRegionId = reqMap.requestDetails.cloudConfiguration.lcpCloudRegionId def tenantId = reqMap.requestDetails.cloudConfiguration.tenantId - def serviceId = reqMap.requestDetails.requestInfo.productFamilyId + def serviceId = reqMap.requestDetails.requestInfo.productFamilyId def suppressRollback = reqMap.requestDetails.requestInfo.suppressRollback.toString() def backoutOnFailure = "true" if(suppressRollback != null){ @@ -241,7 +241,7 @@ class VidUtils { backoutOnFailure = "true" } } - + //def userParams = reqMap.requestDetails.requestParameters.userParams //def userParamsNode = buildUserParams(userParams) def userParams = reqMap.requestDetails?.requestParameters?.userParams @@ -249,26 +249,26 @@ class VidUtils { if(userParams != null) { userParamsNode = buildUserParams(userParams) } - + //'sdncVersion' = current, '1610' (non-RPC SDNC) or '1702' (RPC SDNC) def sdncVersion = execution.getVariable("sdncVersion") - + String xmlReq = """ - <network-request xmlns="http://www.w3.org/2001/XMLSchema"> - <request-info> + <network-request xmlns="http://www.w3.org/2001/XMLSchema"> + <request-info> <request-id>${MsoUtils.xmlEscape(requestId)}</request-id> - <action>${MsoUtils.xmlEscape(requestAction)}</action> - <source>VID</source> + <action>${MsoUtils.xmlEscape(requestAction)}</action> + <source>VID</source> <service-instance-id>${MsoUtils.xmlEscape(serviceInstanceId)}</service-instance-id> - </request-info> + </request-info> <network-inputs> - <network-id>${MsoUtils.xmlEscape(networkId)}</network-id> - <network-name>${MsoUtils.xmlEscape(instanceName)}</network-name> + <network-id>${MsoUtils.xmlEscape(networkId)}</network-id> + <network-name>${MsoUtils.xmlEscape(instanceName)}</network-name> <network-type>${MsoUtils.xmlEscape(modelName)}</network-type> - <modelCustomizationId>${MsoUtils.xmlEscape(modelCustomizationId)}</modelCustomizationId> - <aic-cloud-region>${MsoUtils.xmlEscape(lcpCloudRegionId)}</aic-cloud-region> + <modelCustomizationId>${MsoUtils.xmlEscape(modelCustomizationId)}</modelCustomizationId> + <aic-cloud-region>${MsoUtils.xmlEscape(lcpCloudRegionId)}</aic-cloud-region> <tenant-id>${MsoUtils.xmlEscape(tenantId)}</tenant-id> - <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> + <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> <backout-on-failure>${MsoUtils.xmlEscape(backoutOnFailure)}</backout-on-failure> <sdncVersion>${MsoUtils.xmlEscape(sdncVersion)}</sdncVersion> </network-inputs> @@ -281,8 +281,7 @@ class VidUtils { return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "") } catch(Exception e) { - logger.debug("{} {}", "Error in Vid Utils", e.getCause()) - e.printStackTrace(); + logger.debug("Error in Vid Utils: {}", e.getCause(), e) throw e } } @@ -299,7 +298,7 @@ class VidUtils { def networkModelVersion = "" def networkModelCustomizationUuid = "" def networkModelInvariantUuid = "" - + // verify the DB Catalog response JSON structure def networkModelInfo = execution.getVariable("networkModelInfo") def jsonSlurper = new JsonSlurper() @@ -326,14 +325,14 @@ class VidUtils { } catch (Exception ex) { throw ex } - } - + } + def serviceModelUuid = "" def serviceModelName = "" def serviceModelVersion = "" def serviceModelCustomizationUuid = "" def serviceModelInvariantUuid = "" - + // verify the DB Catalog response JSON structure def serviceModelInfo = execution.getVariable("serviceModelInfo") def jsonServiceSlurper = new JsonSlurper() @@ -361,8 +360,8 @@ class VidUtils { throw ex } } - - + + def subscriptionServiceType = execution.getVariable("subscriptionServiceType") != null ? execution.getVariable("subscriptionServiceType") : "" def globalSubscriberId = execution.getVariable("globalSubscriberId") != null ? execution.getVariable("globalSubscriberId") : "" def requestId = execution.getVariable("msoRequestId") @@ -382,88 +381,88 @@ class VidUtils { backoutOnFailure = "true" } } - + //'sdncVersion' = current, '1610' (non-RPC SDNC) or '1702' (RPC SDNC) def sdncVersion = execution.getVariable("sdncVersion") - + def source = "VID" def action = execution.getVariable("action") - + def userParamsNode = "" def userParams = execution.getVariable("networkInputParams") if(userParams != null) { userParamsNode = buildUserParams(userParams) } - + String xmlReq = """ - <network-request xmlns="http://www.w3.org/2001/XMLSchema"> - <request-info> + <network-request xmlns="http://www.w3.org/2001/XMLSchema"> + <request-info> <request-id>${MsoUtils.xmlEscape(requestId)}</request-id> - <action>${MsoUtils.xmlEscape(action)}</action> - <source>${MsoUtils.xmlEscape(source)}</source> + <action>${MsoUtils.xmlEscape(action)}</action> + <source>${MsoUtils.xmlEscape(source)}</source> <service-instance-id>${MsoUtils.xmlEscape(serviceInstanceId)}</service-instance-id> - </request-info> - <network-inputs> - <network-id>${MsoUtils.xmlEscape(networkId)}</network-id> - <network-name>${MsoUtils.xmlEscape(networkName)}</network-name> + </request-info> + <network-inputs> + <network-id>${MsoUtils.xmlEscape(networkId)}</network-id> + <network-name>${MsoUtils.xmlEscape(networkName)}</network-name> <network-type>${MsoUtils.xmlEscape(networkModelName)}</network-type> <subscription-service-type>${MsoUtils.xmlEscape(subscriptionServiceType)}</subscription-service-type> <global-customer-id>${MsoUtils.xmlEscape(globalSubscriberId)}</global-customer-id> - <aic-cloud-region>${MsoUtils.xmlEscape(aicCloudReqion)}</aic-cloud-region> + <aic-cloud-region>${MsoUtils.xmlEscape(aicCloudReqion)}</aic-cloud-region> <tenant-id>${MsoUtils.xmlEscape(tenantId)}</tenant-id> - <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> + <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> <backout-on-failure>${MsoUtils.xmlEscape(backoutOnFailure)}</backout-on-failure> <failIfExist>${MsoUtils.xmlEscape(failIfExist)}</failIfExist> <networkModelInfo> <modelName>${MsoUtils.xmlEscape(networkModelName)}</modelName> <modelUuid>${MsoUtils.xmlEscape(networkModelUuid)}</modelUuid> - <modelInvariantUuid>${MsoUtils.xmlEscape(networkModelInvariantUuid)}</modelInvariantUuid> + <modelInvariantUuid>${MsoUtils.xmlEscape(networkModelInvariantUuid)}</modelInvariantUuid> <modelVersion>${MsoUtils.xmlEscape(networkModelVersion)}</modelVersion> <modelCustomizationUuid>${MsoUtils.xmlEscape(networkModelCustomizationUuid)}</modelCustomizationUuid> </networkModelInfo> <serviceModelInfo> <modelName>${MsoUtils.xmlEscape(serviceModelName)}</modelName> <modelUuid>${MsoUtils.xmlEscape(serviceModelUuid)}</modelUuid> - <modelInvariantUuid>${MsoUtils.xmlEscape(serviceModelInvariantUuid)}</modelInvariantUuid> + <modelInvariantUuid>${MsoUtils.xmlEscape(serviceModelInvariantUuid)}</modelInvariantUuid> <modelVersion>${MsoUtils.xmlEscape(serviceModelVersion)}</modelVersion> <modelCustomizationUuid>${MsoUtils.xmlEscape(serviceModelCustomizationUuid)}</modelCustomizationUuid> - - </serviceModelInfo> - <sdncVersion>${MsoUtils.xmlEscape(sdncVersion)}</sdncVersion> + + </serviceModelInfo> + <sdncVersion>${MsoUtils.xmlEscape(sdncVersion)}</sdncVersion> </network-inputs> <network-params> ${userParamsNode} - </network-params> + </network-params> </network-request> """ // return a pretty-print of the volume-request xml without the preamble return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "") - + } - + /** * Create a vnf-request XML using a map - * @param requestMap - map created from VID JSON + * @param requestMap - map created from VID JSON * @param action * @return */ public String createXmlVfModuleRequest(execution, Map requestMap, String action, String serviceInstanceId) { - + //def relatedInstanceList = requestMap.requestDetails.relatedInstanceList - + //relatedInstanceList.each { // if (it.relatedInstance.modelInfo.modelType == 'vnf') { // vnfType = it.relatedInstance.modelInfo.modelName // vnfId = it.relatedInstance.modelInfo.modelInvariantId // } //} - + def vnfName = '' def asdcServiceModelInfo = '' - + def relatedInstanceList = requestMap.requestDetails?.relatedInstanceList - - + + if (relatedInstanceList != null) { relatedInstanceList.each { if (it.relatedInstance.modelInfo?.modelType == 'service') { @@ -474,30 +473,30 @@ class VidUtils { } } } - + def vnfType = execution.getVariable('vnfType') def vnfId = execution.getVariable('vnfId') def vfModuleId = execution.getVariable('vfModuleId') def volumeGroupId = execution.getVariable('volumeGroupId') def userParams = requestMap.requestDetails?.requestParameters?.userParams - - + + def userParamsNode = '' if(userParams != null) { userParamsNode = buildUserParams(userParams) } - + def isBaseVfModule = "false" if (execution.getVariable('isBaseVfModule') == true) { isBaseVfModule = "true" } - + def requestId = execution.getVariable("mso-request-id") def vfModuleName = requestMap.requestDetails?.requestInfo?.instanceName ?: '' def vfModuleModelName = requestMap.requestDetails?.modelInfo?.modelName ?: '' def suppressRollback = requestMap.requestDetails?.requestInfo?.suppressRollback - + def backoutOnFailure = "" if(suppressRollback != null){ if ( suppressRollback == true) { @@ -506,14 +505,14 @@ class VidUtils { backoutOnFailure = "true" } } - + def serviceId = requestMap.requestDetails?.requestParameters?.serviceId ?: '' def aicCloudRegion = requestMap.requestDetails?.cloudConfiguration?.lcpCloudRegionId ?: '' def tenantId = requestMap.requestDetails?.cloudConfiguration?.tenantId ?: '' def personaModelId = requestMap.requestDetails?.modelInfo?.modelInvariantUuid ?: '' def personaModelVersion = requestMap.requestDetails?.modelInfo?.modelUuid ?: '' def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationUuid ?: '' - + String xmlReq = """ <vnf-request> <request-info> @@ -524,17 +523,17 @@ class VidUtils { </request-info> <vnf-inputs> <!-- not in use in 1610 --> - <vnf-name>${MsoUtils.xmlEscape(vnfName)}</vnf-name> + <vnf-name>${MsoUtils.xmlEscape(vnfName)}</vnf-name> <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id> <volume-group-id>${MsoUtils.xmlEscape(volumeGroupId)}</volume-group-id> <vf-module-id>${MsoUtils.xmlEscape(vfModuleId)}</vf-module-id> - <vf-module-name>${MsoUtils.xmlEscape(vfModuleName)}</vf-module-name> + <vf-module-name>${MsoUtils.xmlEscape(vfModuleName)}</vf-module-name> <vf-module-model-name>${MsoUtils.xmlEscape(vfModuleModelName)}</vf-module-model-name> <model-customization-id>${MsoUtils.xmlEscape(modelCustomizationId)}</model-customization-id> <is-base-vf-module>${MsoUtils.xmlEscape(isBaseVfModule)}</is-base-vf-module> <asdc-service-model-version>${MsoUtils.xmlEscape(asdcServiceModelInfo)}</asdc-service-model-version> - <aic-cloud-region>${MsoUtils.xmlEscape(aicCloudRegion)}</aic-cloud-region> + <aic-cloud-region>${MsoUtils.xmlEscape(aicCloudRegion)}</aic-cloud-region> <tenant-id>${MsoUtils.xmlEscape(tenantId)}</tenant-id> <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> <backout-on-failure>${MsoUtils.xmlEscape(backoutOnFailure)}</backout-on-failure> @@ -546,10 +545,10 @@ class VidUtils { </vnf-params> </vnf-request> """ - + // return a pretty-print of the volume-request xml without the preamble return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "") } - + } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy index ac67d949a5..aacd385a3b 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy @@ -294,7 +294,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { } catch (IOException ex) { logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), getProcessKey(execution) + ": Unable to encode BasicAuth credentials for VnfAdapter", - "BPMN", ErrorCode.UnknownError.getValue()); + "BPMN", ErrorCode.UnknownError.getValue(), ex); } } @@ -398,7 +398,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { vnfAdapterWorkflowException(execution, callback) } } catch (Exception e) { - logger.debug("Error encountered within VnfAdapterRest ProcessCallback method", e) + logger.debug("Error encountered within VnfAdapterRest ProcessCallback method: {}", e.getMessage(), e) exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method") } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java index 5352fc2fe0..2cc6415a50 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java @@ -146,7 +146,7 @@ public abstract class FlowValidatorRunner<S extends FlowValidator, E extends Flo result.add(klass.newInstance()); } } catch (InstantiationException | IllegalAccessException e) { - logger.error("failed to build validator list for " + clazz.getName(), e); + logger.error("failed to build validator list for {}", clazz.getName(), e); throw new RuntimeException(e); } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java index 260a9420c8..8af6e809f4 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java @@ -49,7 +49,7 @@ public class ExtractPojosForBB { public <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key) throws BBObjectNotFoundException { return extractByKey(execution, key, execution.getLookupMap().get(key)); } - protected <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key, String value) + public <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key, String value) throws BBObjectNotFoundException { Optional<T> result = Optional.empty(); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java index 29abe4413b..0b2ef928ad 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java @@ -25,11 +25,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.ccsdk.apps.controllerblueprints.common.api.ActionIdentifiers; -import org.onap.ccsdk.apps.controllerblueprints.common.api.CommonHeader; -import org.onap.ccsdk.apps.controllerblueprints.common.api.EventType; -import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceInput; -import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceOutput; +import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; +import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader; +import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.onap.so.client.PreconditionFailedException; import org.onap.so.client.RestPropertiesLoader; import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean; diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy index 51dd77d383..570acf4524 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterUtilsTest.groovy @@ -53,12 +53,7 @@ public class SDNCAdapterUtilsTest { map = new HashMap<String,Object>() svcex = mock(ExecutionEntity.class) wfex = null - tp = new AbstractServiceTaskProcessor() { - @Override - public void preProcessRequest(DelegateExecution execution) { - } - }; - utils = new SDNCAdapterUtils(tp) + utils = new SDNCAdapterUtils() // svcex gets its variables from "map" when(svcex.getVariable(any())).thenAnswer( |