diff options
author | Steve Smokowski <ss835w@att.com> | 2020-02-10 13:38:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-10 13:38:12 +0000 |
commit | 299cf5f3a2a49a6dec927a0fd038762a07d6c272 (patch) | |
tree | 053de6b9b9a8c210911ac3e64670b134c353c6a3 /bpmn/MSOCommonBPMN/src | |
parent | 6db24e72ecbf4f5c63085085c10dc656568b563b (diff) | |
parent | b58f841d09e1d832ea4aeae1334f151a98a1f4c8 (diff) |
Merge "modifications to create network to add lob"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
3 files changed, 49 insertions, 6 deletions
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 6b3ad1d528..554e987fc8 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 @@ -100,6 +100,10 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { private List<AggregateRoute> aggregateRoutes = new ArrayList<>(); @JsonProperty("vpn-binding") private List<VpnBinding> vpnBindings = new ArrayList<>(); + @JsonProperty("line-of-business") + private LineOfBusiness lineOfBusiness; + @JsonProperty("platform") + private Platform platform; public ModelInfoNetwork getModelInfoNetwork() { return modelInfoNetwork; @@ -313,6 +317,22 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> { return vpnBindings; } + public LineOfBusiness getLineOfBusiness() { + return lineOfBusiness; + } + + public void setLineOfBusiness(LineOfBusiness lineOfBusiness) { + this.lineOfBusiness = lineOfBusiness; + } + + public Platform getPlatform() { + return platform; + } + + public void setPlatform(Platform platform) { + this.platform = platform; + } + @Override public boolean equals(final Object other) { if (!(other instanceof L3Network)) { 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 a4793476e4..145d4c83a7 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 @@ -915,7 +915,7 @@ public class BBInputSetup implements JavaDelegate { if (network == null && (parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString()) || parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_MACRO.toString()))) { network = createNetwork(parameter.getLookupKeyMap(), parameter.getInstanceName(), parameter.getResourceId(), - parameter.getInstanceParams()); + parameter.getInstanceParams(), parameter); parameter.getServiceInstance().getNetworks().add(network); } if (network != null) { @@ -924,12 +924,20 @@ public class BBInputSetup implements JavaDelegate { } protected L3Network createNetwork(Map<ResourceKey, String> lookupKeyMap, String instanceName, String networkId, - List<Map<String, String>> instanceParams) { + List<Map<String, String>> instanceParams, BBInputSetupParameter parameter) { lookupKeyMap.put(ResourceKey.NETWORK_ID, networkId); L3Network network = new L3Network(); network.setNetworkId(networkId); network.setNetworkName(instanceName); network.setOrchestrationStatus(OrchestrationStatus.PRECREATED); + if (parameter != null) { + if (parameter.getLineOfBusiness() != null) { + network.setLineOfBusiness(this.mapperLayer.mapRequestLineOfBusiness(parameter.getLineOfBusiness())); + } + if (parameter.getLineOfBusiness() != null) { + network.setPlatform(this.mapperLayer.mapRequestPlatform(parameter.getPlatform())); + } + } if (instanceParams != null) { for (Map<String, String> params : instanceParams) { network.getCloudParams().putAll(params); @@ -1284,7 +1292,7 @@ public class BBInputSetup implements JavaDelegate { if (collectionNetworkResourceCust != null) { if ((bbName.equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString()) || bbName.equalsIgnoreCase(AssignFlows.NETWORK_MACRO.toString()))) { - L3Network network = createNetwork(lookupKeyMap, null, networkId, null); + L3Network network = createNetwork(lookupKeyMap, null, networkId, null, null); serviceInstance.getNetworks().add(network); return network; } else { 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 a45e803cf0..1acf4edb4a 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 @@ -1262,7 +1262,7 @@ public class BBInputSetupTest { verify(SPY_bbInputSetup, times(1)).mapCatalogNetwork(network, modelInfo, service); instanceName = "networkName2"; - L3Network network2 = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, resourceId, null); + L3Network network2 = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, resourceId, null, parameter); SPY_bbInputSetup.populateL3Network(parameter); verify(SPY_bbInputSetup, times(2)).mapCatalogNetwork(network2, modelInfo, service); } @@ -2832,17 +2832,32 @@ public class BBInputSetupTest { expected.setNetworkId(networkId); expected.setNetworkName(instanceName); expected.setCloudParams(cloudParams); + Platform platform = new Platform(); + platform.setPlatformName("platformName"); + expected.setPlatform(platform); + LineOfBusiness lineOfBusiness = new LineOfBusiness(); + lineOfBusiness.setLineOfBusinessName("lineOfBusiness"); + expected.setLineOfBusiness(lineOfBusiness); expected.setOrchestrationStatus(OrchestrationStatus.PRECREATED); Map<ResourceKey, String> lookupKeyMap = new HashMap<>(); List<Map<String, String>> instanceParams = new ArrayList<>(); instanceParams.add(cloudParams); - L3Network actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, instanceParams); + org.onap.so.serviceinstancebeans.Platform platformRequest = new org.onap.so.serviceinstancebeans.Platform(); + org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusinessRequest = + new org.onap.so.serviceinstancebeans.LineOfBusiness(); + lineOfBusinessRequest.setLineOfBusinessName("lineOfBusiness"); + platformRequest.setPlatformName("platformName"); + BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setRequestId(REQUEST_ID) + .setPlatform(platformRequest).setLineOfBusiness(lineOfBusinessRequest).build(); + L3Network actual = + SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, instanceParams, parameter); assertThat(actual, sameBeanAs(expected)); assertEquals("LookupKeyMap is populated", networkId, lookupKeyMap.get(ResourceKey.NETWORK_ID)); expected.getCloudParams().clear(); - actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, null); + + actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, null, parameter); assertThat(actual, sameBeanAs(expected)); } |