X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2FClientBackedReadWriteTransactionTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2FClientBackedReadWriteTransactionTest.java;h=56968390321e4996909b34fca2e485e9340e39b4;hp=6ead121c1de0dd03f3c38c5fde28942d991039d8;hb=9bce68c4712d00951d121be68b09578bc6e09151;hpb=2c566430ce1f97da8236f023d531313474ea4d6a diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java index 6ead121c1d..5696839032 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadWriteTransactionTest.java @@ -7,14 +7,16 @@ */ package org.opendaylight.controller.cluster.databroker; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; + import com.google.common.util.concurrent.FluentFuture; import com.google.common.util.concurrent.Futures; import java.util.Optional; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; -import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction; import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; @@ -41,13 +43,11 @@ public class ClientBackedReadWriteTransactionTest public void setUp() { MockitoAnnotations.initMocks(this); - Mockito.doReturn(TRANSACTION_ID).when(delegate).getIdentifier(); - Mockito.doReturn(readyCohort).when(delegate).ready(); + doReturn(TRANSACTION_ID).when(delegate).getIdentifier(); + doReturn(readyCohort).when(delegate).ready(); - Mockito.doReturn(Futures.immediateCheckedFuture(Boolean.TRUE)).when(delegate) - .exists(YangInstanceIdentifier.EMPTY); - Mockito.doReturn(Futures.immediateCheckedFuture(Optional.of(data))).when(delegate) - .read(YangInstanceIdentifier.EMPTY); + doReturn(Futures.immediateCheckedFuture(Boolean.TRUE)).when(delegate).exists(YangInstanceIdentifier.EMPTY); + doReturn(Futures.immediateCheckedFuture(Optional.of(data))).when(delegate).read(YangInstanceIdentifier.EMPTY); object = new ClientBackedReadWriteTransaction(delegate, null); } @@ -56,12 +56,12 @@ public class ClientBackedReadWriteTransactionTest public void testRead() throws Exception { final FluentFuture>> result = object().read(YangInstanceIdentifier.EMPTY); final Optional> resultData = result.get(); - Assert.assertTrue(resultData.isPresent()); - Assert.assertEquals(data, resultData.get()); + assertTrue(resultData.isPresent()); + assertEquals(data, resultData.get()); } @Test public void testExists() throws Exception { - Assert.assertTrue(object().exists(YangInstanceIdentifier.EMPTY).get()); + assertEquals(Boolean.TRUE, object().exists(YangInstanceIdentifier.EMPTY).get()); } }