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%2FClientBackedReadTransactionTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2FClientBackedReadTransactionTest.java;h=2d09073228b6636ef511e3c56670f098bafe735f;hp=89c0519992b2c7830640ff2ceae7e4d80266b20b;hb=9bce68c4712d00951d121be68b09578bc6e09151;hpb=2c566430ce1f97da8236f023d531313474ea4d6a diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java index 89c0519992..2d09073228 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ClientBackedReadTransactionTest.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.Futures; import com.google.common.util.concurrent.ListenableFuture; 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.access.client.ClientActorContext; import org.opendaylight.controller.cluster.databroker.actors.dds.ClientSnapshot; @@ -40,29 +42,26 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest public void setUp() { MockitoAnnotations.initMocks(this); - Mockito.doReturn(CLIENT_ID).when(clientContext).getIdentifier(); - Mockito.doReturn(TRANSACTION_ID).when(delegate).getIdentifier(); + doReturn(CLIENT_ID).when(clientContext).getIdentifier(); + doReturn(TRANSACTION_ID).when(delegate).getIdentifier(); - 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 ClientBackedReadTransaction(delegate, null, null); } @Test public void testRead() throws Exception { - final ListenableFuture>> result = object().read( - YangInstanceIdentifier.EMPTY); + final ListenableFuture>> 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 { final ListenableFuture result = object().exists(YangInstanceIdentifier.EMPTY); - Assert.assertTrue(result.get()); + assertEquals(Boolean.TRUE, result.get()); } }