Merge "Don't use NotificationListener (NbiNotifications)"
authorGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 20 Oct 2023 07:56:38 +0000 (07:56 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 20 Oct 2023 07:56:38 +0000 (07:56 +0000)
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProvider.java
dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandler.java [moved from dmaap-client/src/main/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImpl.java with 67% similarity]
dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/impl/DmaapClientProviderTest.java
dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsHandlerTest.java [moved from dmaap-client/src/test/java/org/opendaylight/transportpce/dmaap/client/listener/NbiNotificationsListenerImplTest.java with 94% similarity]
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProvider.java
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandler.java [moved from nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImpl.java with 81% similarity]
nbinotifications/src/main/java/org/opendaylight/transportpce/nbinotifications/utils/TopicManager.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java
nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsHandlerTest.java [moved from nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/listener/NbiNotificationsListenerImplTest.java with 88% similarity]

index 51742f2c82eeac1acbc93bbf947ec819cb828fd0..45b0850727bea033893f74bb478cb13c19c49138 100644 (file)
@@ -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<NbiNotificationsListener> 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");
     }
 
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 fcf0b000dd8c80e88ab4c782e025cc2b4af76c93..77f41b4ff271fe697181f162ded3240481d030ee 100644 (file)
@@ -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) {
     }
 }
index 79f7edcf3ee0b9a4164dd08a73e7e9295c041652..93c7940fa080ccb754b1be3135d3ee0bf7a6d835 100644 (file)
@@ -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));
     }
 
 }
@@ -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<ILoggingEvent> 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")
index f1caef3f55cc21abe96823118d8873ecd4af576d..b8e54d58cb59d255c5d3261c5c28226d2d039db8 100644 (file)
@@ -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<String, Publisher<NotificationProcessService>> publishersServiceMap =  new HashMap<>();
     private static Map<String, Publisher<NotificationAlarmService>> publishersAlarmMap =  new HashMap<>();
-    private ListenerRegistration<NbiNotificationsListener> 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");
     }
 
@@ -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<String, Publisher<NotificationProcessService>> publishersServiceMap;
     private Map<String, Publisher<NotificationAlarmService>> publishersAlarmMap;
     private Map<String, Publisher<NotificationTapiService>> tapiPublisherMap;
+    private Registration reg;
 
-    public NbiNotificationsListenerImpl(Map<String, Publisher<NotificationProcessService>> publishersServiceMap,
+    public NbiNotificationsHandler(Map<String, Publisher<NotificationProcessService>> publishersServiceMap,
                                         Map<String, Publisher<NotificationAlarmService>> publishersAlarmMap,
                                         Map<String, Publisher<NotificationTapiService>> 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)) {
index dad51171fcf151036b72de4d31bd357183b9e876..de827d75f9270208c96f2557221f442b140f33cf 100644 (file)
@@ -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<String, Publisher<NotificationTapiService>> tapiPublisherMap = new HashMap<>();
     private String publisherServer;
     private JsonStringConverter<NotificationTapiService> tapiConverter;
-    private NbiNotificationsListenerImpl nbiNotificationsListener;
+    private NbiNotificationsHandler nbiNotificationsListener;
     private Map<String, Publisher<NotificationAlarmService>> alarmPublisherMap = new HashMap<>();
     private Map<String, Publisher<NotificationProcessService>> processPublisherMap = new HashMap<>();
     private JsonStringConverter<NotificationProcessService> processConverter;
@@ -42,7 +42,7 @@ public final class TopicManager {
         return instance;
     }
 
-    public void setNbiNotificationsListener(NbiNotificationsListenerImpl nbiNotificationsListener) {
+    public void setNbiNotificationsListener(NbiNotificationsHandler nbiNotificationsListener) {
         this.nbiNotificationsListener = nbiNotificationsListener;
     }
 
index 2b37bb5a31d0985a3cc6f0f84329fc56c1ecfde9..4bbfb6404f2a526917e84db6e4c05b56f4e20b0f 100644 (file)
@@ -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));
     }
 }
@@ -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<NotificationProcessService> 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"));