diff options
author | seanbeirne <sean.beirne@est.tech> | 2024-05-24 15:51:02 +0100 |
---|---|---|
committer | seanbeirne <sean.beirne@est.tech> | 2024-05-27 14:54:22 +0100 |
commit | e3ac8892ef9707e5cb22a158592be0c715d19aa4 (patch) | |
tree | c4833f03d6ac12543376ee73625783d43d263d66 /src/test/groovy/org | |
parent | 2a83a1ea0fc341225829915078308fca2a39d646 (diff) |
DMI CmSubscription topic params update
Issue-ID: CPS-2242
Change-Id: I4628e28a14bab7b15c615d13d6aea7ae97409f5a
Signed-off-by: seanbeirne <sean.beirne@est.tech>
Diffstat (limited to 'src/test/groovy/org')
-rw-r--r-- | src/test/groovy/org/onap/cps/ncmp/dmi/notifications/cmsubscription/CmNotificationSubscriptionDmiInEventConsumerSpec.groovy | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/notifications/cmsubscription/CmNotificationSubscriptionDmiInEventConsumerSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/notifications/cmsubscription/CmNotificationSubscriptionDmiInEventConsumerSpec.groovy index aa331c4b..f1f476f6 100644 --- a/src/test/groovy/org/onap/cps/ncmp/dmi/notifications/cmsubscription/CmNotificationSubscriptionDmiInEventConsumerSpec.groovy +++ b/src/test/groovy/org/onap/cps/ncmp/dmi/notifications/cmsubscription/CmNotificationSubscriptionDmiInEventConsumerSpec.groovy @@ -47,12 +47,12 @@ import java.time.OffsetDateTime import java.time.ZoneId -@SpringBootTest(classes = [CmNotificationSubscriptionDmiInEventConsumer]) @Testcontainers @DirtiesContext class CmNotificationSubscriptionDmiInEventConsumerSpec extends MessagingBaseSpec { def objectMapper = new ObjectMapper() def testTopic = 'dmi-ncmp-cm-avc-subscription' + def testDmiName = 'test-ncmp-dmi' @SpringBean CmNotificationSubscriptionDmiInEventConsumer objectUnderTest = new CmNotificationSubscriptionDmiInEventConsumer(cloudEventKafkaTemplate) @@ -70,8 +70,8 @@ class CmNotificationSubscriptionDmiInEventConsumerSpec extends MessagingBaseSpec def 'Sends subscription cloud event response successfully.'() { given: 'an subscription event response' - objectUnderTest.dmiName = 'test-ncmp-dmi' - objectUnderTest.cmNotificationSubscriptionResponseTopic = testTopic + objectUnderTest.dmiName = testDmiName + objectUnderTest.cmNotificationSubscriptionDmiOutTopic = testTopic def correlationId = 'test-subscriptionId#test-ncmp-dmi' def cmSubscriptionDmiOutEventData = new Data(statusCode: subscriptionStatusCode, statusMessage: subscriptionStatusMessage) def subscriptionEventResponse = @@ -94,17 +94,17 @@ class CmNotificationSubscriptionDmiInEventConsumerSpec extends MessagingBaseSpec where: 'given #scenario' scenario | subscriptionAcceptanceType | subscriptionStatusCode | subscriptionStatusMessage 'Subscription is Accepted' | CmNotificationSubscriptionStatus.ACCEPTED | '1' | 'ACCEPTED' - 'Subscription is Rejected' | CmNotificationSubscriptionStatus.REJECTED | '2' | 'REJECTED' + 'Subscription is Rejected' | CmNotificationSubscriptionStatus.REJECTED | '104' | 'REJECTED' } def 'Consume valid message.'() { given: 'an event' - objectUnderTest.dmiName = 'test-ncmp-dmi' + objectUnderTest.dmiName = testDmiName def eventKey = UUID.randomUUID().toString() def timestamp = new Timestamp(1679521929511) def jsonData = TestUtils.getResourceFileContent('cmNotificationSubscriptionCreationEvent.json') def subscriptionEvent = objectMapper.readValue(jsonData, CmNotificationSubscriptionDmiInEvent.class) - objectUnderTest.cmNotificationSubscriptionResponseTopic = testTopic + objectUnderTest.cmNotificationSubscriptionDmiOutTopic = testTopic def cloudEvent = CloudEventBuilder.v1().withId(UUID.randomUUID().toString()).withSource(URI.create('test-ncmp-dmi')) .withType(subscriptionType) .withDataSchema(URI.create("urn:cps:" + CmNotificationSubscriptionDmiInEvent.class.getName() + ":1.0.0")) @@ -124,11 +124,11 @@ class CmNotificationSubscriptionDmiInEventConsumerSpec extends MessagingBaseSpec def 'Consume invalid message.'() { given: 'an invalid event body' - objectUnderTest.dmiName = 'test-ncmp-dmi' + objectUnderTest.dmiName = testDmiName def eventKey = UUID.randomUUID().toString() def timestamp = new Timestamp(1679521929511) def invalidJsonBody = "/////" - objectUnderTest.cmNotificationSubscriptionResponseTopic = testTopic + objectUnderTest.cmNotificationSubscriptionDmiOutTopic = testTopic def cloudEvent = CloudEventBuilder.v1().withId(UUID.randomUUID().toString()).withSource(URI.create('test-ncmp-dmi')) .withType("subscriptionCreated") .withDataSchema(URI.create("urn:cps:org.onap.ncmp.dmi.cm.subscription:1.0.0")) |