Switch to MD-SAL APIs
[openflowplugin.git] / applications / notification-supplier / src / test / java / org / opendaylight / openflowplugin / applications / notification / supplier / impl / item / stat / NodeConnectorStatNotificationSupplierImplTest.java
index 59ecad7abdb1c75eeef30978895d9d62ac59fc99..12ac9bf778613583888570022a061fe65ebdad88 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.openflowplugin.applications.notification.supplier.impl.
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -18,11 +19,10 @@ import java.util.ArrayList;
 import java.util.Collection;
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Matchers;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataObjectModification;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestChangeEventBuildHelper;
 import org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestData;
 import org.opendaylight.openflowplugin.applications.notification.supplier.impl.helper.TestSupplierVerifyHelper;
@@ -44,12 +44,12 @@ public class NodeConnectorStatNotificationSupplierImplTest {
     private static final String FLOW_NODE_ID = "openflow:111";
     private static final String FLOW_CODE_CONNECTOR_ID = "test-con-111";
     private NodeConnectorStatNotificationSupplierImpl notifSupplierImpl;
-    private NotificationProviderService notifProviderService;
+    private NotificationPublishService notifProviderService;
     private DataBroker dataBroker;
 
     @Before
     public void initalization() {
-        notifProviderService = mock(NotificationProviderService.class);
+        notifProviderService = mock(NotificationPublishService.class);
         dataBroker = mock(DataBroker.class);
         notifSupplierImpl = new NodeConnectorStatNotificationSupplierImpl(notifProviderService, dataBroker);
         TestSupplierVerifyHelper.verifyDataTreeChangeListenerRegistration(dataBroker);
@@ -80,13 +80,13 @@ public class NodeConnectorStatNotificationSupplierImplTest {
     }
 
     @Test
-    public void testCreateChangeEvent() {
-        final TestData testData = new TestData(createTestConnectorStatPath(), null, createTestConnectorStat(),
-                                               DataObjectModification.ModificationType.WRITE);
+    public void testCreateChangeEvent() throws InterruptedException {
+        final TestData<FlowCapableNodeConnectorStatistics> testData = new TestData<>(createTestConnectorStatPath(),
+                null, createTestConnectorStat(), DataObjectModification.ModificationType.WRITE);
         Collection<DataTreeModification<FlowCapableNodeConnectorStatistics>> collection = new ArrayList<>();
         collection.add(testData);
         notifSupplierImpl.onDataTreeChanged(collection);
-        verify(notifProviderService, times(1)).publish(Matchers.any(NodeConnectorStatisticsUpdate.class));
+        verify(notifProviderService, times(1)).putNotification(any(NodeConnectorStatisticsUpdate.class));
     }
 
     @Test(expected = IllegalArgumentException.class)