From: Guillaume Lambert Date: Fri, 20 Oct 2023 07:56:38 +0000 (+0000) Subject: Merge "Don't use NotificationListener (NbiNotifications)" X-Git-Tag: 9.0.0~83 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=0cda8984cc548fa572022c7742e90d5860f419b8;hp=78b163d996670c59efa5c66a9a5f6cf60bd1073b;p=transportpce.git Merge "Don't use NotificationListener (NbiNotifications)" --- diff --git a/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProvider.java b/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProvider.java index 51742f2c8..45b085072 100644 --- a/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProvider.java +++ b/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProvider.java @@ -8,9 +8,8 @@ package org.opendaylight.transportpce.dmaap.client.impl; import org.opendaylight.mdsal.binding.api.NotificationService; -import org.opendaylight.transportpce.dmaap.client.listener.NbiNotificationsListenerImpl; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener; -import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.transportpce.dmaap.client.listener.NbiNotificationsHandler; +import org.opendaylight.yangtools.concepts.Registration; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -33,7 +32,7 @@ public class DmaapClientProvider { } private static final Logger LOG = LoggerFactory.getLogger(DmaapClientProvider.class); - private ListenerRegistration listenerRegistration; + private Registration listenerRegistration; @Activate public DmaapClientProvider(@Reference NotificationService notificationService, Configuration config) { @@ -42,8 +41,8 @@ public class DmaapClientProvider { public DmaapClientProvider(NotificationService notificationService, String baseUrl, String username, String password) { - listenerRegistration = notificationService.registerNotificationListener( - new NbiNotificationsListenerImpl(baseUrl, username, password)); + final var listener = new NbiNotificationsHandler(baseUrl, username, password); + listenerRegistration = notificationService.registerCompositeListener(listener.getCompositeListener()); LOG.info("DmaapClientProvider Session Initiated"); } diff --git a/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImpl.java b/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandler.java similarity index 67% rename from dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImpl.java rename to dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandler.java index fcf0b000d..77f41b4ff 100644 --- a/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImpl.java +++ b/dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandler.java @@ -7,6 +7,7 @@ */ package org.opendaylight.transportpce.dmaap.client.listener; +import java.util.Set; import javax.ws.rs.WebApplicationException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; @@ -14,22 +15,24 @@ import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.glassfish.jersey.client.proxy.WebResourceFactory; import org.glassfish.jersey.jackson.JacksonFeature; import org.glassfish.jersey.logging.LoggingFeature; +import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener; import org.opendaylight.transportpce.dmaap.client.resource.EventsApi; import org.opendaylight.transportpce.dmaap.client.resource.config.JsonConfigurator; import org.opendaylight.transportpce.dmaap.client.resource.model.CreatedEvent; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService; +import org.opendaylight.yangtools.concepts.Registration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class NbiNotificationsListenerImpl implements NbiNotificationsListener { - private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsListenerImpl.class); +public class NbiNotificationsHandler { + private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsHandler.class); private String topic = "unauthenticated.TPCE"; private EventsApi api; + private Registration reg; - public NbiNotificationsListenerImpl(String baseUrl, String username, String password) { + public NbiNotificationsHandler(String baseUrl, String username, String password) { LOG.info("Dmaap server {} for user {}", baseUrl, username); Client client = ClientBuilder.newClient(); if (username != null && username.isBlank() && password != null && !password.isBlank()) { @@ -43,8 +46,18 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener { } - @Override - public void onPublishNotificationProcessService(PublishNotificationProcessService notification) { + public CompositeListener getCompositeListener() { + return new CompositeListener(Set.of( + new CompositeListener.Component<>( + PublishNotificationProcessService.class, this::onPublishNotificationProcessService), + new CompositeListener.Component<>( + PublishNotificationAlarmService.class, this::onPublishNotificationAlarmService), + new CompositeListener.Component<>( + PublishTapiNotificationService.class, this::onPublishTapiNotificationService) + )); + } + + void onPublishNotificationProcessService(PublishNotificationProcessService notification) { try { CreatedEvent response = api.sendEvent(topic, notification); LOG.info("Response received {}", response); @@ -54,11 +67,9 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener { } - @Override - public void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) { + private void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) { } - @Override - public void onPublishTapiNotificationService(PublishTapiNotificationService notification) { + private void onPublishTapiNotificationService(PublishTapiNotificationService notification) { } } diff --git a/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProviderTest.java b/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProviderTest.java index 79f7edcf3..93c7940fa 100644 --- a/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProviderTest.java +++ b/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProviderTest.java @@ -16,7 +16,6 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.opendaylight.mdsal.binding.api.NotificationService; -import org.opendaylight.transportpce.dmaap.client.listener.NbiNotificationsListenerImpl; public class DmaapClientProviderTest { @@ -33,7 +32,7 @@ public class DmaapClientProviderTest { void testInitRegisterNbiNotificationsToRpcRegistry() { new DmaapClientProvider(notificationService, "http://localhost", "username", "password"); verify(notificationService, times(1)) - .registerNotificationListener(Mockito.any(NbiNotificationsListenerImpl.class)); + .registerCompositeListener(Mockito.any(NotificationService.CompositeListener.class)); } } diff --git a/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImplTest.java b/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandlerTest.java similarity index 94% rename from dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImplTest.java rename to dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandlerTest.java index 6bef4744e..ceb712a3f 100644 --- a/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImplTest.java +++ b/dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandlerTest.java @@ -29,7 +29,6 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev2 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service.endpoint.TxDirectionKey; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev191129.ServiceFormat; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder; @@ -38,7 +37,7 @@ import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.common.Uint8; import org.slf4j.LoggerFactory; -public class NbiNotificationsListenerImplTest extends JerseyTest { +public class NbiNotificationsHandlerTest extends JerseyTest { @Override protected Application configure() { enable(TestProperties.LOG_TRAFFIC); @@ -48,11 +47,11 @@ public class NbiNotificationsListenerImplTest extends JerseyTest { @Test void onPublishNotificationServiceTest() { - Logger logger = (Logger) LoggerFactory.getLogger(NbiNotificationsListenerImpl.class); + Logger logger = (Logger) LoggerFactory.getLogger(NbiNotificationsHandler.class); ListAppender listAppender = new ListAppender<>(); listAppender.start(); logger.addAppender(listAppender); - NbiNotificationsListener listener = new NbiNotificationsListenerImpl("http://localhost:9998", null, null); + NbiNotificationsHandler listener = new NbiNotificationsHandler("http://localhost:9998", null, null); PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder() .setCommonId("CommonId") .setMessage("Service implemented") diff --git a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java index f1caef3f5..b8e54d58c 100644 --- a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java +++ b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java @@ -15,14 +15,12 @@ import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices; import org.opendaylight.transportpce.common.converter.JsonStringConverter; import org.opendaylight.transportpce.common.network.NetworkTransactionService; -import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl; +import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsHandler; import org.opendaylight.transportpce.nbinotifications.producer.Publisher; import org.opendaylight.transportpce.nbinotifications.utils.TopicManager; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService; -import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.Registration; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -47,7 +45,7 @@ public class NbiNotificationsProvider { private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsProvider.class); private static Map> publishersServiceMap = new HashMap<>(); private static Map> publishersAlarmMap = new HashMap<>(); - private ListenerRegistration listenerRegistration; + private Registration listenerRegistration; private Registration rpcRegistration; @Activate @@ -90,10 +88,11 @@ public class NbiNotificationsProvider { NbiNotificationsImpl nbiImpl = new NbiNotificationsImpl(converterService, converterAlarmService, converterTapiService, subscriberServer, networkTransactionService, topicManager); rpcRegistration = rpcProviderService.registerRpcImplementations(nbiImpl.registerRPCs()); - NbiNotificationsListenerImpl nbiNotificationsListener = new NbiNotificationsListenerImpl( - topicManager.getProcessTopicMap(), topicManager.getAlarmTopicMap(), topicManager.getTapiTopicMap()); - listenerRegistration = notificationService.registerNotificationListener(nbiNotificationsListener); - topicManager.setNbiNotificationsListener(nbiNotificationsListener); + NbiNotificationsHandler notificationsListener = new NbiNotificationsHandler( + topicManager.getProcessTopicMap(), topicManager.getAlarmTopicMap(), topicManager.getTapiTopicMap()); + listenerRegistration = notificationService.registerCompositeListener( + notificationsListener.getCompositeListener()); + topicManager.setNbiNotificationsListener(notificationsListener); LOG.info("NbiNotificationsProvider Session Initiated"); } diff --git a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImpl.java b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandler.java similarity index 81% rename from nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImpl.java rename to nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandler.java index 7450fa671..f243989e4 100644 --- a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImpl.java +++ b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandler.java @@ -8,9 +8,10 @@ package org.opendaylight.transportpce.nbinotifications.listener; import java.util.Map; +import java.util.Set; +import org.opendaylight.mdsal.binding.api.NotificationService.CompositeListener; import org.opendaylight.transportpce.nbinotifications.producer.Publisher; import org.opendaylight.transportpce.nbinotifications.utils.NbiNotificationsUtils; -import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmServiceBuilder; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService; @@ -20,16 +21,18 @@ import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapi import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService; +import org.opendaylight.yangtools.concepts.Registration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class NbiNotificationsListenerImpl implements NbiNotificationsListener { - private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsListenerImpl.class); +public class NbiNotificationsHandler { + private static final Logger LOG = LoggerFactory.getLogger(NbiNotificationsHandler.class); private Map> publishersServiceMap; private Map> publishersAlarmMap; private Map> tapiPublisherMap; + private Registration reg; - public NbiNotificationsListenerImpl(Map> publishersServiceMap, + public NbiNotificationsHandler(Map> publishersServiceMap, Map> publishersAlarmMap, Map> tapiPublisherMap) { this.publishersServiceMap = publishersServiceMap; @@ -37,8 +40,18 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener { this.tapiPublisherMap = tapiPublisherMap; } - @Override - public void onPublishNotificationProcessService(PublishNotificationProcessService notification) { + public CompositeListener getCompositeListener() { + return new CompositeListener(Set.of( + new CompositeListener.Component<>( + PublishNotificationProcessService.class, this::onPublishNotificationProcessService), + new CompositeListener.Component<>( + PublishNotificationAlarmService.class, this::onPublishNotificationAlarmService), + new CompositeListener.Component<>( + PublishTapiNotificationService.class, this::onPublishTapiNotificationService) + )); + } + + void onPublishNotificationProcessService(PublishNotificationProcessService notification) { LOG.info("Receiving request for publishing notification service"); String publisherName = notification.getPublisherName(); if (!publishersServiceMap.containsKey(publisherName)) { @@ -58,8 +71,7 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener { .build(), notification.getConnectionType().getName()); } - @Override - public void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) { + void onPublishNotificationAlarmService(PublishNotificationAlarmService notification) { LOG.info("Receiving request for publishing notification alarm service"); String publisherName = notification.getPublisherName(); if (!publishersAlarmMap.containsKey(publisherName)) { @@ -75,8 +87,7 @@ public class NbiNotificationsListenerImpl implements NbiNotificationsListener { .build(), "alarm" + notification.getConnectionType().getName()); } - @Override - public void onPublishTapiNotificationService(PublishTapiNotificationService notification) { + void onPublishTapiNotificationService(PublishTapiNotificationService notification) { LOG.info("Receiving request for publishing TAPI notification"); String topic = notification.getTopic(); if (!tapiPublisherMap.containsKey(topic)) { diff --git a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/TopicManager.java b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/TopicManager.java index dad51171f..de827d75f 100644 --- a/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/TopicManager.java +++ b/nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/TopicManager.java @@ -10,7 +10,7 @@ package org.opendaylight.transportpce.nbinotifications.utils; import java.util.HashMap; import java.util.Map; import org.opendaylight.transportpce.common.converter.JsonStringConverter; -import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl; +import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsHandler; import org.opendaylight.transportpce.nbinotifications.producer.Publisher; import org.opendaylight.transportpce.nbinotifications.serialization.NotificationAlarmServiceSerializer; import org.opendaylight.transportpce.nbinotifications.serialization.NotificationServiceSerializer; @@ -29,7 +29,7 @@ public final class TopicManager { private Map> tapiPublisherMap = new HashMap<>(); private String publisherServer; private JsonStringConverter tapiConverter; - private NbiNotificationsListenerImpl nbiNotificationsListener; + private NbiNotificationsHandler nbiNotificationsListener; private Map> alarmPublisherMap = new HashMap<>(); private Map> processPublisherMap = new HashMap<>(); private JsonStringConverter processConverter; @@ -42,7 +42,7 @@ public final class TopicManager { return instance; } - public void setNbiNotificationsListener(NbiNotificationsListenerImpl nbiNotificationsListener) { + public void setNbiNotificationsListener(NbiNotificationsHandler nbiNotificationsListener) { this.nbiNotificationsListener = nbiNotificationsListener; } diff --git a/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java b/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java index 2b37bb5a3..4bbfb6404 100644 --- a/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java +++ b/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java @@ -19,7 +19,6 @@ import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.transportpce.common.network.NetworkTransactionImpl; import org.opendaylight.transportpce.common.network.NetworkTransactionService; -import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl; import org.opendaylight.transportpce.test.AbstractTest; public class NbiNotificationsProviderTest extends AbstractTest { @@ -43,6 +42,6 @@ public class NbiNotificationsProviderTest extends AbstractTest { networkTransactionService); verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any()); verify(notificationService, times(1)) - .registerNotificationListener(any(NbiNotificationsListenerImpl.class)); + .registerCompositeListener(any(NotificationService.CompositeListener.class)); } } diff --git a/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImplTest.java b/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandlerTest.java similarity index 88% rename from nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImplTest.java rename to nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandlerTest.java index 51ce4e54a..e87279d9c 100644 --- a/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImplTest.java +++ b/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandlerTest.java @@ -37,7 +37,7 @@ import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificat import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService; import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationServiceBuilder; -public class NbiNotificationsListenerImplTest extends AbstractTest { +public class NbiNotificationsHandlerTest extends AbstractTest { @Mock private Publisher publisherService; @Mock @@ -52,7 +52,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void onPublishNotificationServiceTest() { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder() .setPublisherName("test") @@ -68,7 +68,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void onPublishNotificationServiceWrongPublisherTest() { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder() .setPublisherName("wrongPublisher") @@ -84,7 +84,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void onPublishNotificationAlarmServiceTest() { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); PublishNotificationAlarmService notification = new PublishNotificationAlarmServiceBuilder() .setPublisherName("test") @@ -99,7 +99,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void onPublishNotificationAlarmServiceWrongPublisherTest() { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); PublishNotificationAlarmService notification = new PublishNotificationAlarmServiceBuilder() .setPublisherName("wrongPublisher") @@ -114,7 +114,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void onPublishTapiNotificationServiceTest() throws ExecutionException, InterruptedException { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); PublishTapiNotificationService notification @@ -127,7 +127,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void onPublishTapiNotificationServiceTestWrongPublisherTest() { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); PublishTapiNotificationService notification = new PublishTapiNotificationServiceBuilder(NotificationServiceDataUtils.buildReceivedTapiAlarmEvent()) @@ -139,7 +139,7 @@ public class NbiNotificationsListenerImplTest extends AbstractTest { @Test void getTapiPublisherFromTopicTest() { - NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService), + NbiNotificationsHandler listener = new NbiNotificationsHandler(Map.of("test", publisherService), Map.of("test", publisherAlarm), Map.of("test", publisherTapiService)); assertNull(listener.getTapiPublisherFromTopic("toto")); assertEquals(publisherTapiService, listener.getTapiPublisherFromTopic("test"));