LocalTransactionContext extends AbstractTransactionContext { private LocalThreePhaseCommitCohort ready() { logModificationCount(); return readySupport.onTransactionReady(getWriteDelegate(), operationError); } LocalTransactionContext(final DOMStoreTransaction txDelegate, final TransactionIdentifier identifier,
            final LocalTransactionReadySupport readySupport); @Override void executeDelete(final YangInstanceIdentifier path, final Boolean havePermit); @Override void executeMerge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data,
            final Boolean havePermit); @Override void executeWrite(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data,
            final Boolean havePermit); @Override void executeRead(final AbstractRead<T> readCmd, final SettableFuture<T> proxyFuture,
            final Boolean havePermit); @Override Future<ActorSelection> readyTransaction(final Boolean havePermit,
            final Optional<SortedSet<String>> participatingShardNames); @Override Future<Object> directCommit(final Boolean havePermit); @Override void closeTransaction();  }
@Test public void testReady() { final LocalThreePhaseCommitCohort mockCohort = mock(LocalThreePhaseCommitCohort.class); doReturn(akka.dispatch.Futures.successful(null)).when(mockCohort).initiateCoordinatedCommit(Optional.empty()); doReturn(mockCohort).when(mockReadySupport).onTransactionReady(readWriteTransaction, null); Future<ActorSelection> future = localTransactionContext.readyTransaction(null, Optional.empty()); assertTrue(future.isCompleted()); verify(mockReadySupport).onTransactionReady(readWriteTransaction, null); }