Migrate netconf users of submit() to commit()
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / util / NetconfSalKeystoreServiceTest.java
index 1d85790b6befbf014fbb5a9e103f92811b5e2a0f..531f3de75ac1aaac2a287f521e61c37d9e3a19f4 100644 (file)
@@ -12,8 +12,8 @@ import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+import static org.opendaylight.mdsal.common.api.CommitInfo.emptyFluentFuture;
 
-import com.google.common.util.concurrent.Futures;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Before;
@@ -24,7 +24,6 @@ import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 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.TransactionCommitFailedException;
 import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.sal.connect.util.NetconfSalKeystoreService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017.AddPrivateKeyInput;
@@ -69,7 +68,7 @@ public class NetconfSalKeystoreServiceTest {
 
     @Test
     public void testAddPrivateKey() throws Exception {
-        doReturn(Futures.<Void, TransactionCommitFailedException>immediateCheckedFuture(null)).when(writeTx).submit();
+        doReturn(emptyFluentFuture()).when(writeTx).commit();
         NetconfSalKeystoreService keystoreService = new NetconfSalKeystoreService(dataBroker, encryptionService);
 
         final AddPrivateKeyInput input = getPrivateKeyInput();
@@ -81,7 +80,7 @@ public class NetconfSalKeystoreServiceTest {
 
     @Test
     public void testAddTrustedCertificate() throws Exception {
-        doReturn(Futures.<Void, TransactionCommitFailedException>immediateCheckedFuture(null)).when(writeTx).submit();
+        doReturn(emptyFluentFuture()).when(writeTx).commit();
         NetconfSalKeystoreService keystoreService = new NetconfSalKeystoreService(dataBroker, encryptionService);
 
         final AddTrustedCertificateInput input = getTrustedCertificateInput();