Refractor code to use the new LcmEvent schema
[cps.git] / cps-ncmp-service / src / test / groovy / org / onap / cps / ncmp / api / impl / event / lcm / LcmEventsServiceSpec.groovy
index 3dab5af..1eae357 100644 (file)
@@ -20,7 +20,7 @@
 
 package org.onap.cps.ncmp.api.impl.event.lcm
 
-import org.onap.ncmp.cmhandle.lcm.event.NcmpEvent
+import org.onap.ncmp.cmhandle.event.lcm.LcmEvent
 import spock.lang.Specification
 
 class LcmEventsServiceSpec extends Specification {
@@ -30,15 +30,15 @@ class LcmEventsServiceSpec extends Specification {
     def objectUnderTest = new LcmEventsService(mockLcmEventsPublisher)
 
     def 'Create and Publish lcm event where events are #scenario'() {
-        given: 'a cm handle id and Ncmp Event'
+        given: 'a cm handle id and Lcm Event'
             def cmHandleId = 'test-cm-handle-id'
-            def ncmpEvent = new NcmpEvent(eventId: UUID.randomUUID().toString(), eventCorrelationId: cmHandleId)
-        and: 'notifications enabled is #notificationsEnabled'
+            def lcmEvent = new LcmEvent(eventId: UUID.randomUUID().toString(), eventCorrelationId: cmHandleId)
+        and: 'notificationsEnabled is #notificationsEnabled and it will be true as default'
             objectUnderTest.notificationsEnabled = notificationsEnabled
         when: 'service is called to publish lcm event'
-            objectUnderTest.publishLcmEvent('test-cm-handle-id', ncmpEvent)
+            objectUnderTest.publishLcmEvent('test-cm-handle-id', lcmEvent)
         then: 'publisher is called #expectedTimesMethodCalled times'
-            expectedTimesMethodCalled * mockLcmEventsPublisher.publishEvent(_, cmHandleId, ncmpEvent)
+            expectedTimesMethodCalled * mockLcmEventsPublisher.publishEvent(_, cmHandleId, lcmEvent)
         where: 'the following values are used'
             scenario   | notificationsEnabled || expectedTimesMethodCalled
             'enabled'  | true                 || 1