CmSubscription review comments 68/137068/1
authormpriyank <priyank.maheshwari@est.tech>
Mon, 22 Jan 2024 15:46:37 +0000 (15:46 +0000)
committermpriyank <priyank.maheshwari@est.tech>
Mon, 22 Jan 2024 15:46:42 +0000 (15:46 +0000)
- Removed the old deprecated cmSubscription json examples
- Incorporated minor review comments from myself

Issue-ID: CPS-1951
Change-Id: Ifadaa186cc210b81bb1b27f73f537e1c11bf461d
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmSubscriptionNcmpInEventConsumer.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmSubscriptionNcmpInEventConsumerSpec.groovy
cps-ncmp-service/src/test/resources/cmSubscription/cmSubscriptionNcmpInEvent.json [moved from cps-ncmp-service/src/test/resources/cmSubscriptionNcmpInEvent.json with 100% similarity]
cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionDmiInEvent.json [deleted file]
cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionDmiOutEvent.json [deleted file]
cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionEvent.json [deleted file]
cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpInEvent.json [deleted file]
cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpOutEvent.json [deleted file]
cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpOutEvent2.json [deleted file]

index 3e16cf7..8bc3694 100644 (file)
@@ -23,7 +23,6 @@ package org.onap.cps.ncmp.api.impl.events.cmsubscription;
 import static org.onap.cps.ncmp.api.impl.events.mapper.CloudEventMapper.toTargetEvent;
 
 import io.cloudevents.CloudEvent;
-import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
 import org.onap.cps.ncmp.events.cmsubscription_merge1_0_0.client_to_ncmp.CmSubscriptionNcmpInEvent;
@@ -33,7 +32,6 @@ import org.springframework.stereotype.Component;
 
 @Component
 @Slf4j
-@RequiredArgsConstructor
 public class CmSubscriptionNcmpInEventConsumer {
 
     @Value("${notification.enabled:true}")
index fd56661..57e77eb 100644 (file)
@@ -64,7 +64,7 @@ class CmSubscriptionNcmpInEventConsumerSpec extends MessagingBaseSpec {
 
     def 'Consume valid CMSubscription create message'() {
         given: 'a cmsubscription event'
-            def jsonData = TestUtils.getResourceFileContent('cmSubscriptionNcmpInEvent.json')
+            def jsonData = TestUtils.getResourceFileContent('cmSubscription/cmSubscriptionNcmpInEvent.json')
             def testEventSent = jsonObjectMapper.convertJsonString(jsonData, CmSubscriptionNcmpInEvent.class)
             def testCloudEventSent = CloudEventBuilder.v1()
                 .withData(objectMapper.writeValueAsBytes(testEventSent))
diff --git a/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionDmiInEvent.json b/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionDmiInEvent.json
deleted file mode 100644 (file)
index f31362a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "data": {
-    "subscription": {
-      "clientID": "SCO-9989752",
-      "name": "cm-subscription-001"
-    },
-    "dataType": {
-      "dataspace": "ALL",
-      "dataCategory": "CM",
-      "dataProvider": "CM-SERVICE"
-    },
-    "predicates": {
-      "targets":[
-        {
-          "id":"CMHandle2",
-          "additional-properties":{
-            "Books":"Novel"
-          }
-        },
-        {
-          "id":"CMHandle1",
-          "additional-properties":{
-            "Books":"Social Media"
-          }
-        }
-      ],
-      "datastore": "passthrough-running",
-      "datastore-xpath-filter": "//_3gpp-nr-nrm-gnbdufunction:GNBDUFunction/_3gpp-nr-nrm-nrcelldu:NRCellDU/ | //_3gpp-nr-nrm-gnbcuupfunction:GNBCUUPFunction// | //_3gpp-nr-nrm-gnbcucpfunction:GNBCUCPFunction/_3gpp-nr-nrm-nrcelldu:NRCellCU// | //_3gpp-nr-nrm-nrsectorcarrier:NRSectorCarrier//"
-    }
-  }
-}
\ No newline at end of file
diff --git a/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionDmiOutEvent.json b/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionDmiOutEvent.json
deleted file mode 100644 (file)
index ae14b5c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "data": {
-    "clientId": "SCO-9989752",
-    "subscriptionName": "cm-subscription-001",
-    "dmiName": "dminame1",
-    "subscriptionStatus": [
-      {
-        "id": "CMHandle1",
-        "status": "REJECTED",
-        "details": "Some error message from the DMI"
-      },
-      {
-        "id": "CMHandle2",
-        "status": "REJECTED",
-        "details": "Some other error message from the DMI"
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionEvent.json b/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionEvent.json
deleted file mode 100644 (file)
index c38cb79..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "clientId": "SCO-9989752",
-  "subscriptionName": "cm-subscription-001",
-  "cmSubscriptionStatus": [
-    {
-      "id": "CMHandle1",
-      "status": "REJECTED",
-      "details": "Some error message from the DMI"
-    },
-    {
-      "id": "CMHandle2",
-      "status": "REJECTED",
-      "details": "Some other error message from the DMI"
-    },
-    {
-      "id": "CMHandle3",
-      "status": "PENDING",
-      "details": "Some error causes pending"
-    },
-    {
-      "id": "CMHandle4",
-      "status": "PENDING",
-      "details": "Some other error happened"
-    },
-    {
-      "id": "CMHandle5",
-      "status": "PENDING",
-      "details": "Some other error happened"
-    }
-  ]
-}
\ No newline at end of file
diff --git a/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpInEvent.json b/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpInEvent.json
deleted file mode 100644 (file)
index 803fa48..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "data": {
-    "subscription": {
-      "clientID": "SCO-9989752",
-      "name": "cm-subscription-001"
-    },
-    "dataType": {
-      "dataspace": "ALL",
-      "dataCategory": "CM",
-      "dataProvider": "CM-SERVICE"
-    },
-    "predicates": {
-      "targets": [
-        "CMHandle1",
-        "CMHandle2",
-        "CMHandle3"
-      ],
-      "datastore": "ncmp-datastore:passthrough-running",
-      "datastore-xpath-filter": "//_3gpp-nr-nrm-gnbdufunction:GNBDUFunction/_3gpp-nr-nrm-nrcelldu:NRCellDU/ | //_3gpp-nr-nrm-gnbcuupfunction:GNBCUUPFunction// | //_3gpp-nr-nrm-gnbcucpfunction:GNBCUCPFunction/_3gpp-nr-nrm-nrcelldu:NRCellCU// | //_3gpp-nr-nrm-nrsectorcarrier:NRSectorCarrier//"
-    }
-  }
-}
\ No newline at end of file
diff --git a/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpOutEvent.json b/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpOutEvent.json
deleted file mode 100644 (file)
index 856f238..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "data": {
-    "statusCode": 104,
-    "statusMessage": "partially applied subscription",
-    "additionalInfo": {
-      "rejected": [
-        {
-          "details": "Some other error message from the DMI",
-          "targets": ["CMHandle2"]
-        },
-        {
-          "details": "Some error message from the DMI",
-          "targets": ["CMHandle1"]
-        }
-      ],
-      "pending": [
-        {
-          "details": "Some other error happened",
-          "targets": ["CMHandle4", "CMHandle5"]
-        },
-        {
-          "details": "Some error causes pending",
-          "targets": ["CMHandle3"]
-        }
-      ]
-    }
-  }
-}
\ No newline at end of file
diff --git a/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpOutEvent2.json b/cps-ncmp-service/src/test/resources/deprecatedCmSubscription/cmSubscriptionNcmpOutEvent2.json
deleted file mode 100644 (file)
index 35ff024..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "data": {
-    "statusCode": 104,
-    "statusMessage": "partially applied subscription",
-    "additionalInfo": {
-      "rejected": [
-        {
-          "details": "Cm handle does not exist",
-          "targets": ["CMHandle1"]
-        }
-      ],
-      "pending": [
-        {
-          "details": "Subscription forwarded to dmi plugin",
-          "targets": ["CMHandle3"]
-        }
-      ]
-    }
-  }
-}
\ No newline at end of file