summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-08 16:04:51 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-08 22:33:28 -0400
commit032c4e3bffa6171e5ea0f7fd584d86cfc16ac31c (patch)
tree6614308f00a7ebd034d63d77dea288c2777a190e /bpmn/MSOCommonBPMN/src
parent8ad64f284cfcecb63dafa787df6fd8a1d2e2b91d (diff)
stability fixes
fixed bean error fixed execution variable name do not explicitly set hibernate objects Removed remaing references to tunnel-xconnect fixed virtual link case Change-Id: Ia5a59794e84beadcbf259efb899878cc4465ca57 Issue-ID: SO-997 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java29
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn3
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java140
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java11
4 files changed, 93 insertions, 90 deletions
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 8e36cc5f8c..fc48996b9b 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
@@ -890,7 +890,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(!Boolean.TRUE.equals(executeBB.getBuildingBlock().getIsVirtualLink())) {
+ if((!Boolean.TRUE.equals(executeBB.getBuildingBlock().getIsVirtualLink()))) {
NetworkResourceCustomization networkCust = getNetworkCustomizationByKey(key, service);
if (networkCust != null) {
networkModelInfo.setModelCustomizationUuid(networkCust.getModelCustomizationUUID());
@@ -901,7 +901,13 @@ public class BBInputSetup implements JavaDelegate {
}
} else {
msoLogger.debug("Orchestrating on Collection Network Resource Customization");
- serviceInstance.getNetworks().add(getVirtualLinkL3Network(lookupKeyMap, bbName, key, networkId));
+ CollectionNetworkResourceCustomization collectionNetworkResourceCust = bbInputSetupUtils.getCatalogCollectionNetworkResourceCustByID(key);
+ L3Network l3Network = getVirtualLinkL3Network(lookupKeyMap, bbName, key, networkId, collectionNetworkResourceCust, serviceInstance);
+ NetworkResourceCustomization networkResourceCustomization =
+ mapperLayer.mapCollectionNetworkResourceCustToNetworkResourceCust(collectionNetworkResourceCust);
+ if(l3Network != null) {
+ l3Network.setModelInfoNetwork(mapperLayer.mapCatalogNetworkToNetwork(networkResourceCustomization));
+ }
}
} else if(bbName.contains("Configuration")) {
String configurationId = lookupKeyMap.get(ResourceKey.CONFIGURATION_ID);
@@ -917,15 +923,18 @@ public class BBInputSetup implements JavaDelegate {
}
protected L3Network getVirtualLinkL3Network(Map<ResourceKey, String> lookupKeyMap, String bbName, String key,
- String networkId) {
- CollectionNetworkResourceCustomization collectionNetworkResourceCust = bbInputSetupUtils.getCatalogCollectionNetworkResourceCustByID(key);
- if(collectionNetworkResourceCust != null && (bbName.equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString())
+ String networkId, CollectionNetworkResourceCustomization collectionNetworkResourceCust, ServiceInstance serviceInstance) {
+ if(collectionNetworkResourceCust != null) {
+ if((bbName.equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString())
|| bbName.equalsIgnoreCase(AssignFlows.NETWORK_MACRO.toString()))) {
- NetworkResourceCustomization networkResourceCustomization =
- mapperLayer.mapCollectionNetworkResourceCustToNetworkResourceCust(collectionNetworkResourceCust);
- L3Network l3Network = createNetwork(lookupKeyMap, null, networkId, null);
- l3Network.setModelInfoNetwork(mapperLayer.mapCatalogNetworkToNetwork(networkResourceCustomization));
- return l3Network;
+ serviceInstance.getNetworks().add(createNetwork(lookupKeyMap, null, networkId, null));
+ } else {
+ for (L3Network network : serviceInstance.getNetworks()) {
+ if (network.getNetworkId().equalsIgnoreCase(networkId)) {
+ return network;
+ }
+ }
+ }
}
return null;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn
index 31a981729b..67bd961844 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_EsMs0HcuEeW2U_kkOHX1ZQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.1" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_EsMs0HcuEeW2U_kkOHX1ZQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="CompleteMsoProcess" name="CompleteMsoProcess" isExecutable="true">
<bpmn2:scriptTask id="preProcessRequest" name="Pre-Process Request" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_18</bpmn2:incoming>
@@ -101,6 +101,7 @@ buildDataErrorMessage.buildDataError(execution, "Complete MSO -- Update DB stat
<camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
<camunda:in variables="all" />
<camunda:out variables="all" />
+ <camunda:in businessKey="#{execution.processBusinessKey}" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_81</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_13qdn1s</bpmn2:outgoing>
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
index c7d1a7c81f..3b41ff8337 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
@@ -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.
@@ -44,16 +44,6 @@ public class StubResponseAAI {
/**
- * Tunnel-XConnect Mock Stub Response
- */
- public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "/tunnel-xconnects/tunnel-xconnect/" + tunnelId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
-
- /**
* Allotted Resource Mock StubResponses below
*/
public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
@@ -63,7 +53,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
.willReturn(aResponse()
@@ -75,13 +65,13 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(500)));
}
-
+
public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
.withStatus(204)));
}
-
+
public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
stubFor(patch(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
.willReturn(aResponse()
@@ -183,26 +173,26 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(204)));
}
-
+
public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
.withStatus(statusCode)));
}
-
+
public static void MockGetServiceInstance(String customer, String serviceSubscription, int statusCode){
stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")));
}
-
+
public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
.withStatus(statusCode)));
}
-
+
public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
.willReturn(aResponse()
@@ -263,7 +253,7 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(200)));
}
-
+
public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
.willReturn(aResponse()
@@ -303,7 +293,7 @@ public class StubResponseAAI {
/**
* Generic-Vnf Mock StubResponses below
*/
-
+
public static void MockGetGenericVnfById(String vnfId, String responseFile){
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
.willReturn(aResponse()
@@ -311,7 +301,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
.willReturn(aResponse()
@@ -319,23 +309,23 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
.atPriority(1)
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
+ .withBodyFile(responseFile)));
}
-
+
public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
.atPriority(priority)
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
+ .withBodyFile(responseFile)));
}
public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
@@ -345,7 +335,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetGenericVnfById_404(String vnfId){
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
.willReturn(aResponse()
@@ -366,7 +356,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
.willReturn(aResponse()
@@ -404,7 +394,7 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(200)));
}
-
+
public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
.withRequestBody(containing(requestBodyContaining))
@@ -417,7 +407,7 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(statusCode)));
}
-
+
public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
.willReturn(aResponse()
@@ -459,7 +449,7 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(200)));
}
-
+
public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
.willReturn(aResponse()
@@ -505,7 +495,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
.willReturn(aResponse()
@@ -513,7 +503,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
.willReturn(aResponse()
@@ -521,7 +511,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkByName(String networkName, String responseFile) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
.willReturn(aResponse()
@@ -537,7 +527,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
.willReturn(aResponse()
@@ -551,7 +541,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
.willReturn(aResponse()
@@ -559,7 +549,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
.willReturn(aResponse()
@@ -574,8 +564,8 @@ public class StubResponseAAI {
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
- }
-
+ }
+
public static void MockGetNetworkPolicy(String responseFile, String policy) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
.willReturn(aResponse()
@@ -583,7 +573,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
.willReturn(aResponse()
@@ -591,7 +581,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
.willReturn(aResponse()
@@ -599,7 +589,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
.willReturn(aResponse()
@@ -607,7 +597,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
.willReturn(aResponse()
@@ -615,7 +605,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
.willReturn(aResponse()
@@ -623,7 +613,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
.willReturn(aResponse()
@@ -631,15 +621,15 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
.willReturn(aResponse()
.withStatus(200)));
}
-
+
/////////////
-
+
public static void MockVNFAdapterRestVfModule() {
stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
.willReturn(aResponse()
@@ -658,7 +648,7 @@ public class StubResponseAAI {
.withStatus(202)
.withHeader("Content-Type", "application/xml")));
}
-
+
public static void MockDBUpdateVfModule(){
stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
.willReturn(aResponse()
@@ -666,7 +656,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile("VfModularity/DBUpdateResponse.xml")));
}
-
+
// start of mocks used locally and by other VF Module unit tests
public static void MockSDNCAdapterVfModule() {
// simplified the implementation to return "success" for all requests
@@ -678,7 +668,7 @@ public class StubResponseAAI {
.withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
}
-
+
// start of mocks used locally and by other VF Module unit tests
public static void MockAAIVfModule() {
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
@@ -686,7 +676,7 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/VfModule-supercool.xml")));
+ .withBodyFile("VfModularity/VfModule-supercool.xml")));
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
.atPriority(2)
.willReturn(aResponse()
@@ -758,14 +748,14 @@ public class StubResponseAAI {
.withStatus(200)));
}
-
-
+
+
//////////////
/**
* Cloud infrastructure below
*/
-
+
public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))
.willReturn(aResponse()
@@ -773,14 +763,14 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
/**
* Volume Group StubResponse below
*/
public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
MockGetVolumeGroupById(cloudRegionId, volumeGroupId, responseFile, 200);
}
-
+
public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int responseCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
.willReturn(aResponse()
@@ -788,7 +778,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
.willReturn(aResponse()
@@ -796,7 +786,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
.willReturn(aResponse()
@@ -804,7 +794,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
@@ -816,13 +806,13 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(404)));
}
-
+
public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
.withStatus(200)));
}
-
+
/**
* VF-Module StubResponse below
* @param statusCode TODO
@@ -834,7 +824,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
.willReturn(aResponse()
@@ -842,7 +832,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetVfModuleByName(String vnfId, String vfModuleName, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName))
.willReturn(aResponse()
@@ -850,7 +840,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
.withRequestBody(containing(requestContaining))
@@ -865,19 +855,19 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(200)));
}
-
+
public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
.willReturn(aResponse()
.withStatus(200)));
}
-
+
public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
.willReturn(aResponse()
.withStatus(returnCode)));
}
-
+
public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
@@ -889,7 +879,7 @@ public class StubResponseAAI {
.willReturn(aResponse()
.withStatus(statusCode)));
}
-
+
/* AAI Pserver Queries */
public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
stubFor(put(urlMatching("/aai/v1[0-9]/query.*"))
@@ -898,7 +888,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
-
+
public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
.willReturn(aResponse()
@@ -906,14 +896,14 @@ public class StubResponseAAI {
.withHeader("Content-Type", "application/json; charset=utf-8")
.withBodyFile(responseFile)));
}
-
+
public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
stubFor(patch(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
.willReturn(aResponse()
- .withStatus(statusCode)
+ .withStatus(statusCode)
));
}
-
+
public static void MockSetInMaintFlagByVnfId(String vnfId, String responseFile, int statusCode) {
stubFor(post(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
.willReturn(aResponse()
@@ -921,7 +911,7 @@ public class StubResponseAAI {
.withBodyFile(responseFile)
));
}
-
+
public static void MockGetDefaultCloudRegionByCloudRegionId(String cloudRegionId, String responseFile, int statusCode) {
stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegionId + ".*"))
.willReturn(aResponse()
@@ -929,7 +919,7 @@ public class StubResponseAAI {
.withHeader("Content-Type", "application/json; charset=utf-8")
.withBodyFile(responseFile)));
}
-
+
//// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
@Deprecated
public static void MockGetVceById(){
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 a5795f923c..9897c04ad8 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
@@ -1804,6 +1804,7 @@ public class BBInputSetupTest {
doReturn(aaiVnf).when(SPY_bbInputSetupUtils).getAAIGenericVnf(any(String.class));
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.NETWORK_MACRO.toString());
executeBB.getBuildingBlock().setKey("ab153b6e-c364-44c0-bef6-1f2982117f04");
+ executeBB.getBuildingBlock().setIsVirtualLink(Boolean.FALSE);
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
verify(SPY_bbInputSetup, times(1)).getGBBMacroNoUserParamsCreate(any(ExecuteBuildingBlock.class), any(),
any(String.class), any(String.class), any(GeneralBuildingBlock.class), any(Service.class));
@@ -2047,18 +2048,20 @@ public class BBInputSetupTest {
doReturn(networkResourceCustomization).when(bbInputSetupMapperLayer).mapCollectionNetworkResourceCustToNetworkResourceCust(collectionNetworkResourceCust);
ModelInfoNetwork modelInfoNetwork = Mockito.mock(ModelInfoNetwork.class);
doReturn(modelInfoNetwork ).when(bbInputSetupMapperLayer).mapCatalogNetworkToNetwork(networkResourceCustomization);
+
executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.NETWORK_MACRO.toString());
executeBB.getBuildingBlock().setKey("ab153b6e-c364-44c0-bef6-1f2982117f04");
executeBB.getBuildingBlock().setIsVirtualLink(true);
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
verify(SPY_bbInputSetup, times(2)).getGBBMacroNoUserParamsCreate(executeBB, lookupKeyMap,
executeBB.getBuildingBlock().getBpmnFlowName(), "ab153b6e-c364-44c0-bef6-1f2982117f04", gBB, service);
- executeBB.getBuildingBlock().setBpmnFlowName(AssignFlows.FABRIC_CONFIGURATION.toString());
- executeBB.getBuildingBlock().setKey("modelCustId");
- doNothing().when(SPY_bbInputSetup).mapCatalogConfiguration(isA(Configuration.class), isA(ModelInfo.class), isA(Service.class), isA(ConfigurationResourceKeys.class));
+
+ executeBB.getBuildingBlock().setBpmnFlowName("CreateNetworkBB");
+ executeBB.getBuildingBlock().setKey("ab153b6e-c364-44c0-bef6-1f2982117f04");
+ executeBB.getBuildingBlock().setIsVirtualLink(true);
SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType);
verify(SPY_bbInputSetup, times(1)).getGBBMacroNoUserParamsCreate(executeBB, lookupKeyMap,
- executeBB.getBuildingBlock().getBpmnFlowName(), "modelCustId", gBB, service);
+ executeBB.getBuildingBlock().getBpmnFlowName(), "ab153b6e-c364-44c0-bef6-1f2982117f04", gBB, service);
}
@Test