Do not use RpcService in nbinotifications module
[transportpce.git] / nbinotifications / src / test / java / org / opendaylight / transportpce / nbinotifications / impl / NbiNotificationsProviderTest.java
index bbf2e62e063d8ebbcda1996ead49050c8853a471..2b37bb5a31d0985a3cc6f0f84329fc56c1ecfde9 100644 (file)
@@ -11,7 +11,6 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-import java.util.Arrays;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.Mock;
@@ -28,7 +27,6 @@ public class NbiNotificationsProviderTest  extends AbstractTest {
 
     @Mock
     RpcProviderService rpcProviderRegistry;
-
     @Mock
     private NotificationService notificationService;
 
@@ -40,13 +38,10 @@ public class NbiNotificationsProviderTest  extends AbstractTest {
     @Test
     void initTest() {
         networkTransactionService = new NetworkTransactionImpl(getDataBroker());
-        NbiNotificationsProvider provider = new NbiNotificationsProvider(
-                Arrays.asList("topic1", "topic2"), Arrays.asList("topic1", "topic2"), "localhost:8080",
-                "localhost:8080", rpcProviderRegistry, notificationService,
-                getDataStoreContextUtil().getBindingDOMCodecServices(), networkTransactionService);
-        provider.init();
-        verify(rpcProviderRegistry, times(2))
-                .registerRpcImplementation(any(), any(NbiNotificationsImpl.class));
+        new NbiNotificationsProvider("localhost:8080", "localhost:8080",
+                rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(),
+                networkTransactionService);
+        verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any());
         verify(notificationService, times(1))
                 .registerNotificationListener(any(NbiNotificationsListenerImpl.class));
     }