aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-08-23 14:50:49 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-08-23 14:51:01 -0400
commit2fd0666635757ee894a785a0070b6f94a548c00e (patch)
treeb9b2b54a59341624f3e00e1ed59fbc7ed0b114c7 /bpmn/so-bpmn-tasks/src
parent777c1269be6e6bb4b3457cf47e4ec87924cb8fc7 (diff)
Prod fixes August 21st
changes required for unit tests to pass again Changes sniro homing BB license demand to be a named array per sniro defect. boolean checks must now account for null fixed compilation issues in code updated tests and removed primatives from bbobjects upgraded to A&AI dependency with Boolean Change-Id: I5f3e69c0ad24d2c3e4591568467bad861abd0261 Issue-ID: SO-896 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped.json1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped_to_aai.json6
9 files changed, 28 insertions, 17 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
index b7f45c05b5..66de6b389d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
@@ -75,6 +75,7 @@ import org.springframework.web.util.UriUtils;
*/
@Component("SniroHoming")
public class SniroHomingV2 {
+
private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroHomingV2.class);
private JsonUtils jsonUtils = new JsonUtils();
@Autowired
@@ -135,8 +136,11 @@ public class SniroHomingV2 {
placementInfo.put("placementDemands", placementDemands);
request.setPlacementInformation(placementInfo.toString());
+ JSONObject licenseInfo = new JSONObject();
+
JSONArray licenseDemands = buildLicenseDemands(serviceInstance);
- request.setLicenseInformation(licenseDemands.toString());
+ licenseInfo.put("licenseDemands", licenseDemands);
+ request.setLicenseInformation(licenseInfo.toString());
if(placementDemands.length() > 0 || licenseDemands.length() > 0){
client.postDemands(request);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 79613047e5..e534142471 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -162,7 +162,7 @@ public class AAICreateTasks {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
- execution.setVariable("callHoming", vnf.isCallHoming());
+ execution.setVariable("callHoming", Boolean.TRUE.equals(vnf.isCallHoming()));
aaiVnfResources.createVnfandConnectServiceInstance(vnf, serviceInstance);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index 95d52d6f2a..39f4c7822a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -79,7 +79,7 @@ public class SDNCAssignTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
- String response = sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext, vnf.isCallHoming());
+ String response = sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext, Boolean.TRUE.equals(vnf.isCallHoming()));
execution.setVariable("SDNCResponse", response);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index 0fa0c69118..b2b071e1ee 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -689,7 +689,7 @@ public class WorkflowAction {
for (ExecuteBuildingBlock ebb : orchFlows) {
if (ebb.getBuildingBlock().getBpmnFlowName().equals("AssignNetworkBB")) {
String key = ebb.getBuildingBlock().getKey();
- boolean isVirtualLink = ebb.getBuildingBlock().getIsVirtualLink();
+ boolean isVirtualLink = Boolean.TRUE.equals(ebb.getBuildingBlock().getIsVirtualLink());
String virtualLinkKey = ebb.getBuildingBlock().getVirtualLinkKey();
sortedOrchFlows.add(ebb);
for (ExecuteBuildingBlock ebb2 : orchFlows) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
index ee8f503e42..056ac3f6e5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
@@ -24,6 +24,7 @@ import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.UUID;
import org.modelmapper.ModelMapper;
@@ -36,7 +37,13 @@ import org.onap.so.adapters.nwrest.ProviderVlanNetwork;
import org.onap.so.adapters.nwrest.RollbackNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.bpmn.core.UrnPropertiesReader;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.*;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBinding;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork;
@@ -273,8 +280,8 @@ public class NetworkAdapterObjectMapper {
private ContrailNetwork buildContrailNetwork(L3Network l3Network, Customer customer){
ContrailNetwork contrailNetwork = new ContrailNetwork();
- contrailNetwork.setExternal(Boolean.toString(l3Network.isExternalNetwork()));
- contrailNetwork.setShared(Boolean.toString(l3Network.isSharedNetwork()));
+ contrailNetwork.setExternal(Optional.ofNullable(l3Network.isIsExternalNetwork()).orElse(false).toString());
+ contrailNetwork.setShared(Optional.ofNullable(l3Network.isIsSharedNetwork()).orElse(false).toString());
contrailNetwork.setPolicyFqdns(buildPolicyFqdns(l3Network.getNetworkPolicies()));
contrailNetwork.setRouteTableFqdns(buildRouteTableFqdns(l3Network.getContrailNetworkRouteTableReferences()));
if(customer!= null)
@@ -335,7 +342,7 @@ public class NetworkAdapterObjectMapper {
private void setFlowFlags(UpdateNetworkRequest updateNetworkRequest, OrchestrationContext orchestrationContext){
updateNetworkRequest.setSkipAAI(true);
//revert suppressRollabck=TRUE into backout=FALSE and vice versa
- updateNetworkRequest.setBackout(!Boolean.valueOf(orchestrationContext.getIsRollbackEnabled()));
+ updateNetworkRequest.setBackout(!Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
//NetworkTechnology(NetworkTechnology.NEUTRON); NOOP - default
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java
index c3b0048e07..0355006d15 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java
@@ -63,7 +63,7 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
-public class AAIObjectMapperTest{
+public class AAIObjectMapperTest {
private AAIObjectMapper aaiObjectMapper = new AAIObjectMapper();
private final static String JSON_FILE_LOCATION = "src/test/resources/__files/BuildingBlocks/";
@@ -343,7 +343,7 @@ public class AAIObjectMapperTest{
l3Network.setContrailNetworkFqdn("contrailNetworkFqdn");
l3Network.setIsBoundToVpn(false);
l3Network.setIsCascaded(false);
- l3Network.setIsExternalNetwork(false);
+ l3Network.setIsSharedNetwork(false);
l3Network.setHeatStackId("heatStackId");
l3Network.setOperationalStatus("operationalStatus");
l3Network.setPhysicalNetworkName("physicalNetworkName");
@@ -429,7 +429,7 @@ public class AAIObjectMapperTest{
l3Network.setPhysicalNetworkName("physicalNetwork_name");
l3Network.setIsProviderNetwork(true);
l3Network.setIsSharedNetwork(false);
- l3Network.setIsExternalNetwork(false);
+ l3Network.setIsExternalNetwork(true);
l3Network.setSelflink("self_link");
l3Network.setOperationalStatus("operationalStatus");
@@ -562,7 +562,7 @@ public class AAIObjectMapperTest{
AAIObjectMapper aaiObjectMapper = new AAIObjectMapper();
org.onap.aai.domain.yang.CtagAssignments v12CtagAssingments = aaiObjectMapper.mapToAAICtagAssignmentList(ctagAssignments);
- assertEquals(ctagAssignments.get(0).getVlanIdInner(), v12CtagAssingments.getCtagAssignment().get(0).getVlanIdInner());
+ assertEquals(ctagAssignments.get(0).getVlanIdInner().longValue(), v12CtagAssingments.getCtagAssignment().get(0).getVlanIdInner());
String jsonToCompare = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiCtagAssingmentsMapped_to_aai.json")));
ObjectMapper omapper = new ObjectMapper();
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
index 96fbe7ffb7..fddba98f4c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java
@@ -187,6 +187,7 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{
Subnet actualSubnet = new Subnet();
actualSubnet.setSubnetId("subnetId");
+ actualSubnet.setDhcpEnabled(false);
actualSubnet.setIpVersion("4");
RouteTarget routeTarget = new RouteTarget();
@@ -231,7 +232,7 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{
expectedUpdateNetworkRequest.setNetworkParams(userInput);
expectedUpdateNetworkRequest.setMsoRequest(msoRequest);
expectedUpdateNetworkRequest.setSkipAAI(true);
- expectedUpdateNetworkRequest.setBackout(!Boolean.valueOf(orchestrationContext.getIsRollbackEnabled()));
+ expectedUpdateNetworkRequest.setBackout(!Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled()));
expectedUpdateNetworkRequest.setMessageId("messageId");
expectedUpdateNetworkRequest.setNotificationUrl("http://localhost:28080/mso/WorkflowMesssage/NetworkAResponse/messageId");
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped.json
index 81362e3dca..d6c08fbaee 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped.json
@@ -14,7 +14,6 @@
"physicalNetworkName": "physicalNetworkName",
"isProviderNetwork": false,
"isSharedNetwork": false,
- "isExternalNetwork": false,
"selflink": "selflink",
"operationalStatus": "operationalStatus"
} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped_to_aai.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped_to_aai.json
index 7a30ade095..bca5f94294 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped_to_aai.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/aaiL3NetworkMapped_to_aai.json
@@ -5,7 +5,7 @@
"networkRole" : "dmz_direct",
"networkTechnology" : "contrail",
"neutronNetworkId" : null,
- "isBoundToVpn" : false,
+ "isBoundToVpn" : true,
"serviceId" : "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
"networkRoleInstance" : 1,
"resourceVersion" : null,
@@ -20,9 +20,9 @@
"widgetModelId" : "widgetModel_id",
"widgetModelVersion" : "widgetModel_version",
"physicalNetworkName" : "physicalNetwork_name",
- "isProviderNetwork" : false,
+ "isProviderNetwork" : true,
"isSharedNetwork" : false,
- "isExternalNetwork" : false,
+ "isExternalNetwork" : true,
"selflink" : "self_link",
"operationalStatus" : "operationalStatus",
"subnets" : {