diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
29 files changed, 276 insertions, 158 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy index c7fcc5c5d3..35e68bb79f 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018 Intel Corp. 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. diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy index 7c5ffca4ab..8ce633845b 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018 Intel Corp. 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. @@ -82,20 +82,20 @@ class OofUtils { //ServiceInstance Info ServiceInstance serviceInstance = decomposition.getServiceInstance() def serviceInstanceId = "" - def serviceInstanceName = "" + def serviceName = "" serviceInstanceId = execution.getVariable("serviceInstanceId") - serviceInstanceName = execution.getVariable("serviceInstanceName") + serviceName = execution.getVariable("subscriptionServiceType") if (serviceInstanceId == null || serviceInstanceId == "null") { utils.log("DEBUG", "Unable to obtain Service Instance Id", isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + - "obtain Service Instance Id, execution.getVariable(\"serviceInstanceName\") is null") + "obtain Service Instance Id, execution.getVariable(\"serviceInstanceId\") is null") } - if (serviceInstanceName == null || serviceInstanceName == "null") { - utils.log("DEBUG", "Unable to obtain Service Instance Name", isDebugEnabled) + if (serviceName == null || serviceName == "null") { + utils.log("DEBUG", "Unable to obtain Service Name", isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " + - "obtain Service Instance Name, execution.getVariable(\"serviceInstanceName\") is null") + "obtain Service Name, execution.getVariable(\"subscriptionServiceType\") is null") } //Model Info ModelInfo model = decomposition.getModelInfo() @@ -144,24 +144,12 @@ class OofUtils { utils.log("DEBUG", "Allotted Resource: " + resource.toString(), isDebugEnabled) def serviceResourceId = resource.getResourceId() - def resourceModuleName = resource.getNfFunction() - utils.log("DEBUG", "resourceModuleName: " + resourceModuleName, - isDebugEnabled) - def resourceModelInvariantId = "no-resourceModelInvariantId" - def resourceModelVersionId = "no-resourceModelVersionId" - - List modelIdLst = execution.getVariable("homingModelIds") - utils.log("DEBUG", "Incoming modelIdLst is: " + modelIdLst.toString(), isDebugEnabled) - for (Map modelId : modelIdLst ) - if (resourceModuleName == modelId.resourceModuleName) { - resourceModelInvariantId = modelId.resourceModelInvariantId - resourceModelVersionId = modelId.resourceModelVersionId - } - - def resourceModelName = "" //Optional - def resourceModelVersion = "" //Optional - def resourceModelType = "" //Optional - def tenantId = "" //Optional + def resourceModelInvariantId = resource.getModelInfo().getModelInvariantUuid() + def resourceModelVersionId = resource.getModelInfo().getModelUuid() + def resourceModelName = resource.getModelInfo().getModelName() + def resourceModelVersion = resource.getModelInfo().getModelVersion() + def resourceModelType = resource.getModelInfo().getModelType() + def tenantId = execution.getVariable("tenantId") def requiredCandidatesJson = "" requiredCandidatesJson = createCandidateJson( @@ -171,7 +159,7 @@ class OofUtils { String demand = " {\n" + - " \"resourceModuleName\": \"${resourceModuleName}\",\n" + + " \"resourceModuleName\": \"${resourceModelName}\",\n" + " \"serviceResourceId\": \"${serviceResourceId}\",\n" + " \"tenantId\": \"${tenantId}\",\n" + " \"resourceModelInfo\": {\n" + @@ -191,21 +179,18 @@ class OofUtils { isDebugEnabled) ModelInfo vnfResourceModelInfo = vnfResource.getModelInfo() def serviceResourceId = vnfResource.getResourceId() - def resourceModuleName = vnfResource.getNfFunction() - utils.log("DEBUG", "resourceModuleName: " + resourceModuleName, - isDebugEnabled) def resourceModelInvariantId = vnfResourceModelInfo.getModelInvariantUuid() def resourceModelName = vnfResourceModelInfo.getModelName() def resourceModelVersion = vnfResourceModelInfo.getModelVersion() def resourceModelVersionId = vnfResourceModelInfo.getModelUuid() def resourceModelType = vnfResourceModelInfo.getModelType() - def tenantId = "" //Optional + def tenantId = execution.getVariable("tenantId") def requiredCandidatesJson = "" String placementDemand = " {\n" + - " \"resourceModuleName\": \"${resourceModuleName}\",\n" + + " \"resourceModuleName\": \"${resourceModelName}\",\n" + " \"serviceResourceId\": \"${serviceResourceId}\",\n" + " \"tenantId\": \"${tenantId}\",\n" + " \"resourceModelInfo\": {\n" + @@ -297,7 +282,7 @@ class OofUtils { " },\n" + " \"serviceInfo\": {\n" + " \"serviceInstanceId\": \"${serviceInstanceId}\",\n" + - " \"serviceName\": \"${serviceInstanceName}\",\n" + + " \"serviceName\": \"${serviceName}\",\n" + " \"modelInfo\": {\n" + " \"modelType\": \"${modelType}\",\n" + " \"modelInvariantId\": \"${modelInvariantId}\",\n" + 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 ba450c1b12..58c8f27de9 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 @@ -7,9 +7,9 @@ * 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. @@ -281,14 +281,14 @@ class SDNCAdapterUtils { } boolean isAic3 = execution.getVariable("isAic3") - + if(isAic3) { nnsl2HomingInformation = updateHomingInfo(nnsl2HomingInformation, "AIC3.0") } else { nnsl2HomingInformation = updateHomingInfo(nnsl2HomingInformation, "AIC2.X") } - + String content = """ <sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:sdncadapterworkflow="http://openecomp.com/mso/workflow/schema/v1" xmlns:sdncadapter="http://domain2.openecomp.com/workflow/sdnc/adapter/schema/v1"> @@ -319,7 +319,7 @@ class SDNCAdapterUtils { /** * Builds an SDNC "reserve" request and stores it in the specified execution - * variable. + * variable. * @param execution the execution * @param action the type of action: reserve, turnup, etc * @param resultVar the execution variable in which the result will be stored @@ -424,7 +424,7 @@ class SDNCAdapterUtils { if (additionalData == null) { additionalData = "" } - + if(isAic3) { nnsl2HomingInformation = updateHomingInfo(nnsl2HomingInformation, "AIC3.0") } @@ -470,7 +470,7 @@ class SDNCAdapterUtils { exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Internal Error") } } - + public String updateHomingInfo(String homingInfo, String aicVersion) { String newHomingInfo if(homingInfo == null || homingInfo.trim().length() == 0) { @@ -480,7 +480,7 @@ class SDNCAdapterUtils { newHomingInfo = homingInfo.substring(0, homingInfo.indexOf("</l2-homing-information>")) + "<aic-version>" + aicVersion + "</aic-version></l2-homing-information>" } } - + /** * Builds a topology SDNC request and return String request. * As V2 will use 1607-style request, region instead of aic clli code @@ -506,7 +506,7 @@ class SDNCAdapterUtils { } else { hdrRequestId = testHdrRequestId } - + String requestId = "" try { requestId = execution.getVariable("mso-request-id") @@ -561,6 +561,9 @@ class SDNCAdapterUtils { int subscriberNameEnd = siRelatedLink.indexOf("/service-subscriptions/") subscriberName = siRelatedLink.substring(subscriberNameStart + 19, subscriberNameEnd) subscriberName = UriUtils.decode(subscriberName,"UTF-8") + }else{ + serviceType = execution.getVariable("serviceType") + subscriberName = execution.getVariable("subscriberName") } String content = @@ -635,11 +638,11 @@ class SDNCAdapterUtils { requestId = execution.getVariable("mso-request-id") if (requestId == null) { requestId = execution.getVariable("msoRequestId") - } + } } else { requestId = testRequestId - } - + } + String aicCloudRegion = cloudRegionId String tenantId = "" if (utils.nodeExists(requestXML, "tenant-id")) { @@ -717,7 +720,7 @@ class SDNCAdapterUtils { String content = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" - xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1" + xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1" xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"> <sdncadapter:RequestHeader> <sdncadapter:RequestId>${MsoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId> @@ -993,7 +996,7 @@ class SDNCAdapterUtils { exceptionUtil.buildAndThrowWorkflowException(execution, 400, msg) } } - + public String modelInfoToEcompModelInformation(String jsonModelInfo) { String modelInvariantUuid = jsonUtil.getJsonValue(jsonModelInfo, "modelInvariantUuid") String modelUuid = jsonUtil.getJsonValue(jsonModelInfo, "modelUuid") @@ -1004,11 +1007,11 @@ class SDNCAdapterUtils { String modelCustomizationString = "" if (modelCustomizationUuid != null) { modelCustomizationString = "<model-customization-uuid>${MsoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>" - } + } String modelVersion = jsonUtil.getJsonValue(jsonModelInfo, "modelVersion") if (modelVersion == null) { modelVersion = "" - } + } String modelName = jsonUtil.getJsonValue(jsonModelInfo, "modelName") String ecompModelInformation = """<onap-model-information> @@ -1019,6 +1022,6 @@ class SDNCAdapterUtils { <model-name>${MsoUtils.xmlEscape(modelName)}</model-name> </onap-model-information>""" - return ecompModelInformation - } + return ecompModelInformation + } }
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/CtagAssignment.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/CtagAssignment.java index 937c79be1d..978f1e9324 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/CtagAssignment.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/CtagAssignment.java @@ -37,13 +37,13 @@ public class CtagAssignment implements Serializable, ShallowCopy<CtagAssignment> @Id @JsonProperty("vlan-id-inner") - private long vlanIdInner; + private Long vlanIdInner; - public long getVlanIdInner() { + public Long getVlanIdInner() { return vlanIdInner; } - public void setVlanIdInner(long vlanIdInner) { + public void setVlanIdInner(Long vlanIdInner) { this.vlanIdInner = vlanIdInner; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java index 218763a006..17bd4f545b 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/GenericVnf.java @@ -62,7 +62,7 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { @JsonProperty("platform") private Platform platform; @JsonProperty("cascaded") - private boolean cascaded; + private Boolean cascaded; @JsonProperty("cloud-params") private Map<String, String> cloudParams = new HashMap<>(); @JsonProperty("cloud-context") @@ -104,9 +104,9 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { @JsonProperty("vdisk-units") private String vdiskUnits; @JsonProperty("in-maint") - private boolean inMaint; + private Boolean inMaint; @JsonProperty("is-closed-loop-disabled") - private boolean isClosedLoopDisabled; + private Boolean isClosedLoopDisabled; @JsonProperty("summary-status") private String summaryStatus; @JsonProperty("encrypted-access-flag") @@ -138,7 +138,7 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { @JsonProperty("instance-groups") private List<InstanceGroup> instanceGroups = new ArrayList<InstanceGroup>(); @JsonProperty("call-homing") - private boolean callHoming; + private Boolean callHoming; public List<InstanceGroup> getInstanceGroups() { @@ -309,19 +309,19 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { this.vdiskUnits = vdiskUnits; } - public boolean isInMaint() { + public Boolean isInMaint() { return inMaint; } - public void setInMaint(boolean inMaint) { + public void setInMaint(Boolean inMaint) { this.inMaint = inMaint; } - public boolean isClosedLoopDisabled() { + public Boolean isIsClosedLoopDisabled() { return isClosedLoopDisabled; } - public void setClosedLoopDisabled(boolean isClosedLoopDisabled) { + public void setClosedLoopDisabled(Boolean isClosedLoopDisabled) { this.isClosedLoopDisabled = isClosedLoopDisabled; } @@ -453,11 +453,11 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { this.platform = platform; } - public boolean isCascaded() { + public Boolean isCascaded() { return cascaded; } - public void setCascaded(boolean cascaded) { + public void setCascaded(Boolean cascaded) { this.cascaded = cascaded; } @@ -485,11 +485,11 @@ public class GenericVnf implements Serializable, ShallowCopy<GenericVnf> { this.cloudRegion = cloudRegion; } - public boolean isCallHoming() { + public Boolean isCallHoming() { return callHoming; } - public void setCallHoming(boolean callHoming) { + public void setCallHoming(Boolean callHoming) { this.callHoming = callHoming; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java index 51cd998073..5f43ba076a 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java @@ -46,7 +46,7 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { @JsonProperty("network-id") private String networkId; @JsonProperty("cascaded") - private boolean cascaded; + private Boolean cascaded; @JsonProperty("cloud-params") private Map<String, String> cloudParams = new HashMap<>(); @JsonProperty("network-name") @@ -60,7 +60,7 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { @JsonProperty("network-role") private String networkRole; @JsonProperty("is-bound-to-vpn") - private boolean isBoundToVpn; + private Boolean isBoundToVpn; @JsonProperty("service-id") private String serviceId; @JsonProperty("network-role-instance") @@ -82,11 +82,11 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { @JsonProperty("physical-network-name") private String physicalNetworkName; @JsonProperty("is-provider-network") - private boolean isProviderNetwork; + private Boolean isProviderNetwork; @JsonProperty("is-shared-network") - private boolean isSharedNetwork; + private Boolean isSharedNetwork; @JsonProperty("is-external-network") - private boolean isExternalNetwork; + private Boolean isExternalNetwork; @JsonProperty("self-link") private String selflink; @JsonProperty("operational-status") @@ -142,10 +142,10 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { public void setNetworkRole(String networkRole) { this.networkRole = networkRole; } - public boolean isBoundToVpn() { + public Boolean isIsBoundToVpn() { return isBoundToVpn; } - public void setIsBoundToVpn(boolean isBoundToVpn) { + public void setIsBoundToVpn(Boolean isBoundToVpn) { this.isBoundToVpn = isBoundToVpn; } public String getServiceId() { @@ -202,22 +202,22 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { public void setPhysicalNetworkName(String physicalNetworkName) { this.physicalNetworkName = physicalNetworkName; } - public boolean isProviderNetwork() { + public Boolean isIsProviderNetwork() { return isProviderNetwork; } - public void setIsProviderNetwork(boolean isProviderNetwork) { + public void setIsProviderNetwork(Boolean isProviderNetwork) { this.isProviderNetwork = isProviderNetwork; } - public boolean isSharedNetwork() { + public Boolean isIsSharedNetwork() { return isSharedNetwork; } - public void setIsSharedNetwork(boolean isSharedNetwork) { + public void setIsSharedNetwork(Boolean isSharedNetwork) { this.isSharedNetwork = isSharedNetwork; } - public boolean isExternalNetwork() { + public Boolean isIsExternalNetwork() { return isExternalNetwork; } - public void setIsExternalNetwork(boolean isExternalNetwork) { + public void setIsExternalNetwork(Boolean isExternalNetwork) { this.isExternalNetwork = isExternalNetwork; } public String getSelflink() { @@ -242,10 +242,10 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { public List<SegmentationAssignment> getSegmentationAssignments() { return segmentationAssignments; } - public boolean isCascaded() { + public Boolean isCascaded() { return cascaded; } - public void setIsCascaded(boolean cascaded) { + public void setIsCascaded(Boolean cascaded) { this.cascaded = cascaded; } public Map<String, String> getCloudParams() { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java index 4bba39ee62..f102c15062 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LInterface.java @@ -57,13 +57,13 @@ public class LInterface implements Serializable, ShallowCopy<LInterface>{ @JsonProperty("interface-description") private String interfaceDescription; @JsonProperty("is-port-mirrored") - private boolean isPortMirrored; + private Boolean isPortMirrored; @JsonProperty("in-maint") - private boolean inMaint; + private Boolean inMaint; @JsonProperty("prov-status") private String provStatus; @JsonProperty("is-ip-unnumbered") - private boolean isIpUnnumbered; + private Boolean isIpUnnumbered; @JsonProperty("allowed-address-pairs") private String allowedAddressPairs; @JsonProperty("vlans") @@ -131,13 +131,13 @@ public class LInterface implements Serializable, ShallowCopy<LInterface>{ public void setInterfaceDescription(String interfaceDescription) { this.interfaceDescription = interfaceDescription; } - public boolean isPortMirrored() { + public Boolean isIsPortMirrored() { return isPortMirrored; } - public void setPortMirrored(boolean isPortMirrored) { + public void setPortMirrored(Boolean isPortMirrored) { this.isPortMirrored = isPortMirrored; } - public boolean isInMaint() { + public Boolean isInMaint() { return inMaint; } public void setInMaint(boolean inMaint) { @@ -149,10 +149,10 @@ public class LInterface implements Serializable, ShallowCopy<LInterface>{ public void setProvStatus(String provStatus) { this.provStatus = provStatus; } - public boolean isIpUnnumbered() { + public Boolean isIsIpUnnumbered() { return isIpUnnumbered; } - public void setIpUnnumbered(boolean isIpUnnumbered) { + public void setIpUnnumbered(Boolean isIpUnnumbered) { this.isIpUnnumbered = isIpUnnumbered; } public String getAllowedAddressPairs() { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LagInterface.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LagInterface.java index 8a3248e92c..f69f4628fa 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LagInterface.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LagInterface.java @@ -53,7 +53,7 @@ public class LagInterface implements Serializable, ShallowCopy<LagInterface>{ @JsonProperty("prov-status") private String provStatus; @JsonProperty("in-maint") - private boolean inMaint; + private Boolean inMaint; @JsonProperty("l-interfaces") private List<LInterface> lInterfaces = new ArrayList<>(); @@ -99,7 +99,7 @@ public class LagInterface implements Serializable, ShallowCopy<LagInterface>{ public void setProvStatus(String provStatus) { this.provStatus = provStatus; } - public boolean isInMaint() { + public Boolean isInMaint() { return inMaint; } public void setInMaint(boolean inMaint) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PhysicalLink.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PhysicalLink.java index 4f54139386..742a541352 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PhysicalLink.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/PhysicalLink.java @@ -48,9 +48,9 @@ public class PhysicalLink implements Serializable, ShallowCopy<PhysicalLink> { @JsonProperty("management-option") private String managementOption; @JsonProperty("bandwidth-up") - private int bandwidthUp; + private Integer bandwidthUp; @JsonProperty("bandwidth-down") - private int bandwidthDown; + private Integer bandwidthDown; @JsonProperty("bandwidth-units") private String bandwidthUnits; @JsonProperty("wan-port") @@ -99,19 +99,19 @@ public class PhysicalLink implements Serializable, ShallowCopy<PhysicalLink> { this.managementOption = managementOption; } - public int getBandwidthUp(){ + public Integer getBandwidthUp(){ return bandwidthUp; } - public void setBandwidthUp(int bandwidthUp){ + public void setBandwidthUp(Integer bandwidthUp){ this.bandwidthUp = bandwidthUp; } - public int getBandwidthDown(){ + public Integer getBandwidthDown(){ return bandwidthDown; } - public void setBandwidthDown(int bandwidthDown){ + public void setBandwidthDown(Integer bandwidthDown){ this.bandwidthDown = bandwidthDown; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Subnet.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Subnet.java index cb23f3a3b9..7277438102 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Subnet.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Subnet.java @@ -57,7 +57,7 @@ public class Subnet implements Serializable, ShallowCopy<Subnet>{ @JsonProperty("orchestration-status") private OrchestrationStatus orchestrationStatus; @JsonProperty("dhcp-enabled") - private boolean dhcpEnabled; + private Boolean dhcpEnabled; @JsonProperty("dhcp-start") private String dhcpStart; @JsonProperty("dhcp-end") @@ -119,10 +119,10 @@ public class Subnet implements Serializable, ShallowCopy<Subnet>{ public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) { this.orchestrationStatus = orchestrationStatus; } - public boolean isDhcpEnabled() { + public Boolean isDhcpEnabled() { return dhcpEnabled; } - public void setDhcpEnabled(boolean dhcpEnabled) { + public void setDhcpEnabled(Boolean dhcpEnabled) { this.dhcpEnabled = dhcpEnabled; } public String getDhcpStart() { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VfModule.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VfModule.java index fba78d7a87..469bc991b4 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VfModule.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VfModule.java @@ -50,7 +50,7 @@ public class VfModule implements Serializable, ShallowCopy<VfModule> { @JsonProperty("cloud-params") private Map<String, String> cloudParams = new HashMap<>(); @JsonProperty("cascaded") - private boolean cascaded; + private Boolean cascaded; @JsonProperty("heat-stack-id") private String heatStackId; @JsonProperty("contrail-service-instance-fqdn") @@ -116,7 +116,7 @@ public class VfModule implements Serializable, ShallowCopy<VfModule> { public void setCloudParams(Map<String, String> cloudParams) { this.cloudParams = cloudParams; } - public boolean isCascaded() { + public Boolean isCascaded() { return cascaded; } public void setCascaded(boolean cascaded) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java index 65eeedc44c..a0788d4b0d 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Vlan.java @@ -59,11 +59,11 @@ public class Vlan implements Serializable, ShallowCopy<Vlan>{ @JsonProperty("orchestration-status") private OrchestrationStatus orchestrationStatus; @JsonProperty("in-maint") - private boolean inMaint; + private Boolean inMaint; @JsonProperty("prov-status") private String provStatus; @JsonProperty("is-ip-unnumbered") - private boolean isIpUnnumbered; + private Boolean isIpUnnumbered; @JsonProperty("l3-interface-ipv4-address-list") private List<L3InterfaceIpv4AddressList> l3InterfaceIpv4AddressList = new ArrayList<L3InterfaceIpv4AddressList>(); @JsonProperty("l3-interface-ipv6-address-list") @@ -123,7 +123,7 @@ public class Vlan implements Serializable, ShallowCopy<Vlan>{ public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) { this.orchestrationStatus = orchestrationStatus; } - public boolean isInMaint() { + public Boolean isInMaint() { return inMaint; } public void setInMaint(boolean inMaint) { @@ -135,10 +135,10 @@ public class Vlan implements Serializable, ShallowCopy<Vlan>{ public void setProvStatus(String provStatus) { this.provStatus = provStatus; } - public boolean isIpUnnumbered() { + public Boolean isIsIpUnnumbered() { return isIpUnnumbered; } - public void setIpUnnumbered(boolean isIpUnnumbered) { + public void setIpUnnumbered(Boolean isIpUnnumbered) { this.isIpUnnumbered = isIpUnnumbered; } public List<L3InterfaceIpv4AddressList> getL3InterfaceIpv4AddressList() { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VolumeGroup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VolumeGroup.java index 565a151077..99a643a129 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VolumeGroup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/VolumeGroup.java @@ -52,7 +52,7 @@ public class VolumeGroup implements Serializable, ShallowCopy<VolumeGroup> { @JsonProperty("cloud-params") private Map<String, String> cloudParams = new HashMap<>(); @JsonProperty("cascaded") - private boolean cascaded; + private Boolean cascaded; @JsonProperty("heat-stack-id") private String heatStackId; @JsonProperty("model-info-vf-module") @@ -100,7 +100,7 @@ public class VolumeGroup implements Serializable, ShallowCopy<VolumeGroup> { public void setCloudParams(Map<String, String> cloudParams) { this.cloudParams = cloudParams; } - public boolean isCascaded() { + public Boolean isCascaded() { return cascaded; } public void setCascaded(boolean cascaded) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java index 38f974168e..7b11e9f68e 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/BuildingBlock.java @@ -37,7 +37,7 @@ public class BuildingBlock implements Serializable{ @JsonProperty("key") private String key; @JsonProperty("is-virtual-link") - private boolean isVirtualLink; + private Boolean isVirtualLink; @JsonProperty("virtual-link-key") private String virtualLinkKey; @@ -59,10 +59,10 @@ public class BuildingBlock implements Serializable{ public void setKey(String key) { this.key = key; } - public boolean getIsVirtualLink() { + public Boolean getIsVirtualLink() { return isVirtualLink; } - public void setIsVirtualLink(boolean isVirtualLink) { + public void setIsVirtualLink(Boolean isVirtualLink) { this.isVirtualLink = isVirtualLink; } public String getVirtualLinkKey() { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java index 36a24bd1e1..0d04b5e7a1 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ExecuteBuildingBlock.java @@ -35,8 +35,8 @@ public class ExecuteBuildingBlock implements Serializable{ private String resourceId; private String requestAction; private String vnfType; - private boolean aLaCarte; - private boolean homing; + private Boolean aLaCarte; + private Boolean homing; private WorkflowResourceIds workflowResourceIds; private RequestDetails requestDetails; @@ -70,10 +70,10 @@ public class ExecuteBuildingBlock implements Serializable{ public void setRequestAction(String requestAction) { this.requestAction = requestAction; } - public boolean isaLaCarte() { + public Boolean isaLaCarte() { return aLaCarte; } - public void setaLaCarte(boolean aLaCarte) { + public void setaLaCarte(Boolean aLaCarte) { this.aLaCarte = aLaCarte; } public String getVnfType() { @@ -82,10 +82,10 @@ public class ExecuteBuildingBlock implements Serializable{ public void setVnfType(String vnfType) { this.vnfType = vnfType; } - public boolean isHoming() { + public Boolean isHoming() { return homing; } - public void setHoming(boolean homing) { + public void setHoming(Boolean homing) { this.homing = homing; } public WorkflowResourceIds getWorkflowResourceIds() { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java index d594c73638..8f1262f70e 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java @@ -32,13 +32,13 @@ public class OrchestrationContext implements Serializable { private static final long serialVersionUID = 6843015923244810369L; @JsonProperty("is-rollback-enabled") - private boolean isRollbackEnabled; + private Boolean isRollbackEnabled; - public boolean getIsRollbackEnabled() { + public Boolean getIsRollbackEnabled() { return this.isRollbackEnabled; } - public void setIsRollbackEnabled(boolean isRollbackEnabled) { + public void setIsRollbackEnabled(Boolean isRollbackEnabled) { this.isRollbackEnabled = isRollbackEnabled; } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java index 17e42b4396..3c8f0e933f 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java @@ -33,28 +33,28 @@ public class SolutionInfo implements Serializable { private static final long serialVersionUID = 6903399488466840832L; @JsonProperty("solution-id") //identifies which solution - private int solutionId; + private Integer solutionId; @JsonProperty("homed") - private boolean homed; + private Boolean homed; @JsonProperty("is-rehome") - private boolean isRehome; + private Boolean isRehome; @JsonProperty("targeted-cloud") private CloudRegion targetedCloudRegion; - public boolean isHomed() { + public Boolean isHomed() { return homed; } - public void setHomed(boolean homed) { + public void setHomed(Boolean homed) { this.homed = homed; } - public boolean isRehome() { + public Boolean isRehome() { return isRehome; } - public void setRehome(boolean isRehome) { + public void setRehome(Boolean isRehome) { this.isRehome = isRehome; } @@ -63,7 +63,7 @@ public class SolutionInfo implements Serializable { * given resource or resource pair. * i.e. 1, 2, 3.... */ - public int getSolutionId() { + public Integer getSolutionId() { return solutionId; } @@ -72,7 +72,7 @@ public class SolutionInfo implements Serializable { * given resource or resource pair. * i.e. 1, 2, 3.... */ - public void setSolutionId(int solutionId) { + public void setSolutionId(Integer solutionId) { this.solutionId = solutionId; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoCollection.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoCollection.java index 349010781d..cb6fabde30 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoCollection.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoCollection.java @@ -43,7 +43,7 @@ public class ModelInfoCollection implements Serializable { @JsonProperty("description") private String description; @JsonProperty("quantity") - private int quantity; + private Integer quantity; public String getModelCustomizationUUID() { return modelCustomizationUUID; @@ -87,10 +87,10 @@ public class ModelInfoCollection implements Serializable { public void setDescription(String description) { this.description = description; } - public int getQuantity() { + public Integer getQuantity() { return quantity; } - public void setQuantity(int quantity) { + public void setQuantity(Integer quantity) { this.quantity = quantity; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index b5203c676a..e8e1982911 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -141,8 +141,8 @@ public class BBInputSetup implements JavaDelegate { String resourceId = executeBB.getResourceId(); String requestAction = executeBB.getRequestAction(); String vnfType = executeBB.getVnfType(); - boolean aLaCarte = executeBB.isaLaCarte(); - boolean homing = executeBB.isHoming(); + boolean aLaCarte = Boolean.TRUE.equals(executeBB.isaLaCarte()); + boolean homing = Boolean.TRUE.equals(executeBB.isHoming()); Map<ResourceKey, String> lookupKeyMap = new HashMap<>(); outputBB = this.getGBB(executeBB, lookupKeyMap, requestAction, aLaCarte, resourceId, vnfType); ObjectMapper mapper = new ObjectMapper(); @@ -346,13 +346,15 @@ public class BBInputSetup implements JavaDelegate { ModelInfo vnfModelInfo = new ModelInfo(); vnfModelInfo.setModelCustomizationUuid(vnfModelCustomizationUUID); this.mapCatalogVnf(tempVnf, vnfModelInfo, service); - for(VolumeGroup volumeGroup : tempVnf.getVolumeGroups()) { - String volumeGroupCustId = - this.bbInputSetupUtils.getAAIVolumeGroup(CLOUD_OWNER, - cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()).getModelCustomizationId(); - if(modelInfo.getModelCustomizationId().equalsIgnoreCase(volumeGroupCustId)) { - lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, volumeGroup.getVolumeGroupId()); - break; + if (lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID) == null) { + for(VolumeGroup volumeGroup : tempVnf.getVolumeGroups()) { + String volumeGroupCustId = + this.bbInputSetupUtils.getAAIVolumeGroup(CLOUD_OWNER, + cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()).getModelCustomizationId(); + if(modelInfo.getModelCustomizationId().equalsIgnoreCase(volumeGroupCustId)) { + lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, volumeGroup.getVolumeGroupId()); + break; + } } } break; @@ -705,7 +707,7 @@ public class BBInputSetup implements JavaDelegate { } } ServiceInstance serviceInstance = this.getALaCarteServiceInstance(service, requestDetails, customer, - project, owningEntity, lookupKeyMap, resourceId, executeBB.isaLaCarte(), + project, owningEntity, lookupKeyMap, resourceId, Boolean.TRUE.equals(executeBB.isaLaCarte()), executeBB.getBuildingBlock().getBpmnFlowName()); return this.populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, customer); } else { @@ -877,7 +879,7 @@ public class BBInputSetup implements JavaDelegate { if (bbName.contains(NETWORK) && !bbName.contains(NETWORK_COLLECTION)) { String networkId = lookupKeyMap.get(ResourceKey.NETWORK_ID); ModelInfo networkModelInfo = new ModelInfo(); - if(!executeBB.getBuildingBlock().getIsVirtualLink()) { + if(!Boolean.TRUE.equals(executeBB.getBuildingBlock().getIsVirtualLink())) { NetworkResourceCustomization networkCust = getNetworkCustomizationByKey(key, service); if (networkCust != null) { networkModelInfo.setModelCustomizationUuid(networkCust.getModelCustomizationUUID()); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java new file mode 100644 index 0000000000..768bee578c --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowProcessorException.java @@ -0,0 +1,19 @@ +package org.openecomp.mso.bpmn.common.workflow.service; + +import org.onap.so.bpmn.common.workflow.context.WorkflowResponse; + +/** + * Exception thrown when an error occurs while processing the workflow. + * This encapsulates the workflow response so that the same can be sent back to api handler. + */ +public class WorkflowProcessorException extends RuntimeException { + WorkflowResponse workflowResponse; + + public WorkflowProcessorException(WorkflowResponse workflowResponse) { + this.workflowResponse = workflowResponse; + } + + public WorkflowResponse getWorkflowResponse() { + return workflowResponse; + } +} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/DecomposeServiceTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/DecomposeServiceTest.groovy new file mode 100644 index 0000000000..5deec5b434 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/DecomposeServiceTest.groovy @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.common.scripts + +import org.junit.Before +import org.mockito.MockitoAnnotations +import org.onap.so.bpmn.core.domain.ModelInfo +import org.onap.so.bpmn.core.domain.NetworkResource +import org.onap.so.bpmn.core.domain.ServiceDecomposition +import org.onap.so.bpmn.core.json.DecomposeJsonUtil +import org.onap.so.bpmn.core.domain.ServiceInstance + +import org.onap.so.bpmn.mock.FileUtil +import static org.mockito.Mockito.* +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import static org.junit.Assert.*; +import org.junit.Test; +import static com.shazam.shazamcrest.MatcherAssert.assertThat; +import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; + +class DecomposeServiceTest { + + @Test + public void testDecomposeService() { + + String catalogDbResponse = FileUtil.readResourceFile("__files/decomposition/catalogDbResponse.json"); + + ServiceDecomposition serviceDecomposition = new ServiceDecomposition(); + ServiceInstance serviceInstance = new ServiceInstance(); + serviceInstance.setInstanceId("serviceInstanceID"); + serviceDecomposition.setServiceType(""); + serviceDecomposition.setServiceRole(""); + + ArrayList networkResources = new ArrayList(); + NetworkResource networkResource = new NetworkResource(); + networkResource.setNetworkType("testNetworkType"); + networkResource.setNetworkRole("testNetworkRole"); + networkResource.setNetworkScope("testNetworkScope"); + networkResource.setToscaNodeType("testToscaModelType") + networkResource.setNetworkTechnology("testNetworkTechnology"); + ModelInfo modelInfo = new ModelInfo(); + modelInfo.setModelName("testModleName"); + modelInfo.setModelUuid("testModelUuid") + modelInfo.setModelInvariantUuid("testModelInvariantId") + modelInfo.setModelVersion("testModelVersion"); + modelInfo.setModelCustomizationUuid("testModelCustomizationUuid"); + modelInfo.setModelInstanceName("testModelInstanceName"); + networkResource.setModelInfo(modelInfo); + + networkResources.add(networkResource); + serviceDecomposition.setNetworkResources(networkResources) + serviceDecomposition.setServiceInstance(serviceInstance); + + ServiceDecomposition serviceDecompositionExtracted = DecomposeJsonUtil.jsonToServiceDecomposition(catalogDbResponse, "serviceInstanceID") + + assertThat(serviceDecompositionExtracted, sameBeanAs(serviceDecomposition).ignoring("modelInfo").ignoring("vnfResources").ignoring("allottedResources").ignoring("networkResources.resourceId")); + } +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/BBPojoTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/BBPojoTest.java index 801314b2ae..eac6c0a8b7 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/BBPojoTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/BBPojoTest.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.servicedecomposition; import org.junit.Test; -import org.onap.so.BaseTest; import com.openpojo.reflection.PojoClass; import com.openpojo.reflection.PojoClassFilter; @@ -30,12 +29,13 @@ import com.openpojo.reflection.filters.FilterPackageInfo; import com.openpojo.validation.Validator; import com.openpojo.validation.ValidatorBuilder; import com.openpojo.validation.rule.impl.GetterMustExistRule; +import com.openpojo.validation.rule.impl.NoPrimitivesRule; import com.openpojo.validation.rule.impl.SerializableMustHaveSerialVersionUIDRule; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; -public class BBPojoTest extends BaseTest{ +public class BBPojoTest { private PojoClassFilter filterTestClasses = new FilterTestClasses(); @Test @@ -52,6 +52,7 @@ public class BBPojoTest extends BaseTest{ .with(new GetterMustExistRule()) .with(new SetterTester()) .with(new GetterTester()) + .with(new NoPrimitivesRule()) .with(new SerializableMustHaveSerialVersionUIDRule()) .build(); validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses, new FilterNonConcrete()); @@ -62,4 +63,4 @@ public class BBPojoTest extends BaseTest{ return !pojoClass.getSourcePath().contains("/test-classes/"); } } -}
\ No newline at end of file +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java index 0abbb2dbe2..c18dcf5cfa 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java @@ -79,7 +79,7 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; public class BBInputSetupMapperLayerTest { - @InjectMocks + BBInputSetupMapperLayer bbInputSetupMapperLayer = new BBInputSetupMapperLayer(); ObjectMapper mapper = new ObjectMapper(); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index a821d69754..489163b23a 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -425,7 +425,7 @@ public class BBInputSetupTest { doReturn(customer).when(SPY_bbInputSetup).getCustomerAndServiceSubscription(requestDetails, resourceId); doReturn(serviceInstance).when(SPY_bbInputSetup).getALaCarteServiceInstance(service, requestDetails, customer, - project, owningEntity, lookupKeyMap, resourceId, executeBB.isaLaCarte(), + project, owningEntity, lookupKeyMap, resourceId, Boolean.TRUE.equals(executeBB.isaLaCarte()), executeBB.getBuildingBlock().getBpmnFlowName()); doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, customer); @@ -475,7 +475,7 @@ public class BBInputSetupTest { doReturn(customer).when(SPY_bbInputSetup).getCustomerAndServiceSubscription(requestDetails, resourceId); doReturn(serviceSubscription).when(SPY_bbInputSetup).getServiceSubscription(requestDetails, customer); doReturn(serviceInstance).when(SPY_bbInputSetup).getALaCarteServiceInstance(service, requestDetails, customer, - project, owningEntity, lookupKeyMap, resourceId, executeBB.isaLaCarte(), + project, owningEntity, lookupKeyMap, resourceId, Boolean.TRUE.equals(executeBB.isaLaCarte()), executeBB.getBuildingBlock().getBpmnFlowName()); doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction,customer); @@ -518,7 +518,7 @@ public class BBInputSetupTest { doReturn(customer).when(SPY_bbInputSetup).getCustomerAndServiceSubscription(requestDetails, resourceId); doReturn(serviceSubscription).when(SPY_bbInputSetup).getServiceSubscription(requestDetails, customer); doReturn(serviceInstance).when(SPY_bbInputSetup).getALaCarteServiceInstance(service, requestDetails, customer, - null, null, lookupKeyMap, resourceId, executeBB.isaLaCarte(), + null, null, lookupKeyMap, resourceId, Boolean.TRUE.equals(executeBB.isaLaCarte()), executeBB.getBuildingBlock().getBpmnFlowName()); doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction,customer); diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GenericVnfExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GenericVnfExpected.json index e4c8a8f59b..cd9cf06029 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GenericVnfExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GenericVnfExpected.json @@ -8,7 +8,6 @@ "vf-module-id":"vfModuleId", "vf-module-name":"vfModuleName", "orchestration-status":"PRECREATED", - "cascaded":false, "heat-stack-id":"heatStackId", "contrail-service-instance-fqdn":"contrailServiceInstanceFqdn", "module-index":1,"selflink":"selflink", @@ -19,7 +18,6 @@ "volume-groups":[], "line-of-business":null, "platform":null, - "cascaded":false, "cloud-params":{}, "cloud-context":null, "solution":null, diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoCollection.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoCollection.json index a7e2ade10b..c6c5c790a8 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoCollection.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoCollection.json @@ -5,6 +5,5 @@ "collection-function":"function", "collection-role":"role", "collection-type":"type", - "description":"description", - "quantity":0 + "description":"description" }
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VolumeGroup.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VolumeGroup.json index f807276773..bcc565dc75 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VolumeGroup.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VolumeGroup.json @@ -4,6 +4,5 @@ "vnf-type":"vnfType", "orchestration-status":"PRECREATED", "cloud-params":{}, - "cascaded":false, "heat-stack-id":"heatStackId" } diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/decomposition/catalogDbResponse.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/decomposition/catalogDbResponse.json new file mode 100644 index 0000000000..087233d08b --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/decomposition/catalogDbResponse.json @@ -0,0 +1,33 @@ +{ + "serviceResources": { + "serviceType": "", + "workloadContext": "testWorkloadContext", + "serviceAllottedResources": [], + "modelInfo": { + "modelInvariantUuid": "testModelInvariantId", + "modelName": "testModleName", + "modelVersion": "testModelVersion", + "modelUuid": "testModelUuid" + }, + "environmentContext": "testEnvironmentContent", + "serviceRole": "", + "serviceVnfs": [], + "serviceNetworks": [ + { + "toscaNodeType": "testToscaModelType", + "networkTechnology": "testNetworkTechnology", + "networkScope": "testNetworkScope", + "modelInfo": { + "modelInvariantUuid": "testModelInvariantId", + "modelName": "testModleName", + "modelVersion": "testModelVersion", + "modelCustomizationUuid": "testModelCustomizationUuid", + "modelInstanceName": "testModelInstanceName", + "modelUuid": "testModelUuid" + }, + "networkRole": "testNetworkRole", + "networkType": "testNetworkType" + } + ] + } +}
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml b/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml index 715ddaa937..f039441738 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml +++ b/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml @@ -31,6 +31,9 @@ log: vnfAdapterRestV1: 'true' mso: adapters: + requestDb: + auth: Basic YnBlbDptc28tZGItMTUwNyE= + endpoint: http://localhost:8081 completemsoprocess: endpoint: http://localhost:${wiremock.server.port}/CompleteMsoProcess db: |