summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-09-17 10:37:20 -0400
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-09-17 10:37:20 -0400
commit67e54470732dd92d06fa1a65146bafaef2616cbb (patch)
treed9b45299607296f08f52774e2f1569ebeb20e3aa /bpmn
parent7f14f0c2cb879573709b687697636095e134b231 (diff)
Fix SDNC Parse
Fix to use proper wrapper bean to fix marshalling Change-Id: Iec167059557cbf73236f3efad9a9780571a0468e Issue-ID: SO-1056 Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopology.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopologyWithCloudResources.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopology.json2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetDhcpDisabled.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetMultipleDhcp.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithCloudResources.json3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithSingletonArray.json3
9 files changed, 26 insertions, 10 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java
index 67e7afb599..ec202b8a3f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterObjectMapper.java
@@ -31,6 +31,7 @@ import javax.annotation.PostConstruct;
import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleTopology;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyVfModuleTopology;
import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest;
import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest;
@@ -108,8 +109,9 @@ public class VnfAdapterObjectMapper {
final String USER_PARAM_NAME_KEY = "name";
final String USER_PARAM_VALUE_KEY = "value";
// sdncVfModuleQueryResponse will not be available in aLaCarte case
- if (sdncVfModuleQueryResponse != null) {
- GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfmoduletopologyVfModuleTopology.class);
+ if (sdncVfModuleQueryResponse != null) {
+ GenericResourceApiVfModuleTopology vfModuleTop = mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfModuleTopology.class);
+ GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = vfModuleTop.getVfModuleTopology();
buildParamsMapFromSdncParams(volumeGroupParams, vfModuleTopology.getVfModuleParameters());
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index 11a694140c..66e571cc93 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -31,11 +31,13 @@ import java.util.Map;
import java.util.Optional;
import javax.annotation.PostConstruct;
+import javax.validation.Valid;
import org.onap.sdnc.northbound.client.model.GenericResourceApiParam;
import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam;
import org.onap.sdnc.northbound.client.model.GenericResourceApiSubInterfaceNetworkData;
import org.onap.sdnc.northbound.client.model.GenericResourceApiSubinterfacenetworkdataSubInterfaceNetworkData;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleTopology;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleassignmentsVfModuleAssignments;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleassignmentsVfmoduleassignmentsVms;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyVfModuleTopology;
@@ -52,6 +54,7 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiVmtopologydataVmN
import org.onap.sdnc.northbound.client.model.GenericResourceApiVmtopologydataVmNetworks;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVmtopologydataVmnamesVnfcNames;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfNetworkData;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfTopology;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfcNetworkData;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfcnetworkdataVnfcNetworkData;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfcnetworkdataVnfcnetworkdataVnfcPorts;
@@ -157,8 +160,11 @@ public class VnfAdapterVfModuleObjectMapper {
private Map<String,String> buildVfModuleParamsMap(RequestContext requestContext, ServiceInstance serviceInstance, GenericVnf genericVnf,
VfModule vfModule, String sdncVnfQueryResponse, String sdncVfModuleQueryResponse) throws JsonParseException, JsonMappingException, IOException {
- GenericResourceApiVnftopologyVnfTopology vnfTopology = mapper.readValue(sdncVnfQueryResponse, GenericResourceApiVnftopologyVnfTopology.class);
- GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfmoduletopologyVfModuleTopology.class);
+
+ GenericResourceApiVnfTopology vnfTop= mapper.readValue(sdncVnfQueryResponse, GenericResourceApiVnfTopology.class);
+ GenericResourceApiVfModuleTopology vfModuleTop = mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfModuleTopology.class);
+ GenericResourceApiVnftopologyVnfTopology vnfTopology = vnfTop.getVnfTopology();
+ GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = vfModuleTop.getVfModuleTopology();
Map<String,String> paramsMap = new HashMap<>();
if(vnfTopology.getSdncGeneratedCloudResources() && vfModuleTopology.getSdncGeneratedCloudResources()) {
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopology.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopology.json
index a24f8bf125..8e43f2a1e5 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopology.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopology.json
@@ -1,4 +1,5 @@
{
+"vf-module-topology":{
"vf-module-assignments": {
"vms": {
"vm": [
@@ -175,4 +176,4 @@
}
]
}
-} \ No newline at end of file
+}} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopologyWithCloudResources.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopologyWithCloudResources.json
index eaedb92281..2036501572 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopologyWithCloudResources.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVfModuleTopologyWithCloudResources.json
@@ -1,4 +1,5 @@
{
+"vf-module-topology":{
"vf-module-assignments": {
"vms": {
"vm": [
@@ -176,4 +177,4 @@
]
},
"sdnc-generated-cloud-resources": "true"
-} \ No newline at end of file
+}} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopology.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopology.json
index 39c6708631..5a5b2febbd 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopology.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopology.json
@@ -1,4 +1,5 @@
{
+"vnf-topology":{
"vnf-resource-assignments": {
"availability-zones": {
"availability-zone": [
@@ -45,4 +46,5 @@
"vnf-topology-identifier-structure": {},
"onap-model-information": {},
"aic-cloud-region": ""
+}
} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetDhcpDisabled.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetDhcpDisabled.json
index 21ba0876f5..73e36758fc 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetDhcpDisabled.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetDhcpDisabled.json
@@ -1,4 +1,5 @@
{
+"vnf-topology":{
"vnf-resource-assignments": {
"availability-zones": {
"availability-zone": [
@@ -45,4 +46,4 @@
"vnf-topology-identifier-structure": {},
"onap-model-information": {},
"aic-cloud-region": ""
-} \ No newline at end of file
+}} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetMultipleDhcp.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetMultipleDhcp.json
index 5062a06117..e6ea0b2e5c 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetMultipleDhcp.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologySubnetMultipleDhcp.json
@@ -1,4 +1,5 @@
{
+"vnf-topology":{
"vnf-resource-assignments": {
"availability-zones": {
"availability-zone": [
@@ -65,4 +66,4 @@
"vnf-topology-identifier-structure": {},
"onap-model-information": {},
"aic-cloud-region": ""
-} \ No newline at end of file
+}} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithCloudResources.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithCloudResources.json
index fedee49609..3ca3403d47 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithCloudResources.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithCloudResources.json
@@ -1,4 +1,5 @@
{
+"vnf-topology":{
"vnf-resource-assignments": {
"availability-zones": {
"availability-zone": [
@@ -44,4 +45,4 @@
"onap-model-information": {},
"aic-cloud-region": "",
"sdnc-generated-cloud-resources": "true"
-} \ No newline at end of file
+}} \ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithSingletonArray.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithSingletonArray.json
index a6964a323f..7690c6bf54 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithSingletonArray.json
+++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/VnfAndVfModuleMapper/genericResourceApiVfModuleSdncVnfTopologyWithSingletonArray.json
@@ -1,4 +1,5 @@
{
+"vnf-topology":{
"vnf-resource-assignments": {
"availability-zones": {
"availability-zone": "zone0"
@@ -41,4 +42,4 @@
"vnf-topology-identifier-structure": {},
"onap-model-information": {},
"aic-cloud-region": ""
-} \ No newline at end of file
+}} \ No newline at end of file