Bump upstream dependencies to latest Ca versions
[transportpce.git] / nbinotifications / src / test / java / org / opendaylight / transportpce / nbinotifications / impl / NbiNotificationsProviderTest.java
index 93827286f55d8cf73e5011f3158b12fb2a5dd172..c5b2237729cd35b3f55856bac2cfd916e4985d5d 100644 (file)
@@ -11,46 +11,39 @@ 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.Before;
-import org.junit.Test;
+import com.google.common.collect.ClassToInstanceMap;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 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.common.network.RequestProcessor;
-import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl;
 import org.opendaylight.transportpce.test.AbstractTest;
 
+
 public class NbiNotificationsProviderTest  extends AbstractTest {
     public static NetworkTransactionService networkTransactionService;
 
     @Mock
     RpcProviderService rpcProviderRegistry;
-
     @Mock
     private NotificationService notificationService;
 
-    @Before
-    public void init() {
+    @BeforeEach
+    void init() {
         MockitoAnnotations.openMocks(this);
-
     }
 
     @Test
-    public void initTest() {
-        networkTransactionService = new NetworkTransactionImpl(
-            new RequestProcessor(getDataStoreContextUtil().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));
+    void initTest() {
+        networkTransactionService = new NetworkTransactionImpl(getDataBroker());
+        new NbiNotificationsProvider("localhost:8080", "localhost:8080",
+                rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(),
+                networkTransactionService);
+        verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any(ClassToInstanceMap.class));
         verify(notificationService, times(1))
-                .registerNotificationListener(any(NbiNotificationsListenerImpl.class));
+                .registerCompositeListener(any(NotificationService.CompositeListener.class));
     }
 }