X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FTransactionContextWrapperTest.java;h=e899ad0f288f20571599807978113a1126566dc7;hb=3115b8171461584e85f58d87a9f179013cfbb262;hp=af6e782ed7a45063f3f5b955f755d9227a29f6d7;hpb=c796596b5c46b5203c30b143e6282662e66c5642;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionContextWrapperTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionContextWrapperTest.java index af6e782ed7..e899ad0f28 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionContextWrapperTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionContextWrapperTest.java @@ -11,15 +11,16 @@ package org.opendaylight.controller.cluster.datastore; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; + import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.opendaylight.controller.cluster.datastore.utils.ActorContext; +import org.opendaylight.controller.cluster.datastore.utils.ActorUtils; public class TransactionContextWrapperTest { @Mock - private ActorContext actorContext; + private ActorUtils actorUtils; @Mock private TransactionContext transactionContext; @@ -27,16 +28,16 @@ public class TransactionContextWrapperTest { private TransactionContextWrapper transactionContextWrapper; @Before - public void setUp(){ + public void setUp() { MockitoAnnotations.initMocks(this); - doReturn(DatastoreContext.newBuilder().build()).when(actorContext).getDatastoreContext(); + doReturn(DatastoreContext.newBuilder().build()).when(actorUtils).getDatastoreContext(); transactionContextWrapper = new TransactionContextWrapper(MockIdentifiers.transactionIdentifier( - TransactionContextWrapperTest.class, "mock"), actorContext); + TransactionContextWrapperTest.class, "mock"), actorUtils, "mock"); } @Test - public void testExecutePriorTransactionOperations(){ - for(int i=0;i<100;i++) { + public void testExecutePriorTransactionOperations() { + for (int i = 0; i < 100; i++) { transactionContextWrapper.maybeExecuteTransactionOperation(mock(TransactionOperation.class)); } assertEquals(901, transactionContextWrapper.getLimiter().availablePermits()); @@ -45,4 +46,4 @@ public class TransactionContextWrapperTest { assertEquals(1001, transactionContextWrapper.getLimiter().availablePermits()); } -} \ No newline at end of file +}