From 85dda672f8d9a3bed20ca36852fa6e94c378f5b4 Mon Sep 17 00:00:00 2001 From: Norm Traxler Date: Fri, 1 Feb 2019 16:56:25 +0000 Subject: Ctx Builder l3-network support Issue-ID: SDNC-475 Network Discovery Ctx Builder to support l3-network attribute mapping to common model. Fix jenkins JUnit failures Change-Id: I64ded411a74ffb037df17a047c16e210d41c4992 Signed-off-by: Norm Traxler --- .../test/jolt/TransformationTest.java | 123 +++++++++- .../jolt/networkDiscoveryL3NetworkResponse.json | 59 +++++ ...etworkDiscoveryL3NetworkToNetwork-expected.json | 15 ++ .../jolt/networkDiscoveryVserverResponse.json | 99 ++++++++ .../jolt/networkDiscoveryVserverToVm-expected.json | 38 +++ .../resources/jolt/serviceDecompResponse2.json | 263 +++++++++++++++++++++ .../jolt/serviceDecompToModelContext-expected.json | 70 +++--- .../serviceDecompToModelContext2-expected.json | 149 ++++++++++++ .../jolt/serviceDecompToNdResources2-expected.json | 39 +++ 9 files changed, 808 insertions(+), 47 deletions(-) create mode 100644 src/test/resources/jolt/networkDiscoveryL3NetworkResponse.json create mode 100644 src/test/resources/jolt/networkDiscoveryL3NetworkToNetwork-expected.json create mode 100644 src/test/resources/jolt/networkDiscoveryVserverResponse.json create mode 100644 src/test/resources/jolt/networkDiscoveryVserverToVm-expected.json create mode 100644 src/test/resources/jolt/serviceDecompResponse2.json create mode 100644 src/test/resources/jolt/serviceDecompToModelContext2-expected.json create mode 100644 src/test/resources/jolt/serviceDecompToNdResources2-expected.json (limited to 'src/test') diff --git a/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/test/jolt/TransformationTest.java b/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/test/jolt/TransformationTest.java index 29a4a6f..29173fb 100644 --- a/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/test/jolt/TransformationTest.java +++ b/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/test/jolt/TransformationTest.java @@ -29,7 +29,10 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.onap.pomba.common.datatypes.ModelContext; +import org.onap.pomba.common.datatypes.Network; +import org.onap.pomba.common.datatypes.VM; import org.onap.pomba.contextbuilder.networkdiscovery.model.NdResources; +import org.onap.pomba.contextbuilder.networkdiscovery.util.TransformationUtil; public class TransformationTest { @@ -39,29 +42,24 @@ public class TransformationTest { @Rule public ExpectedException expectedEx = ExpectedException.none(); - @Test public void testTransformNdResources() { Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "/serviceDecompResponse.json"); Object sourceObject1 = JsonUtils.jsonToObject(JsonUtils.toJsonString(sourceObject)); - + List chainrSpecJson = JsonUtils.filepathToList(CONFIG_JOLT_DIRECTORY + "sdToNdResourcesSpec.json"); Chainr chainr = Chainr.fromSpec(chainrSpecJson); Object output = chainr.transform(sourceObject1); String resultJson = JsonUtils.toJsonString(output); - - System.err.println(resultJson); - + // read the result into the NqQuery class: Gson gson = new Gson(); NdResources ndQuery = gson.fromJson(resultJson, NdResources.class); - + // convert ndQuery back to json: String ndQueryToJson = gson.toJson(ndQuery); - - // Compare with expected output: Object expectedObject = JsonUtils.filepathToObject(TEST_RESOURCES + "serviceDecompToNdResources-expected.json"); @@ -69,7 +67,34 @@ public class TransformationTest { Assert.assertEquals("Json transformation result does not match expected content", JsonUtils.toPrettyJsonString(expectedObject), JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(ndQueryToJson))); + } + + @Test + public void testTransformNdResourcesL3Network() { + + Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "/serviceDecompResponse2.json"); + Object sourceObject1 = JsonUtils.jsonToObject(JsonUtils.toJsonString(sourceObject)); + + List chainrSpecJson = JsonUtils.filepathToList(CONFIG_JOLT_DIRECTORY + "sdToNdResourcesSpec.json"); + Chainr chainr = Chainr.fromSpec(chainrSpecJson); + Object output = chainr.transform(sourceObject1); + + String resultJson = JsonUtils.toJsonString(output); + + // read the result into the NqQuery class: + Gson gson = new Gson(); + NdResources ndQuery = gson.fromJson(resultJson, NdResources.class); + + // convert ndQuery back to json: + String ndQueryToJson = gson.toJson(ndQuery); + // Compare with expected output: + Object expectedObject = JsonUtils + .filepathToObject(TEST_RESOURCES + "serviceDecompToNdResources2-expected.json"); + + Assert.assertEquals("Json transformation result does not match expected content", + JsonUtils.toPrettyJsonString(expectedObject), + JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(ndQueryToJson))); } @Test @@ -77,27 +102,103 @@ public class TransformationTest { Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "serviceDecompResponse.json"); Object sourceObject1 = JsonUtils.jsonToObject(JsonUtils.toJsonString(sourceObject)); - + List chainrSpecJson = JsonUtils.filepathToList(CONFIG_JOLT_DIRECTORY + "sdToModelContextSpec.json"); Chainr chainr = Chainr.fromSpec(chainrSpecJson); Object output = chainr.transform(sourceObject1); String resultJson = JsonUtils.toJsonString(output); - + // read the result into the NqQuery class: Gson gson = new Gson(); ModelContext ndQuery = gson.fromJson(resultJson, ModelContext.class); + + // convert ndQuery back to json: + String ndQueryToJson = gson.toJson(ndQuery); + + // Compare with expected output: + Object expectedObject = JsonUtils + .filepathToObject(TEST_RESOURCES + "serviceDecompToModelContext-expected.json"); + + Assert.assertEquals("Json transformation result does not match expected content", + JsonUtils.toPrettyJsonString(expectedObject), + JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(ndQueryToJson))); + } + + @Test + public void testTransformModelContextL3Network() { + + Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "serviceDecompResponse2.json"); + Object sourceObject1 = JsonUtils.jsonToObject(JsonUtils.toJsonString(sourceObject)); + + List chainrSpecJson = JsonUtils.filepathToList(CONFIG_JOLT_DIRECTORY + "sdToModelContextSpec.json"); + Chainr chainr = Chainr.fromSpec(chainrSpecJson); + Object output = chainr.transform(sourceObject1); + + String resultJson = JsonUtils.toJsonString(output); + System.err.println(resultJson); + + // read the result into the NqQuery class: + Gson gson = new Gson(); + ModelContext ndQuery = gson.fromJson(resultJson, ModelContext.class); + // convert ndQuery back to json: String ndQueryToJson = gson.toJson(ndQuery); // Compare with expected output: - Object expectedObject = JsonUtils.filepathToObject(TEST_RESOURCES + "serviceDecompToModelContext-expected.json"); + Object expectedObject = JsonUtils + .filepathToObject(TEST_RESOURCES + "serviceDecompToModelContext2-expected.json"); + + Assert.assertEquals("Json transformation result does not match expected content", + JsonUtils.toPrettyJsonString(expectedObject), + JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(ndQueryToJson))); + } + + @Test + public void testTransformVserverToVm() { + + Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "networkDiscoveryVserverResponse.json"); + + String resultJson = TransformationUtil.transform(JsonUtils.toJsonString(sourceObject), "vserver"); + + // read the result into the VM class: + Gson gson = new Gson(); + VM ndVm = gson.fromJson(resultJson, VM.class); + + // convert VM object back to json: + String ndQueryToJson = gson.toJson(ndVm); + + // Compare with expected output: + Object expectedObject = JsonUtils + .filepathToObject(TEST_RESOURCES + "networkDiscoveryVserverToVm-expected.json"); Assert.assertEquals("Json transformation result does not match expected content", JsonUtils.toPrettyJsonString(expectedObject), JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(ndQueryToJson))); + } + + @Test + public void testTransformL3NetworkToNetworkModel() { + + Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "networkDiscoveryL3NetworkResponse.json"); + + String resultJson = TransformationUtil.transform(JsonUtils.toJsonString(sourceObject), "l3-network"); + + // read the result into the VM class: + Gson gson = new Gson(); + Network ndNetwork = gson.fromJson(resultJson, Network.class); + + // convert VM object back to json: + String ndQueryToJson = gson.toJson(ndNetwork); + // Compare with expected output: + Object expectedObject = JsonUtils + .filepathToObject(TEST_RESOURCES + "networkDiscoveryL3NetworkToNetwork-expected.json"); + + Assert.assertEquals("Json transformation result does not match expected content", + JsonUtils.toPrettyJsonString(expectedObject), + JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(ndQueryToJson))); } } diff --git a/src/test/resources/jolt/networkDiscoveryL3NetworkResponse.json b/src/test/resources/jolt/networkDiscoveryL3NetworkResponse.json new file mode 100644 index 0000000..3ecf22a --- /dev/null +++ b/src/test/resources/jolt/networkDiscoveryL3NetworkResponse.json @@ -0,0 +1,59 @@ +{ + "requestId": "88001", + "code": 200, + "message": "OK", + "ackFinalIndicator": true, + "resources": [ + { + "id": "01e8d84a-17a6-47b5-a167-6a45d1d56603", + "name": "NET_1106", + "type": "l3-network", + "dataQuality": { + "status": "ok", + "errorText": null + }, + "attributeList": [ + { + "name": "adminState", + "value": "true", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "sharedNetwork", + "value": "true", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "status", + "value": "ACTIVE", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "subnets", + "value": "089c9160-6f7a-4ae0-83b7-33536b4c6672", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "tenantId", + "value": "cbd5e07f58d84ea6b795aa9f5f207df0", + "dataQuality": { + "status": "ok", + "errorText": null + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/jolt/networkDiscoveryL3NetworkToNetwork-expected.json b/src/test/resources/jolt/networkDiscoveryL3NetworkToNetwork-expected.json new file mode 100644 index 0000000..def92bd --- /dev/null +++ b/src/test/resources/jolt/networkDiscoveryL3NetworkToNetwork-expected.json @@ -0,0 +1,15 @@ +{ + "uuid" : "01e8d84a-17a6-47b5-a167-6a45d1d56603", + "name" : "NET_1106", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ { + "name" : "sharedNetworkBoolean", + "value" : "true", + "dataQuality" : { + "status" : "ok" + } + } ], + "networkPolicyList" : [ ] +} \ No newline at end of file diff --git a/src/test/resources/jolt/networkDiscoveryVserverResponse.json b/src/test/resources/jolt/networkDiscoveryVserverResponse.json new file mode 100644 index 0000000..e555d4c --- /dev/null +++ b/src/test/resources/jolt/networkDiscoveryVserverResponse.json @@ -0,0 +1,99 @@ +{ + "requestId": "5d115268-564b-4db6-9d59-aa28cbd2d022___4", + "code": 200, + "message": "OK", + "ackFinalIndicator": true, + "resources": [ + { + "id": "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9", + "name": "norm-rancher", + "type": "vserver", + "dataQuality": { + "status": "ok", + "errorText": null + }, + "attributeList": [ + { + "name": "inMaintenance", + "value": "false", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "hostname", + "value": "norm-rancher", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "imageId", + "value": "87e000f6-9a81-4841-b446-5d6751c42c48", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "status", + "value": "ACTIVE", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "vmState", + "value": "active", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "userId", + "value": "0aae369d1c874bb7827f61ca4f11edae", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "tenantId", + "value": "1130b349e19c4827bf91a29d51256af1", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "hostId", + "value": "a4b1deed35881a129eabaaf9abef99b83706567bf026d8d7120a8ff3", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "host", + "value": "Setup-D2-OTT-A-C1", + "dataQuality": { + "status": "ok", + "errorText": null + } + }, + { + "name": "hostStatus", + "value": "UP", + "dataQuality": { + "status": "ok", + "errorText": null + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/jolt/networkDiscoveryVserverToVm-expected.json b/src/test/resources/jolt/networkDiscoveryVserverToVm-expected.json new file mode 100644 index 0000000..41ebe3f --- /dev/null +++ b/src/test/resources/jolt/networkDiscoveryVserverToVm-expected.json @@ -0,0 +1,38 @@ +{ + "uuid": "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9", + "name": "norm-rancher", + "dataQuality": { + "status": "ok" + }, + "attributeList": [ + { + "name": "lockedBoolean", + "value": "false", + "dataQuality": { + "status": "ok" + } + }, + { + "name": "hostName", + "value": "norm-rancher", + "dataQuality": { + "status": "ok" + } + }, + { + "name": "imageId", + "value": "87e000f6-9a81-4841-b446-5d6751c42c48", + "dataQuality": { + "status": "ok" + } + } + ], + "pServer": { + "dataQuality": { + "status": "ok" + }, + "attributeList": [], + "pInterfaceList": [] + }, + "lInterfaceList": [] +} \ No newline at end of file diff --git a/src/test/resources/jolt/serviceDecompResponse2.json b/src/test/resources/jolt/serviceDecompResponse2.json new file mode 100644 index 0000000..2d43499 --- /dev/null +++ b/src/test/resources/jolt/serviceDecompResponse2.json @@ -0,0 +1,263 @@ +{ + "service-instance-id": "PombaDemoCust_002-ServiceInst-002", + "service-instance-name": "PombaDemoCust_002-ServiceInst-002-name", + "model-invariant-id": "pomba-demo-sdc-model-002", + "model-version-id": "pomba-demo-sdc-model-002-version002", + "resource-version": "1548702838544", + "generic-vnfs": [ + { + "nf-role": "nf-role1", + "service-id": "8ea56b0d-459d-4668-b363-c9567432d8b7", + "vnf-id": "PombaDemoCust_002-VNF-id-002", + "nf-type": "nf-type1", + "l3-networks": [ + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf1-001", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484061985", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1105", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + }, + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf1-002", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484429696", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1106", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + } + ], + "prov-status": "PREPROV", + "vnf-type": "vFW-vSINK-service/vFWvSINK 0", + "orchestration-status": "Created", + "nf-naming-code": "nf-naming-code1", + "in-maint": false, + "nf-function": "nf-function1", + "model-version-id": "pomba-demo-sdc-model-002-version002", + "vservers": [ + { + "in-maint": false, + "resource-version": "1548702799178", + "vserver-name": "Firewall-002", + "prov-status": "ACTIVE", + "vserver-id": "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9", + "vserver-name2": "Firewall-002", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/a6a609e3-967a-48bd-8ce5-41c7ff5c19b9/servers/a6a609e3-967a-48bd-8ce5-41c7ff5c19b9", + "is-closed-loop-disabled": false + } + ], + "resource-version": "1548702975892", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "model-invariant-id": "pomba-demo-sdc-model-002", + "vnf-name": "Firewall-1", + "is-closed-loop-disabled": false, + "vf-modules": { + "vf-module": [ + { + "vf-module-name": "PombaDemoCust_002-VNF-id-002-VfModule002-name", + "l3-networks": [ + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf1-vfmodule1-001", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484061985", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1105", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + }, + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf1-vfmodule1-002", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484429696", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1106", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + } + ], + "module-index": 0, + "orchestration-status": "Active", + "automated-assignment": true, + "model-version-id": "pomba-demo-sdc-model-002-version002", + "heat-stack-id": "HeatStackId-002", + "resource-version": "1548707876095", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "is-base-vf-module": true, + "vf-module-id": "PombaDemoCust_002-VNF-id-002-VfModule002", + "model-invariant-id": "pomba-demo-sdc-model-002" + } + ] + } + }, + { + "nf-role": "", + "service-id": "8ea56b0d-459d-4668-b363-c9567432d8b7", + "vnf-id": "PombaDemoCust_002-VNF-id-002-2", + "nf-type": "", + "l3-networks": [ + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf2-001", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484061985", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1105", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + }, + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf2-002", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484429696", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1106", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + } + ], + "prov-status": "PREPROV", + "vnf-type": "vFW-vSINK-service/vFWvSINK 0", + "orchestration-status": "Created", + "nf-naming-code": "", + "in-maint": false, + "nf-function": "", + "model-version-id": "pomba-demo-sdc-model-002-version002", + "vservers": [ + { + "in-maint": true, + "resource-version": "1548702805873", + "vserver-name": "Firewall-002-2", + "prov-status": "UNKNOWN", + "vserver-id": "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9-2", + "vserver-name2": "Firewall-002-2", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/a6a609e3-967a-48bd-8ce5-41c7ff5c19b9/servers/a6a609e3-967a-48bd-8ce5-41c7ff5c19b9-2", + "is-closed-loop-disabled": false + } + ], + "resource-version": "1548708278469", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "vf-modules": { + "vf-module": [ + { + "vf-module-name": "PombaDemoCust_002-VNF-id-002-VfModule002-name", + "model-version-id": "pomba-demo-sdc-model-002-version002", + "heat-stack-id": "HeatStackId-002", + "resource-version": "1548708278830", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "is-base-vf-module": true, + "vf-module-id": "PombaDemoCust_002-VNF-id-002-VfModule002", + "module-index": 0, + "model-invariant-id": "pomba-demo-sdc-model-002", + "orchestration-status": "Active", + "automated-assignment": true, + "l3-networks": [ + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf2-vfmodule1-001", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484061985", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1105", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + }, + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-vnf2-vfmodule1-002", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484429696", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1106", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + } + ] + } + ] + }, + "model-invariant-id": "pomba-demo-sdc-model-002", + "vnf-name": "Firewall-2", + "is-closed-loop-disabled": false + } + ], + "l3-networks": [ + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-service-001", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484061985", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1105", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + }, + { + "network-role": "", + "network-technology": "", + "network-id": "network-id-service-002", + "is-external-network": false, + "is-bound-to-vpn": false, + "is-provider-network": false, + "network-type": "", + "model-version-id": "pomba-demo-sdc-model-001-version001", + "resource-version": "1547484429696", + "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc", + "network-name": "NET_1106", + "is-shared-network": true, + "model-invariant-id": "pomba-demo-sdc-model-001" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/jolt/serviceDecompToModelContext-expected.json b/src/test/resources/jolt/serviceDecompToModelContext-expected.json index 31f1318..ea15bf4 100644 --- a/src/test/resources/jolt/serviceDecompToModelContext-expected.json +++ b/src/test/resources/jolt/serviceDecompToModelContext-expected.json @@ -33,29 +33,28 @@ "status" : "ok" }, "attributeList" : [ ], - "pInterfaceList" : [ ], - "logicalLinkList" : [ ] + "pInterfaceList" : [ ] }, "lInterfaceList" : [ ] } ], - "networkList" : [ { - "uuid" : "2ea02809-7279-4b5e-931a-62b231615497", - "dataQuality" : { - "status" : "ok" - }, - "attributeList" : [ ], - "networkPolicyList" : [ ] - }, { - "uuid" : "01e8d84a-17a6-47b5-a167-6a45d1d56603", - "dataQuality" : { - "status" : "ok" - }, - "attributeList" : [ ], - "networkPolicyList" : [ ] - } ] + "networkList" : [ ] } ], "vnfcList" : [ ], - "networkList" : [ ] + "networkList" : [ { + "uuid" : "2ea02809-7279-4b5e-931a-62b231615497", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "01e8d84a-17a6-47b5-a167-6a45d1d56603", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] }, { "dataQuality" : { "status" : "ok" @@ -79,29 +78,28 @@ "status" : "ok" }, "attributeList" : [ ], - "pInterfaceList" : [ ], - "logicalLinkList" : [ ] + "pInterfaceList" : [ ] }, "lInterfaceList" : [ ] } ], - "networkList" : [ { - "uuid" : "2ea02809-7279-4b5e-931a-62b231615497-1", - "dataQuality" : { - "status" : "ok" - }, - "attributeList" : [ ], - "networkPolicyList" : [ ] - }, { - "uuid" : "01e8d84a-17a6-47b5-a167-6a45d1d56603-1", - "dataQuality" : { - "status" : "ok" - }, - "attributeList" : [ ], - "networkPolicyList" : [ ] - } ] + "networkList" : [ ] } ], "vnfcList" : [ ], - "networkList" : [ ] + "networkList" : [ { + "uuid" : "2ea02809-7279-4b5e-931a-62b231615497-1", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "01e8d84a-17a6-47b5-a167-6a45d1d56603-1", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] } ], "pnfList" : [ ], "networkList" : [ ] diff --git a/src/test/resources/jolt/serviceDecompToModelContext2-expected.json b/src/test/resources/jolt/serviceDecompToModelContext2-expected.json new file mode 100644 index 0000000..bf8589d --- /dev/null +++ b/src/test/resources/jolt/serviceDecompToModelContext2-expected.json @@ -0,0 +1,149 @@ +{ + "service" : { + "uuid" : "PombaDemoCust_002-ServiceInst-002", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ] + }, + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "vnfList" : [ { + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "vfModuleList" : [ { + "maxInstances" : 0, + "minInstances" : 0, + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "vmList" : [ { + "uuid" : "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "pServer" : { + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "pInterfaceList" : [ ] + }, + "lInterfaceList" : [ ] + } ], + "networkList" : [ { + "uuid" : "network-id-vnf1-vfmodule1-001", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "network-id-vnf1-vfmodule1-002", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] + } ], + "vnfcList" : [ ], + "networkList" : [ { + "uuid" : "network-id-vnf1-001", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "network-id-vnf1-002", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] + }, { + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "vfModuleList" : [ { + "maxInstances" : 0, + "minInstances" : 0, + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "vmList" : [ { + "uuid" : "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9-2", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "pServer" : { + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "pInterfaceList" : [ ] + }, + "lInterfaceList" : [ ] + } ], + "networkList" : [ { + "uuid" : "network-id-vnf2-vfmodule1-001", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "network-id-vnf2-vfmodule1-002", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] + }], + "vnfcList" : [ ], + "networkList" : [ { + "uuid" : "network-id-vnf2-001", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "network-id-vnf2-002", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] + } ], + "pnfList" : [ ], + "networkList" : [ { + "uuid" : "network-id-service-001", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + }, { + "uuid" : "network-id-service-002", + "dataQuality" : { + "status" : "ok" + }, + "attributeList" : [ ], + "networkPolicyList" : [ ] + } ] + +} \ No newline at end of file diff --git a/src/test/resources/jolt/serviceDecompToNdResources2-expected.json b/src/test/resources/jolt/serviceDecompToNdResources2-expected.json new file mode 100644 index 0000000..173a357 --- /dev/null +++ b/src/test/resources/jolt/serviceDecompToNdResources2-expected.json @@ -0,0 +1,39 @@ +{ + "ndResources" : [ { + "resourceId" : "network-id-service-001", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-service-002", + "resourceType" : "l3-network" + }, { + "resourceId" : "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9", + "resourceType" : "vserver" + }, { + "resourceId" : "network-id-vnf1-vfmodule1-001", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-vnf1-vfmodule1-002", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-vnf1-001", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-vnf1-002", + "resourceType" : "l3-network" + }, { + "resourceId" : "a6a609e3-967a-48bd-8ce5-41c7ff5c19b9-2", + "resourceType" : "vserver" + }, { + "resourceId" : "network-id-vnf2-vfmodule1-001", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-vnf2-vfmodule1-002", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-vnf2-001", + "resourceType" : "l3-network" + }, { + "resourceId" : "network-id-vnf2-002", + "resourceType" : "l3-network" + } ] +} \ No newline at end of file -- cgit 1.2.3-korg