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%2Factors%2Fdds%2FEmptyTransactionCommitCohortTest.java;h=fbfdc0a924cdec64f3d7dc89c2b711d5b2a7a7b5;hp=f68fce4e231acb038013beed34735350e8a8c56a;hb=118cd0216b0c6b0ec1a01689ec2025a13e090861;hpb=9bce68c4712d00951d121be68b09578bc6e09151 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohortTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohortTest.java index f68fce4e23..fbfdc0a924 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohortTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/EmptyTransactionCommitCohortTest.java @@ -8,20 +8,20 @@ package org.opendaylight.controller.cluster.databroker.actors.dds; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.verify; import static org.opendaylight.controller.cluster.databroker.actors.dds.TestUtils.TRANSACTION_ID; import static org.opendaylight.controller.cluster.databroker.actors.dds.TestUtils.getWithTimeout; import com.google.common.util.concurrent.ListenableFuture; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.StrictStubs.class) public class EmptyTransactionCommitCohortTest { - @Mock private AbstractClientHistory history; @@ -29,7 +29,6 @@ public class EmptyTransactionCommitCohortTest { @Before public void setUp() { - MockitoAnnotations.initMocks(this); cohort = new EmptyTransactionCommitCohort(history, TRANSACTION_ID); } @@ -41,22 +40,21 @@ public class EmptyTransactionCommitCohortTest { @Test public void testPreCommit() throws Exception { - final ListenableFuture preCommit = cohort.preCommit(); - assertNull(getWithTimeout(preCommit)); + assertNotNull(getWithTimeout(cohort.preCommit())); } @Test public void testAbort() throws Exception { - final ListenableFuture abort = cohort.abort(); + final ListenableFuture abort = cohort.abort(); verify(history).onTransactionComplete(TRANSACTION_ID); - assertNull(getWithTimeout(abort)); + assertNotNull(getWithTimeout(abort)); } @Test public void testCommit() throws Exception { - final ListenableFuture commit = cohort.commit(); + final ListenableFuture commit = cohort.commit(); verify(history).onTransactionComplete(TRANSACTION_ID); - Assert.assertNull(getWithTimeout(commit)); + assertNotNull(getWithTimeout(commit)); } } \ No newline at end of file