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%2FClientLocalHistoryTest.java;h=298470021ee20c04c35f4fdb963c5f10a04cbca9;hp=2b234304003cace8490c201247319768a814c1c3;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/ClientLocalHistoryTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java index 2b23430400..298470021e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientLocalHistoryTest.java @@ -7,23 +7,29 @@ */ 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.containsString; +import static org.hamcrest.CoreMatchers.endsWith; +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 ClientLocalHistoryTest extends AbstractClientHistoryTest { private ActorSystem system; private AbstractDataStoreClientBehavior behavior; @@ -37,14 +43,12 @@ public class ClientLocalHistoryTest 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()); } @@ -110,28 +114,30 @@ public class ClientLocalHistoryTest extends AbstractClientHistoryTest object().onTransactionReady(tx, cohort)); + assertThat(ise.getMessage(), containsString(" is idle when readying transaction ")); } @Test @@ -139,7 +145,7 @@ public class ClientLocalHistoryTest extends AbstractClientHistoryTest object().onTransactionReady(transaction, cohort)); + assertThat(ise.getMessage(), endsWith(" is idle when readying transaction null")); } }