From 815bcc529480e122c270771dc974cba3d754233e Mon Sep 17 00:00:00 2001 From: "Smokowski, Steve (ss835w)" Date: Tue, 4 Dec 2018 15:33:20 -0500 Subject: Updated Network Logic Added logic to get aggregate route, updated unit test, fixed bugs, refactored select code. Change-Id: I3269da1967ba903dd11459f76030c3fc2aad797a Issue-ID: SO-1270 Signed-off-by: Smokowski, Steve (ss835w) --- .../servicedecomposition/bbobjects/L3Network.java | 6 ++++ .../org/onap/so/BuildingBlockTestDataSetup.java | 36 +++++++++++----------- 2 files changed, 24 insertions(+), 18 deletions(-) (limited to 'bpmn/MSOCommonBPMN') 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 343bd95eaa..781eba3332 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 @@ -101,6 +101,8 @@ public class L3Network implements Serializable, ShallowCopy { private ModelInfoNetwork modelInfoNetwork; @JsonProperty("aggregate-routes") private List aggregateRoutes = new ArrayList<>(); + @JsonProperty("vpn-binding") + private List vpnBindings = new ArrayList<>(); public ModelInfoNetwork getModelInfoNetwork() { return modelInfoNetwork; @@ -261,6 +263,10 @@ public class L3Network implements Serializable, ShallowCopy { return aggregateRoutes; } + public List getVpnBindings(){ + return vpnBindings; + } + @Override public boolean equals(final Object other) { if (!(other instanceof L3Network)) { diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java index 0398c87d69..d5b5cde99b 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BuildingBlockTestDataSetup.java @@ -290,7 +290,7 @@ public class BuildingBlockTestDataSetup{ customer.setSubscriberType("testSubscriberType" + customerCounter); customer.setServiceSubscription(buildServiceSubscription()); - + return customer; } @@ -341,50 +341,50 @@ public class BuildingBlockTestDataSetup{ customer.setServiceSubscription(buildServiceSubscription()); gBBInput.setCustomer(customer); - + return customer; } - + public Collection setCollection() { Collection collection = new Collection(); collection.setId("testId"); - + ServiceInstance serviceInstance = null; - + try { serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); } catch(BBObjectNotFoundException e) { serviceInstance = setServiceInstance(); } - + serviceInstance.setCollection(collection); - + return collection; } - + public InstanceGroup setInstanceGroup() { InstanceGroup instanceGroup = new InstanceGroup(); instanceGroup.setId("testId"); instanceGroup.setInstanceGroupFunction("testInstanceGroupFunction"); - + Collection collection = null; - + try { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); collection = serviceInstance.getCollection(); - + if (collection == null) { collection = setCollection(); } } catch(BBObjectNotFoundException e) { collection = setCollection(); } - + collection.setInstanceGroup(instanceGroup); - + return instanceGroup; } - + public VpnBinding buildVpnBinding() { vpnBindingCounter++; @@ -664,12 +664,12 @@ public class BuildingBlockTestDataSetup{ modelInfo.setModelUuid("testAllottedModelUuid" + uniqueIdentifier); modelInfo.setModelVersion("testAllottedModelVersion" + uniqueIdentifier); modelInfo.setModelInstanceName("testAllottedInstanceName" + uniqueIdentifier); - + ar.setModelInfoAllottedResource(modelInfo); - + return ar; } - + public Configuration setConfiguration () { Configuration config = new Configuration(); config.setConfigurationId("testConfigurationId"); @@ -679,7 +679,7 @@ public class BuildingBlockTestDataSetup{ modelInfoConfig.setModelInvariantId("modelInvariantId"); modelInfoConfig.setPolicyName("policyName"); config.setModelInfoConfiguration(modelInfoConfig); - + List configurations = new ArrayList<>(); configurations.add(config); ServiceInstance serviceInstance = new ServiceInstance(); -- cgit 1.2.3-korg