Merge "Reject create request with duplicated subscriptionId"
[cps.git] / cps-ncmp-service / src / test / groovy / org / onap / cps / ncmp / api / impl / events / cmsubscription / mapper / CmNotificationSubscriptionNcmpOutEventMapperSpec.groovy
index 93bb480..f6bb24c 100644 (file)
@@ -52,4 +52,13 @@ class CmNotificationSubscriptionNcmpOutEventMapperSpec extends Specification {
             result.data.acceptedTargets == ['ch-B']
             result.data.rejectedTargets == ['ch-C']
     }
+
+    def 'Check for Cm Notification Rejected Subscription Outgoing event mapping'() {
+        when: 'we try to map the event to send it to client'
+            def result = objectUnderTest.toCmNotificationSubscriptionNcmpOutEventForRejectedRequest('test-subscription', ['ch-1', 'ch-2'])
+        then: 'event is mapped correctly for the subscription id'
+            result.data.subscriptionId == 'test-subscription'
+        and: 'the cm handle ids are part of correct list'
+            result.data.withRejectedTargets(['ch-1', 'ch-2'])
+    }
 }