@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);
}