summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2024-05-31 09:46:11 +0100
committermpriyank <priyank.maheshwari@est.tech>2024-05-31 09:46:16 +0100
commitdaa92d74b41f4b3e1ee038532d2893bdec799bc0 (patch)
treebef74692232d22fbc037391185570578bb85eed9
parent7cb64300ddd10a9e9f0270a8c4832263e20d8ad3 (diff)
CM SUBSCRIPTION: Update schemas
- updated the cm subscription schemas with proper case as agreed before for the events - fixed the tests to reflect the camelCase change Issue-ID: CPS-2245 Change-Id: I64fb8b27a5f64280dfa19d86ae310e6b5309de39 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-dmi-in-event-schema-1.0.0.json10
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-in-event-schema-1.0.0.json4
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-out-event-schema-1.0.0.json12
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapper.java10
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmNotificationSubscriptionDmiInEventProducerSpec.groovy4
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapperSpec.groovy4
-rw-r--r--cps-ncmp-service/src/test/resources/cmSubscription/cmNotificationSubscriptionNcmpInEvent.json4
7 files changed, 24 insertions, 24 deletions
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-dmi-in-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-dmi-in-event-schema-1.0.0.json
index dcba93c014..3c23cd03bf 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-dmi-in-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-dmi-in-event-schema-1.0.0.json
@@ -22,7 +22,7 @@
"description": "Information about the targets and subscription",
"additionalProperties": false,
"properties": {
- "cmhandles": {
+ "cmHandles": {
"type": "array",
"items": {
"type": "object",
@@ -32,7 +32,7 @@
"cmhandleId": {
"type": "string"
},
- "private-properties": {
+ "privateProperties": {
"type": "object",
"existingJavaType": "java.util.Map<String,String>",
"items": {
@@ -63,7 +63,7 @@
"type": "string",
"enum": ["ncmp-datastore:passthrough-operational", "ncmp-datastore:passthrough-running"]
},
- "xpath-filter": {
+ "xpathFilter": {
"description": "Filter to be applied to the CM Handles through this event",
"type": "array",
"items": {
@@ -73,7 +73,7 @@
},
"additionalProperties": false,
"required": [
- "xpath-filter"
+ "xpathFilter"
]
}
},
@@ -86,7 +86,7 @@
}
},
"required": [
- "cmhandles",
+ "cmHandles",
"predicates"
]
}
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-in-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-in-event-schema-1.0.0.json
index 55769338b1..12de0da0a8 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-in-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-in-event-schema-1.0.0.json
@@ -34,7 +34,7 @@
"type": "string",
"enum": ["ncmp-datastore:passthrough-operational", "ncmp-datastore:passthrough-running"]
},
- "xpath-filter": {
+ "xpathFilter": {
"description": "Filter to be applied to the CM Handles through this event",
"type": "array",
"items": {
@@ -44,7 +44,7 @@
},
"additionalProperties": false,
"required": [
- "xpath-filter"
+ "xpathFilter"
]
}
},
diff --git a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-out-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-out-event-schema-1.0.0.json
index d9db3ffb97..d75e53cdfc 100644
--- a/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-out-event-schema-1.0.0.json
+++ b/cps-ncmp-events/src/main/resources/schemas/cmnotificationsubscription/cm-notification-subscription-ncmp-out-event-schema-1.0.0.json
@@ -27,21 +27,21 @@
"type": "string",
"description": "The unique subscription id"
},
- "accepted-targets": {
+ "acceptedTargets": {
"type": "array",
"description": "List of accepted targets",
"items": {
"type": "string"
}
},
- "rejected-targets": {
+ "rejectedTargets": {
"type": "array",
"description": "List of rejected targets",
"items": {
"type": "string"
}
},
- "pending-targets": {
+ "pendingTargets": {
"type": "array",
"description": "List of pending targets",
"items": {
@@ -50,9 +50,9 @@
}
},
"required": [
- "accepted-targets",
- "pending-targets",
- "rejected-targets",
+ "acceptedTargets",
+ "pendingTargets",
+ "rejectedTargets",
"subscriptionId"
],
"title": "Data"
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapper.java
index 489401f26e..7610687480 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapper.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapper.java
@@ -29,8 +29,8 @@ import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.onap.cps.ncmp.api.impl.events.cmsubscription.model.DmiCmNotificationSubscriptionPredicate;
import org.onap.cps.ncmp.api.impl.inventory.InventoryPersistence;
+import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.CmHandle;
import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.CmNotificationSubscriptionDmiInEvent;
-import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.Cmhandle;
import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.Data;
import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.Predicate;
import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.ScopeFilter;
@@ -54,7 +54,7 @@ public class CmNotificationSubscriptionDmiInEventMapper {
new CmNotificationSubscriptionDmiInEvent();
final Data cmSubscriptionData = new Data();
cmSubscriptionData.setPredicates(mapToDmiInEventPredicates(dmiCmNotificationSubscriptionPredicates));
- cmSubscriptionData.setCmhandles(mapToCmSubscriptionCmhandleWithPrivateProperties(
+ cmSubscriptionData.setCmHandles(mapToCmSubscriptionCmhandleWithPrivateProperties(
extractUniqueCmHandleIds(dmiCmNotificationSubscriptionPredicates)));
cmNotificationSubscriptionDmiInEvent.setData(cmSubscriptionData);
return cmNotificationSubscriptionDmiInEvent;
@@ -81,12 +81,12 @@ public class CmNotificationSubscriptionDmiInEventMapper {
}
- private List<Cmhandle> mapToCmSubscriptionCmhandleWithPrivateProperties(final Set<String> cmHandleIds) {
+ private List<CmHandle> mapToCmSubscriptionCmhandleWithPrivateProperties(final Set<String> cmHandleIds) {
- final List<Cmhandle> cmSubscriptionCmHandles = new ArrayList<>();
+ final List<CmHandle> cmSubscriptionCmHandles = new ArrayList<>();
inventoryPersistence.getYangModelCmHandles(cmHandleIds).forEach(yangModelCmHandle -> {
- final Cmhandle cmhandle = new Cmhandle();
+ final CmHandle cmhandle = new CmHandle();
final Map<String, String> cmhandleDmiProperties = new LinkedHashMap<>();
yangModelCmHandle.getDmiProperties()
.forEach(dmiProperty -> cmhandleDmiProperties.put(dmiProperty.getName(), dmiProperty.getValue()));
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmNotificationSubscriptionDmiInEventProducerSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmNotificationSubscriptionDmiInEventProducerSpec.groovy
index cfb28a0adc..039a189491 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmNotificationSubscriptionDmiInEventProducerSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/CmNotificationSubscriptionDmiInEventProducerSpec.groovy
@@ -25,8 +25,8 @@ import io.cloudevents.CloudEvent
import org.onap.cps.events.EventsPublisher
import org.onap.cps.ncmp.api.impl.events.cmsubscription.producer.CmNotificationSubscriptionDmiInEventProducer
import org.onap.cps.ncmp.api.impl.events.mapper.CloudEventMapper
+import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.CmHandle
import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.CmNotificationSubscriptionDmiInEvent
-import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.Cmhandle
import org.onap.cps.ncmp.events.cmnotificationsubscription_merge1_0_0.ncmp_to_dmi.Data
import org.onap.cps.utils.JsonObjectMapper
import spock.lang.Specification
@@ -43,7 +43,7 @@ class CmNotificationSubscriptionDmiInEventProducerSpec extends Specification {
def subscriptionId = 'test-subscription-id'
def dmiPluginName = 'test-dmiplugin'
def eventType = 'subscriptionCreateRequest'
- def cmNotificationSubscriptionDmiInEvent = new CmNotificationSubscriptionDmiInEvent(data: new Data(cmhandles: [new Cmhandle(cmhandleId: 'test-1', privateProperties: [:])]))
+ def cmNotificationSubscriptionDmiInEvent = new CmNotificationSubscriptionDmiInEvent(data: new Data(cmHandles: [new CmHandle(cmhandleId: 'test-1', privateProperties: [:])]))
and: 'also we have target topic for dmiPlugin'
objectUnderTest.cmNotificationSubscriptionDmiInEventTopic = 'dmiplugin-test-topic'
when: 'the event is published'
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapperSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapperSpec.groovy
index 763aedaa05..cf72b29254 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapperSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/cmsubscription/mapper/CmNotificationSubscriptionDmiInEventMapperSpec.groovy
@@ -48,8 +48,8 @@ class CmNotificationSubscriptionDmiInEventMapperSpec extends Specification {
when: 'we try to map the values'
def result = objectUnderTest.toCmNotificationSubscriptionDmiInEvent(dmiCmNotificationSubscriptionPredicates)
then: 'it contains correct cm notification subscription cmhandle object'
- assert result.data.cmhandles.cmhandleId.containsAll(['ch-1', 'ch-2'])
- assert result.data.cmhandles.privateProperties.containsAll([['k1': 'v1'], ['k2': 'v2']])
+ assert result.data.cmHandles.cmhandleId.containsAll(['ch-1', 'ch-2'])
+ assert result.data.cmHandles.privateProperties.containsAll([['k1': 'v1'], ['k2': 'v2']])
and: 'also has the correct dmi cm notification subscription predicates'
assert result.data.predicates.targetFilter.containsAll([['ch-1'], ['ch-2']])
diff --git a/cps-ncmp-service/src/test/resources/cmSubscription/cmNotificationSubscriptionNcmpInEvent.json b/cps-ncmp-service/src/test/resources/cmSubscription/cmNotificationSubscriptionNcmpInEvent.json
index 6b665495c0..04d37b8bb9 100644
--- a/cps-ncmp-service/src/test/resources/cmSubscription/cmNotificationSubscriptionNcmpInEvent.json
+++ b/cps-ncmp-service/src/test/resources/cmSubscription/cmNotificationSubscriptionNcmpInEvent.json
@@ -6,14 +6,14 @@
"targetFilter": ["ch1","ch2"],
"scopeFilter": {
"datastore": "ncmp-datastore:passthrough-operational",
- "xpath-filter": ["/x1/y1","x2/y2"]
+ "xpathFilter": ["/x1/y1","x2/y2"]
}
},
{
"targetFilter": ["ch3","ch4"],
"scopeFilter": {
"datastore": "ncmp-datastore:passthrough-operational",
- "xpath-filter": ["/x3/y3","x4/y4"]
+ "xpathFilter": ["/x3/y3","x4/y4"]
}
}
]