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%2FSingleClientHistoryTest.java;h=1d68e979dbd5b25bc681de38555e34c1e194e0ef;hp=361c9267e08419082a48595ee9542e881b197596;hb=refs%2Fchanges%2F61%2F96761%2F2;hpb=1808c7ff4e755fb475253f5b6c3b5ef627a1bdc0 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistoryTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistoryTest.java index 361c9267e0..1d68e979db 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistoryTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/SingleClientHistoryTest.java @@ -7,23 +7,28 @@ */ package org.opendaylight.controller.cluster.databroker.actors.dds; -import static org.opendaylight.controller.cluster.databroker.actors.dds.TestUtils.CLIENT_ID; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; import akka.actor.ActorSystem; import akka.testkit.TestProbe; import akka.testkit.javadsl.TestKit; import org.junit.After; -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; import org.opendaylight.controller.cluster.access.client.AbstractClientConnection; import org.opendaylight.controller.cluster.access.client.AccessClientUtil; import org.opendaylight.controller.cluster.access.client.ClientActorContext; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.utils.ActorUtils; +@RunWith(MockitoJUnitRunner.StrictStubs.class) public class SingleClientHistoryTest extends AbstractClientHistoryTest { private ActorSystem system; private AbstractDataStoreClientBehavior behavior; @@ -35,14 +40,12 @@ public class SingleClientHistoryTest extends AbstractClientHistoryTest clientConnection = behavior.getConnection(0L); final ProxyHistory historyProxy = object().createHistoryProxy(HISTORY_ID, clientConnection); - Assert.assertEquals(object().getIdentifier(), historyProxy.getIdentifier()); + assertEquals(object().getIdentifier(), historyProxy.getIdentifier()); } @Override @Test public void testDoCreateSnapshot() { final ClientSnapshot clientSnapshot = object().doCreateSnapshot(); - Assert.assertEquals(new TransactionIdentifier(object().getIdentifier(), object().nextTx()).getHistoryId(), + assertEquals(new TransactionIdentifier(object().getIdentifier(), object().nextTx()).getHistoryId(), clientSnapshot.getIdentifier().getHistoryId()); } @@ -97,14 +100,14 @@ public class SingleClientHistoryTest extends AbstractClientHistoryTest object().onTransactionReady(transaction, cohort)); + assertThat(ise.getMessage(), startsWith("Duplicate cohort ")); } } \ No newline at end of file