Merge "Normalize parent xpath when building datanodes in CpsDataService"
[cps.git] / cps-ncmp-service / src / test / groovy / org / onap / cps / ncmp / api / impl / events / avc / SubscriptionEventMapperSpec.groovy
index 3a7aa48..6d02ac7 100644 (file)
@@ -48,7 +48,7 @@ class SubscriptionEventMapperSpec extends Specification {
             def result = objectUnderTest.toYangModelSubscriptionEvent(testEventToMap)
         then: 'the resulting yang model subscription event contains the correct clientId'
             assert result.clientId == "SCO-9989752"
-        and: 'client name'
+        and: 'subscription name'
             assert result.subscriptionName == "cm-subscription-001"
         and: 'is tagged value is false'
             assert !result.isTagged
@@ -60,4 +60,20 @@ class SubscriptionEventMapperSpec extends Specification {
             assert result.topic == null
     }
 
+    def 'Map empty subscription event to yang model subscription event'() {
+        given: 'a new Subscription Event with no data'
+            def testEventToMap = new SubscriptionEvent()
+        when: 'the event is mapped to a yang model subscription'
+            def result = objectUnderTest.toYangModelSubscriptionEvent(testEventToMap)
+        then: 'the resulting yang model subscription event contains null clientId'
+            assert result.clientId == null
+        and: 'subscription name is null'
+            assert result.subscriptionName == null
+        and: 'is tagged value is false'
+            assert result.isTagged == false
+        and: 'predicates is null'
+            assert result.predicates == null
+        and: 'the topic is null'
+            assert result.topic == null
+    }
 }
\ No newline at end of file