import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.Futures;
import org.junit.Test;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
verify(readTransaction).close();
verify(chainAdapter).closeReadTransaction();
- doReturn(Futures.immediateCheckedFuture(null)).when(readTransaction).read(any(), any());
+ doReturn(FluentFutures.immediateNullFluentFuture()).when(readTransaction).read(any(), any());
assertNotNull(transactionChainReadTransaction.exists(
- LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY));
- transactionChainReadTransaction.read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY);
- verify(readTransaction, atLeastOnce()).read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY);
+ LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()));
+ transactionChainReadTransaction.read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty());
+ verify(readTransaction, atLeastOnce()).read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty());
- doReturn(Futures.immediateFailedCheckedFuture(
+ doReturn(FluentFutures.immediateFailedFluentFuture(
new NullPointerException())).when(readTransaction).read(any(), any());
doNothing().when(chainAdapter).transactionFailed(any(), any());
assertNotNull(transactionChainReadTransaction.read(
- LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY));
+ LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()));
previousWriteTxFuture = FluentFutures.immediateFailedFluentFuture(new NullPointerException());
transactionChainReadTransaction =
new TransactionChainReadTransaction(identifier, readTransaction, previousWriteTxFuture, chainAdapter);
assertNotNull(transactionChainReadTransaction.read(
- LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY));
+ LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()));
}
}