Switch to MD-SAL APIs
[openflowplugin.git] / applications / forwardingrules-manager / src / test / java / org / opendaylight / openflowplugin / applications / frm / impl / DeviceMastershipManagerTest.java
index 55de43760c581205d832cd4dcaadb67c28ebbccb..701b9f270b96ab5cd174e9216fc2f80bf7a036ee 100644 (file)
@@ -1,11 +1,10 @@
-/**
+/*
  * Copyright (c) 2016, 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.frm.impl;
 
 import org.junit.Assert;
@@ -15,9 +14,9 @@ import org.junit.runner.RunWith;
 import org.mockito.ArgumentMatchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
@@ -25,6 +24,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
 import org.opendaylight.openflowplugin.applications.frm.FlowNodeReconciliation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.frm.reconciliation.service.rev180227.FrmReconciliationService;
 
 /**
  * Test for {@link DeviceMastershipManager}.
@@ -41,19 +41,20 @@ public class DeviceMastershipManagerTest {
     @Mock
     private DataBroker dataBroker;
     @Mock
-    private RoutedRpcRegistration routedRpcReg;
-    @Mock
     private MastershipChangeServiceManager mastershipChangeServiceManager;
     @Mock
     private DeviceInfo deviceInfo;
     @Mock
     private NodeId nodeId;
+    @Mock
+    private RpcProviderService rpcProviderService;
+    @Mock
+    private FrmReconciliationService reconciliationService;
 
     @Before
     public void setUp() throws Exception {
         deviceMastershipManager = new DeviceMastershipManager(clusterSingletonService, reconciliationAgent, dataBroker,
-                mastershipChangeServiceManager);
-        deviceMastershipManager.setRoutedRpcReg(routedRpcReg);
+                mastershipChangeServiceManager, rpcProviderService, reconciliationService);
         Mockito.lenient().when(clusterSingletonService
                 .registerClusterSingletonService(ArgumentMatchers.<ClusterSingletonService>any()))
                 .thenReturn(registration);