Migrate netconf users of submit() to commit()
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / NetconfDeviceSalProviderTest.java
index 16ca3da8cfe4d9364c51ee62e4b2deba14af8f96..5ba66cac8879ef41ac22bb8db32bffd05b9b79b5 100644 (file)
@@ -5,7 +5,6 @@
  * 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.netconf.sal.connect.netconf.sal;
 
 import static org.mockito.Matchers.any;
@@ -15,8 +14,8 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.opendaylight.mdsal.common.api.CommitInfo.emptyFluentFuture;
 
-import com.google.common.util.concurrent.Futures;
 import java.net.InetSocketAddress;
 import org.junit.Before;
 import org.junit.Test;
@@ -29,19 +28,13 @@ import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.core.api.Broker;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 
 public class NetconfDeviceSalProviderTest {
 
-    @Mock
-    private Broker.ProviderSession session;
     @Mock
     private DOMMountPointService mountpointService;
     @Mock
-    private BindingAwareBroker.ProviderContext context;
-    @Mock
     private WriteTransaction tx;
     @Mock
     private DataBroker dataBroker;
@@ -51,6 +44,7 @@ public class NetconfDeviceSalProviderTest {
     private DOMMountPointService mountPointService;
     @Mock
     private WriteTransaction writeTx;
+
     private NetconfDeviceSalProvider provider;
 
     @Before
@@ -60,13 +54,11 @@ public class NetconfDeviceSalProviderTest {
         doReturn(writeTx).when(chain).newWriteOnlyTransaction();
         doNothing().when(writeTx).merge(eq(LogicalDatastoreType.OPERATIONAL), any(), any());
         doReturn("Some object").when(writeTx).getIdentifier();
-        doReturn(Futures.immediateCheckedFuture(null)).when(writeTx).submit();
+        doReturn(emptyFluentFuture()).when(writeTx).commit();
         provider = new NetconfDeviceSalProvider(new RemoteDeviceId("device1",
                 InetSocketAddress.createUnresolved("localhost", 17830)), mountPointService, dataBroker);
-        when(session.getService(DOMMountPointService.class)).thenReturn(mountpointService);
-        when(context.getSALService(DataBroker.class)).thenReturn(dataBroker);
         when(chain.newWriteOnlyTransaction()).thenReturn(tx);
-        when(tx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+        doReturn(emptyFluentFuture()).when(tx).commit();
         when(tx.getIdentifier()).thenReturn(tx);
     }
 
@@ -94,4 +86,4 @@ public class NetconfDeviceSalProviderTest {
         provider.close();
         verify(chain, times(2)).close();
     }
-}
\ No newline at end of file
+}