- assertEquals("We should have one message", 1, mockAlarmProducer.history().size());
- assertEquals("Key should be test", "test", mockAlarmProducer.history().get(0).key());
+ assertEquals(1, mockAlarmProducer.history().size(), "We should have one message");
+ assertEquals("test", mockAlarmProducer.history().get(0).key(), "Key should be test");
+ }
+
+ @Test
+ void sendTapiEventShouldBeSuccessful() throws IOException {
+ CreateNotificationSubscriptionServiceInputBuilder builder
+ = NotificationServiceDataUtils.buildNotificationSubscriptionServiceInputBuilder();
+ SubscriptionFilter subscriptionFilter = new SubscriptionFilterBuilder(builder.getSubscriptionFilter())
+ .setRequestedObjectIdentifier(new HashSet<>(List.of(new Uuid("76d8f07b-ead5-4132-8eb8-cf3fdef7e079"))))
+ .build();
+ builder.setSubscriptionFilter(subscriptionFilter);
+
+ new CreateNotificationSubscriptionServiceImpl(nbiNotificationsImpl, topicManager).invoke(builder.build());
+ String json = Files.readString(Paths.get("src/test/resources/tapi_event.json"));
+ NotificationTapiService notificationTapiService = converterTapiService
+ .createDataObjectFromJsonString(YangInstanceIdentifier.of(NotificationTapiService.QNAME),
+ json, JSONCodecFactorySupplier.RFC7951);
+ publisherTapiService.sendEvent(notificationTapiService, "");
+ assertEquals(1, mockTapiProducer.history().size(), "We should have one message");
+ assertEquals("test", mockTapiProducer.history().get(0).key(), "Key should be test");