From 202fc696cdf0a2503b2d5f738f892b8cb5da7bd9 Mon Sep 17 00:00:00 2001 From: mpriyank Date: Wed, 14 Aug 2024 15:52:01 +0100 Subject: Corrected Resource location for Stub - eliminate nullpointerexception from the DMI Stub logs Issue-ID: CPS-2313 Change-Id: Iccfce28b3ccacb55b14a16525dcc621b4e1ae675 Signed-off-by: mpriyank --- .../stub/controller/DmiRestStubController.java | 4 +- .../ietf-network-topology-sample-rfc8345.json | 76 ---------------------- .../data/ietf-network-topology-sample-rfc8345.json | 76 ++++++++++++++++++++++ 3 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data.operational/ietf-network-topology-sample-rfc8345.json create mode 100644 dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data/ietf-network-topology-sample-rfc8345.json diff --git a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java index 5021ae76..e06c528d 100644 --- a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java +++ b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java @@ -225,7 +225,7 @@ public class DmiRestStubController { log.info("Logging request body {}", requestBody); final String sampleJson = ResourceFileReaderUtil.getResourceFileContent(applicationContext.getResource( - ResourceLoader.CLASSPATH_URL_PREFIX + "data/operational/ietf-network-topology-sample-rfc8345.json")); + ResourceLoader.CLASSPATH_URL_PREFIX + "data/ietf-network-topology-sample-rfc8345.json")); return ResponseEntity.ok(sampleJson); } @@ -347,7 +347,7 @@ public class DmiRestStubController { response.setOptions(dataOperationRequest.getOptions()); final String ietfNetworkTopologySample = ResourceFileReaderUtil.getResourceFileContent( applicationContext.getResource(ResourceLoader.CLASSPATH_URL_PREFIX - + "data/operational/ietf-network-topology-sample-rfc8345.json")); + + "data/ietf-network-topology-sample-rfc8345.json")); final JSONParser jsonParser = new JSONParser(); try { response.setResult(jsonParser.parse(ietfNetworkTopologySample)); diff --git a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data.operational/ietf-network-topology-sample-rfc8345.json b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data.operational/ietf-network-topology-sample-rfc8345.json deleted file mode 100644 index 8f9dbc22..00000000 --- a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data.operational/ietf-network-topology-sample-rfc8345.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "ietf-network:networks": { - "network": [ - { - "network-types": { - }, - "network-id": "otn-hc", - "node": [ - { - "node-id": "D1", - "termination-point": [ - { - "tp-id": "1-0-1" - }, - { - "tp-id": "1-2-1" - }, - { - "tp-id": "1-3-1" - } - ] - }, - { - "node-id": "D2", - "termination-point": [ - { - "tp-id": "2-0-1" - }, - { - "tp-id": "2-1-1" - }, - { - "tp-id": "2-3-1" - } - ] - }, - { - "node-id": "D3", - "termination-point": [ - { - "tp-id": "3-1-1" - }, - { - "tp-id": "3-2-1" - } - ] - } - ], - "ietf-network-topology:link": [ - { - "link-id": "D1,1-2-1,D2,2-1-1", - "source": { - "source-node": "D1", - "source-tp": "1-2-1" - }, - "destination": { - "dest-node": "D2", - "dest-tp": "2-1-1" - } - }, - { - "link-id": "D2,2-1-1,D1,1-2-1", - "source": { - "source-node": "D2", - "source-tp": "2-1-1" - }, - "destination": { - "dest-node": "D1", - "dest-tp": "1-2-1" - } - } - ] - } - ] - } - } diff --git a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data/ietf-network-topology-sample-rfc8345.json b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data/ietf-network-topology-sample-rfc8345.json new file mode 100644 index 00000000..8f9dbc22 --- /dev/null +++ b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/resources/data/ietf-network-topology-sample-rfc8345.json @@ -0,0 +1,76 @@ +{ + "ietf-network:networks": { + "network": [ + { + "network-types": { + }, + "network-id": "otn-hc", + "node": [ + { + "node-id": "D1", + "termination-point": [ + { + "tp-id": "1-0-1" + }, + { + "tp-id": "1-2-1" + }, + { + "tp-id": "1-3-1" + } + ] + }, + { + "node-id": "D2", + "termination-point": [ + { + "tp-id": "2-0-1" + }, + { + "tp-id": "2-1-1" + }, + { + "tp-id": "2-3-1" + } + ] + }, + { + "node-id": "D3", + "termination-point": [ + { + "tp-id": "3-1-1" + }, + { + "tp-id": "3-2-1" + } + ] + } + ], + "ietf-network-topology:link": [ + { + "link-id": "D1,1-2-1,D2,2-1-1", + "source": { + "source-node": "D1", + "source-tp": "1-2-1" + }, + "destination": { + "dest-node": "D2", + "dest-tp": "2-1-1" + } + }, + { + "link-id": "D2,2-1-1,D1,1-2-1", + "source": { + "source-node": "D2", + "source-tp": "2-1-1" + }, + "destination": { + "dest-node": "D1", + "dest-tp": "1-2-1" + } + } + ] + } + ] + } + } -- cgit 1.2.3-korg