RemoveAllPRMessage extends PartitionMessageWithDirectReply { void doPostRemoveAll(PartitionedRegion r, DistributedRemoveAllOperation op, BucketRegion bucketRegion, boolean lockedForPrimary) { try { op.setUseFakeEventId(true); r.checkReadiness(); bucketRegion.getDataView().postRemoveAll(op, this.versions, bucketRegion); r.checkReadiness(); } finally { if (lockedForPrimary) { bucketRegion.doUnlockForPrimary(); } } } RemoveAllPRMessage();  RemoveAllPRMessage(int bucketId, int size, boolean notificationOnly, boolean posDup,
      boolean skipCallbacks, Object callbackArg); void addEntry(RemoveAllEntryData entry); void initMessage(PartitionedRegion r, Set recipients, boolean notifyOnly,
      DirectReplyProcessor p); @Override boolean isSevereAlertCompatible(); void setPossibleDuplicate(boolean posDup); int getSize(); Set getKeys(); PartitionResponse send(DistributedMember recipient, PartitionedRegion r); void setBridgeContext(ClientProxyMembershipID contx); @Override int getDSFID(); @Override void fromData(DataInput in,
      DeserializationContext context); @Override void toData(DataOutput out,
      SerializationContext context); @Override EventID getEventID(); @Retained EntryEventImpl getFirstEvent(PartitionedRegion r); @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "IMSE_DONT_CATCH_IMSE") boolean doLocalRemoveAll(PartitionedRegion r, InternalDistributedMember eventSender,
      boolean cacheWrite); VersionedObjectList getVersions(); @Override boolean canStartRemoteTransaction(); @Retained static EntryEventImpl getEventFromEntry(InternalRegion r, InternalDistributedMember myId,
      InternalDistributedMember eventSender, int idx, RemoveAllEntryData[] data,
      boolean notificationOnly, ClientProxyMembershipID bridgeContext, boolean posDup,
      boolean skipCallbacks); InternalDistributedSystem getInternalDs(); void setInternalDs(InternalDistributedSystem internalDs); void setDirectAck(boolean directAck);  }
@Test public void doPostRemoveAllCallsCheckReadinessBeforeAndAfter() throws Exception { DistributedRemoveAllOperation distributedRemoveAllOperation = mock(DistributedRemoveAllOperation.class); InternalDataView internalDataView = mock(InternalDataView.class); when(bucketRegion.getDataView()).thenReturn(internalDataView); RemoveAllPRMessage removeAllPRMessage = new RemoveAllPRMessage(); removeAllPRMessage.doPostRemoveAll(partitionedRegion, distributedRemoveAllOperation, bucketRegion, true); InOrder inOrder = inOrder(partitionedRegion, internalDataView); inOrder.verify(partitionedRegion).checkReadiness(); inOrder.verify(internalDataView).postRemoveAll(any(), any(), any()); inOrder.verify(partitionedRegion).checkReadiness(); }