PartitionMessage extends DistributionMessage implements MessageWithReply, TransactionMessage { @Override public InternalDistributedMember getMemberToMasqueradeAs() { if (txMemberId == null) { return getSender(); } return txMemberId; } PartitionMessage();  PartitionMessage(InternalDistributedMember recipient, int regionId,
      ReplyProcessor21 processor);  PartitionMessage(Collection<InternalDistributedMember> recipients, int regionId,
      ReplyProcessor21 processor);  PartitionMessage(PartitionMessage other); void initTxMemberId(); @Override InternalDistributedMember getTXOriginatorClient(); @Override InternalDistributedMember getMemberToMasqueradeAs(); @Override boolean isSevereAlertCompatible(); @Override int getProcessorType(); int getRegionId(); @Override int getProcessorId(); void registerProcessor(int processorId1); PartitionMessage getMessageForRelayToListeners(EntryEventImpl event, Set recipients); boolean checkCacheClosing(ClusterDistributionManager dm); boolean checkDSClosing(ClusterDistributionManager dm); @Override void process(final ClusterDistributionManager dm); Set relayToListeners(Set cacheOpRecipients, Set adjunctRecipients,
      FilterRoutingInfo filterRoutingInfo, EntryEventImpl event, PartitionedRegion r,
      DirectReplyProcessor processor); @Override void fromData(DataInput in,
      DeserializationContext context); @Override void toData(DataOutput out,
      SerializationContext context); @Override String toString(); InternalDistributedMember getRecipient(); void setOperation(Operation op); void setHasOldValue(boolean value); void setFilterInfo(FilterRoutingInfo filterInfo); @Override int getTXUniqId(); @Override boolean canStartRemoteTransaction(); void setSendDeltaWithFullValue(boolean bool); @Override boolean canParticipateInTransaction(); @Override boolean isTransactionDistributed(); void setTransactionDistributed(boolean isDistTx); static final String PN_TOKEN; }
@Test public void shouldBeMockable() throws Exception { PartitionMessage mockPartitionMessage = mock(PartitionMessage.class); InternalDistributedMember mockInternalDistributedMember = mock(InternalDistributedMember.class); when(mockPartitionMessage.getMemberToMasqueradeAs()).thenReturn(mockInternalDistributedMember); assertThat(mockPartitionMessage.getMemberToMasqueradeAs()) .isSameAs(mockInternalDistributedMember); }