- verifyCohortInvocations(2, CanCommitTransaction.SERIALIZABLE_CLASS);
- verifyCohortInvocations(2, PreCommitTransaction.SERIALIZABLE_CLASS);
- verifyCohortInvocations(2, CommitTransaction.SERIALIZABLE_CLASS);
+ static class Builder {
+ private Class<?> expCanCommitType;
+ private Class<?> expCommitType;
+ private Class<?> expAbortType;
+ private Object canCommitReply;
+ private Object commitReply;
+ private Object abortReply;
+ private final String transactionId;
+
+ Builder(String transactionId) {
+ this.transactionId = transactionId;
+ }
+
+ Builder expectCanCommit(Class<?> expCanCommitType, Object canCommitReply) {
+ this.expCanCommitType = expCanCommitType;
+ this.canCommitReply = canCommitReply;
+ return this;
+ }
+
+ Builder expectCanCommit(Object canCommitReply) {
+ return expectCanCommit(CanCommitTransaction.class, canCommitReply);
+ }
+
+ Builder expectCommit(Class<?> expCommitType, Object commitReply) {
+ this.expCommitType = expCommitType;
+ this.commitReply = commitReply;
+ return this;
+ }
+
+ Builder expectCommit(Object commitReply) {
+ return expectCommit(CommitTransaction.class, commitReply);
+ }
+
+ Builder expectAbort(Class<?> expAbortType, Object abortReply) {
+ this.expAbortType = expAbortType;
+ this.abortReply = abortReply;
+ return this;
+ }
+
+ Builder expectAbort(Object abortReply) {
+ return expectAbort(AbortTransaction.class, abortReply);
+ }
+
+ Props props() {
+ return Props.create(CohortActor.class, this);
+ }
+ }