summaryrefslogtreecommitdiffstats
path: root/infra/data-impl/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'infra/data-impl/src/test/java')
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java34
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java8
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java11
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java12
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java18
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java44
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java15
7 files changed, 66 insertions, 76 deletions
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java
index 124179c79..56d333436 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java
@@ -24,18 +24,19 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
+import com.google.common.collect.ClassToInstanceMap;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.ReadableDataManager;
-import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-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.DOMDataBrokerExtension;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -58,7 +59,7 @@ public class DataBrokerTest {
@Test
public void testNewReadWriteTransaction() {
- final DOMDataReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
+ final DOMDataTreeReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readWriteTx.read(LogicalDatastoreType.CONFIGURATION, path);
@@ -77,7 +78,7 @@ public class DataBrokerTest {
@Test
public void testNewReadOnlyTransaction() {
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
+ final DOMDataTreeReadTransaction readTx = broker.newReadOnlyTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readTx.read(LogicalDatastoreType.CONFIGURATION, path);
@@ -88,14 +89,14 @@ public class DataBrokerTest {
@Test(expected = UnsupportedOperationException.class)
public void testCreateTransactionChain() {
- final TransactionChainListener listener = mock(TransactionChainListener.class);
+ final DOMTransactionChainListener listener = mock(DOMTransactionChainListener.class);
broker.createTransactionChain(listener);
}
@Test
public void testGetSupportedExtensions() {
- final Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> supportedExtensions =
- broker.getSupportedExtensions();
+ final @NonNull ClassToInstanceMap<DOMDataBrokerExtension> supportedExtensions =
+ broker.getExtensions();
assertEquals(1, supportedExtensions.size());
assertNotNull(supportedExtensions.get(DOMDataTransactionValidator.class));
}
@@ -117,7 +118,7 @@ public class DataBrokerTest {
@Test
public void testNewReadWriteTransaction() {
- final DOMDataReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
+ final DOMDataTreeReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readWriteTx.read(LogicalDatastoreType.OPERATIONAL, path);
@@ -133,7 +134,7 @@ public class DataBrokerTest {
@Test
public void testNewReadOnlyTransaction() {
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
+ final DOMDataTreeReadTransaction readTx = broker.newReadOnlyTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readTx.read(LogicalDatastoreType.OPERATIONAL, path);
@@ -143,7 +144,7 @@ public class DataBrokerTest {
@Test(expected = IllegalArgumentException.class)
public void testReadConfig() {
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
+ final DOMDataTreeReadTransaction readTx = broker.newReadOnlyTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readTx.read(LogicalDatastoreType.CONFIGURATION, path);
@@ -151,14 +152,13 @@ public class DataBrokerTest {
@Test(expected = UnsupportedOperationException.class)
public void testCreateTransactionChain() {
- final TransactionChainListener listener = mock(TransactionChainListener.class);
+ final DOMTransactionChainListener listener = mock(DOMTransactionChainListener.class);
broker.createTransactionChain(listener);
}
@Test
public void testGetSupportedExtensions() {
- final Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> supportedExtensions =
- broker.getSupportedExtensions();
+ final @NonNull ClassToInstanceMap<DOMDataBrokerExtension> supportedExtensions = broker.getExtensions();
assertTrue(supportedExtensions.isEmpty());
}
}
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java
index 5690e78c3..8f686333e 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java
@@ -21,7 +21,6 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.translate.write.DataObjectUpdate;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
@@ -32,8 +31,9 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
@@ -52,7 +52,7 @@ abstract class ModifiableDataTreeDelegatorBaseTest extends ModificationBaseTest
@Mock
DataBroker contextBroker;
@Mock
- org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx;
+ org.opendaylight.mdsal.binding.api.ReadWriteTransaction tx;
@Captor
ArgumentCaptor<WriteContext> writeContextCaptor;
@@ -72,7 +72,7 @@ abstract class ModifiableDataTreeDelegatorBaseTest extends ModificationBaseTest
MockitoAnnotations.initMocks(this);
dataTree = getDataTree();
when(contextBroker.newReadWriteTransaction()).thenReturn(tx);
- when(tx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(tx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
when(serializer.fromYangInstanceIdentifier(any(YangInstanceIdentifier.class)))
.thenReturn(((InstanceIdentifier) DEFAULT_ID));
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java
index b1e60c440..8ec18e4da 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java
@@ -28,19 +28,18 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.translate.write.DataObjectUpdate;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
import java.util.HashMap;
import java.util.Map;
+import java.util.Optional;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -54,9 +53,9 @@ public class ModifiableDataTreeDelegatorTest extends ModifiableDataTreeDelegator
public void testRead() throws Exception {
final ContainerNode topContainer = getTopContainer("topContainer");
addNodeToTree(dataTree, topContainer, TOP_CONTAINER_ID);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read =
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> read =
configDataTree.read(TOP_CONTAINER_ID);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read2 =
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> read2 =
configDataTree.newModification().read(TOP_CONTAINER_ID);
final Optional<NormalizedNode<?, ?>> normalizedNodeOptional = read.get();
final Optional<NormalizedNode<?, ?>> normalizedNodeOptional2 = read2.get();
@@ -64,7 +63,7 @@ public class ModifiableDataTreeDelegatorTest extends ModifiableDataTreeDelegator
assertEquals(normalizedNodeOptional, normalizedNodeOptional2);
assertTrue(normalizedNodeOptional.isPresent());
assertEquals(topContainer, normalizedNodeOptional.get());
- assertEquals(dataTree.takeSnapshot().readNode(TOP_CONTAINER_ID), Optional.toJavaUtil(normalizedNodeOptional));
+ assertEquals(dataTree.takeSnapshot().readNode(TOP_CONTAINER_ID), normalizedNodeOptional);
}
@Test
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java
index 77470d17c..690a0deee 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java
@@ -22,15 +22,14 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.data.ReadableDataManager;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
+import io.fd.honeycomb.data.ReadableDataManager;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -52,8 +51,7 @@ public class ReadOnlyTransactionTest {
@Test
public void testExists() {
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException>
- future = mock(CheckedFuture.class);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = mock(FluentFuture.class);
when(operationalData.read(path)).thenReturn(future);
readOnlyTx.exists(LogicalDatastoreType.OPERATIONAL, path);
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java
index bbe384289..cc744530f 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java
@@ -23,15 +23,15 @@ import static org.mockito.MockitoAnnotations.initMocks;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public class ReadWriteTransactionTest {
@Mock
- private DOMDataReadOnlyTransaction readTx;
+ private DOMDataTreeReadTransaction readTx;
@Mock
private ValidableTransaction writeTx;
@@ -78,15 +78,7 @@ public class ReadWriteTransactionTest {
}
@Test
- public void testSubmit() throws Exception {
- readWriteTx.submit();
- verify(writeTx).submit();
- }
-
-
- @SuppressWarnings("deprecation")
- @Test
- public void testCommit() throws Exception {
+ public void testCommit() {
readWriteTx.commit();
verify(writeTx).commit();
}
@@ -104,7 +96,7 @@ public class ReadWriteTransactionTest {
}
@Test
- public void testGetIdentifier() throws Exception {
+ public void testGetIdentifier() {
assertNotNull(readWriteTx.getIdentifier());
}
} \ No newline at end of file
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java
index 76b46dad6..6ff625d8e 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java
@@ -30,29 +30,30 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.yangtools.util.UnmodifiableCollection;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
@@ -87,7 +88,7 @@ public class ReadableDataTreeDelegatorTest {
@Mock
private DOMDataBroker netconfMonitoringBroker;
@Mock
- private DOMDataReadOnlyTransaction domDataReadOnlyTransaction;
+ private DOMDataTreeReadTransaction domDataReadOnlyTransaction;
@Mock
private DataBroker contextBroker;
@@ -95,16 +96,16 @@ public class ReadableDataTreeDelegatorTest {
public void setUp() {
initMocks(this);
operationalData = new ReadableDataTreeDelegator(serializer, globalContext, reader, contextBroker);
- doReturn(schemaNode).when(globalContext).getDataChildByName(any(QName.class));
+ doReturn(Optional.of(schemaNode)).when(globalContext).findDataChildByName(any(QName.class));
doReturn(domDataReadOnlyTransaction).when(netconfMonitoringBroker).newReadOnlyTransaction();
- doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(domDataReadOnlyTransaction)
+ doReturn(FluentFutures.immediateFluentFuture(Optional.empty())).when(domDataReadOnlyTransaction)
.read(any(LogicalDatastoreType.class), any(YangInstanceIdentifier.class));
- final org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction ctxTransaction = mock(
- org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction.class);
+ final org.opendaylight.mdsal.binding.api.ReadWriteTransaction ctxTransaction = mock(
+ org.opendaylight.mdsal.binding.api.ReadWriteTransaction.class);
doReturn(ctxTransaction).when(contextBroker).newReadWriteTransaction();
- doReturn(Futures.immediateCheckedFuture(null)).when(ctxTransaction).submit();
+ doReturn(FluentFutures.immediateNullFluentFuture()).when(ctxTransaction).commit();
}
@Test
@@ -124,7 +125,7 @@ public class ReadableDataTreeDelegatorTest {
final DataContainerChild<?, ?> expectedValue = mock(DataContainerChild.class);
doReturn(expectedValue).when(entry).getValue();
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future = operationalData.read(yangId);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = operationalData.read(yangId);
verify(serializer).fromYangInstanceIdentifier(yangId);
verify(reader).read(same(id), any(ReadContext.class));
@@ -137,9 +138,9 @@ public class ReadableDataTreeDelegatorTest {
public void testReadNonExistingNode() throws Exception {
final YangInstanceIdentifier yangId = mock(YangInstanceIdentifier.class);
doReturn(id).when(serializer).fromYangInstanceIdentifier(yangId);
- doReturn(Optional.absent()).when(reader).read(same(id), any(ReadContext.class));
+ doReturn(Optional.empty()).when(reader).read(same(id), any(ReadContext.class));
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future = operationalData.read(yangId);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = operationalData.read(yangId);
verify(serializer).fromYangInstanceIdentifier(yangId);
verify(reader).read(same(id), any(ReadContext.class));
@@ -151,13 +152,12 @@ public class ReadableDataTreeDelegatorTest {
public void testReadFailed() throws Exception {
doThrow(io.fd.honeycomb.translate.read.ReadFailedException.class).when(reader).readAll(any(ReadContext.class));
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future =
- operationalData.read( YangInstanceIdentifier.EMPTY);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = operationalData.read(YangInstanceIdentifier.EMPTY);
try {
- future.checkedGet();
- } catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof io.fd.honeycomb.translate.read.ReadFailedException);
+ future.get();
+ } catch (ExecutionException e) {
+ assertTrue(e.getCause() instanceof ReadFailedException);
return;
}
fail("ReadFailedException was expected");
@@ -181,7 +181,7 @@ public class ReadableDataTreeDelegatorTest {
doReturn(vppYangId.getLastPathArgument()).when(vppStateContainer).getIdentifier();
// Read root
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future =
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future =
operationalData.read(YangInstanceIdentifier.EMPTY);
verify(reader).readAll(any(ReadContext.class));
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java
index 74313a1ba..8bda219cb 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java
@@ -25,15 +25,16 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.translate.TranslationException;
import io.fd.honeycomb.translate.ValidationFailedException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -68,7 +69,7 @@ public class WriteTransactionTest {
@Test(expected = IllegalStateException.class)
public void testOnFinishedTx() {
- writeTx.submit();
+ writeTx.commit();
writeTx.put(LogicalDatastoreType.CONFIGURATION, path, data);
verify(configSnapshot).write(path, data);
}
@@ -86,7 +87,7 @@ public class WriteTransactionTest {
@Test
public void testCancelFinished() {
- writeTx.submit();
+ writeTx.commit();
assertFalse(writeTx.cancel());
}
@@ -98,14 +99,14 @@ public class WriteTransactionTest {
@Test
public void testSubmit() throws Exception {
- writeTx.submit();
+ writeTx.commit();
verify(configSnapshot).commit();
}
@Test
public void testSubmitFailed() throws Exception {
doThrow(mock(ValidationFailedException.class)).when(configSnapshot).commit();
- final CheckedFuture<Void, TransactionCommitFailedException> future = writeTx.submit();
+ final FluentFuture<? extends CommitInfo> future = writeTx.commit();
try {
future.get();
} catch (Exception e) {