- protected CreateTransactionReply createTransactionReply(ActorRef actorRef, int transactionVersion){
- return CreateTransactionReply.newBuilder()
- .setTransactionActorPath(actorRef.path().toString())
- .setTransactionId("txn-1")
- .setMessageVersion(transactionVersion)
- .build();
+ protected void expectReadyLocalTransaction(ActorRef actorRef, boolean doCommitOnReady) {
+ doReturn(doCommitOnReady ? Futures.successful(new CommitTransactionReply().toSerializable()) :
+ readyTxReply(actorRef.path().toString())).when(mockActorContext).executeOperationAsync(
+ eq(actorSelection(actorRef)), isA(ReadyLocalTransaction.class), any(Timeout.class));
+ }
+
+ protected CreateTransactionReply createTransactionReply(ActorRef actorRef, short transactionVersion){
+ return new CreateTransactionReply(actorRef.path().toString(), nextTransactionId(), transactionVersion);