Add CloudEventBuilder to SpringBootTest 00/140600/1
authoregernug <gerard.nugent@est.tech>
Wed, 26 Mar 2025 16:00:47 +0000 (16:00 +0000)
committeregernug <gerard.nugent@est.tech>
Wed, 26 Mar 2025 16:00:47 +0000 (16:00 +0000)
There are test failures on:
DmiInEventProducerSpec
NcmpOutEventProducerSpec
stemming from CloudEventBuilder being missing from the SpringBootTest. Adding this to clear issues.

Issue-ID: CPS-2727

Change-Id: I5e838741d7fc54bc91c5d91497085da68ab391d4
Signed-off-by: egernug <gerard.nugent@est.tech>
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiInEventProducerSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpOutEventProducerSpec.groovy

index 3bf4c2c..49e43f9 100644 (file)
@@ -22,6 +22,7 @@ package org.onap.cps.ncmp.impl.cmnotificationsubscription.dmi
 
 import com.fasterxml.jackson.databind.ObjectMapper
 import io.cloudevents.CloudEvent
+import io.cloudevents.core.v1.CloudEventBuilder
 import org.onap.cps.events.EventsPublisher
 import org.onap.cps.ncmp.config.CpsApplicationContext
 import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.ncmp_to_dmi.CmHandle
@@ -33,7 +34,7 @@ import org.springframework.boot.test.context.SpringBootTest
 import org.springframework.test.context.ContextConfiguration
 import spock.lang.Specification
 
-@SpringBootTest(classes = [ObjectMapper, JsonObjectMapper])
+@SpringBootTest(classes = [ObjectMapper, JsonObjectMapper, CloudEventBuilder])
 @ContextConfiguration(classes = [CpsApplicationContext])
 class DmiInEventProducerSpec extends Specification {
 
index fde7e18..d8adde2 100644 (file)
@@ -22,6 +22,7 @@ package org.onap.cps.ncmp.impl.cmnotificationsubscription.ncmp
 
 import com.fasterxml.jackson.databind.ObjectMapper
 import io.cloudevents.CloudEvent
+import io.cloudevents.core.v1.CloudEventBuilder
 import org.onap.cps.events.EventsPublisher
 import org.onap.cps.ncmp.config.CpsApplicationContext
 import org.onap.cps.ncmp.impl.cmnotificationsubscription.cache.DmiCacheHandler
@@ -33,7 +34,7 @@ import org.springframework.boot.test.context.SpringBootTest
 import org.springframework.test.context.ContextConfiguration
 import spock.lang.Specification
 
-@SpringBootTest(classes = [ObjectMapper, JsonObjectMapper])
+@SpringBootTest(classes = [ObjectMapper, JsonObjectMapper, CloudEventBuilder])
 @ContextConfiguration(classes = [CpsApplicationContext])
 class NcmpOutEventProducerSpec extends Specification {