DistributedRemoveAllOperation extends AbstractUpdateOperation { public EntryEventImpl getBaseEvent() { return getEvent(); } DistributedRemoveAllOperation(CacheEvent event, int size, boolean isBridgeOp); boolean isBridgeOperation(); RemoveAllEntryData[] getRemoveAllEntryData(); void setRemoveAllEntryData(RemoveAllEntryData[] removeAllEntryData); void addEntry(RemoveAllEntryData removeAllEntry); void addEntry(EntryEventImpl ev); void addEntry(EntryEventImpl ev, boolean newCallbackInvoked); void addEntry(EntryEventImpl ev, Integer bucketId); void setUseFakeEventId(boolean status); Iterator eventIterator(); void freeOffHeapResources(); @Unretained EntryEventImpl getEventForPosition(int position); EntryEventImpl getBaseEvent(); RemoveAllPRMessage createPRMessagesNotifyOnly(int bucketId); HashMap<Integer, RemoveAllPRMessage> createPRMessages(); public int removeAllDataSize; }
@Test public void shouldBeMockable() throws Exception { DistributedRemoveAllOperation mockDistributedRemoveAllOperation = mock(DistributedRemoveAllOperation.class); EntryEventImpl mockEntryEventImpl = mock(EntryEventImpl.class); when(mockDistributedRemoveAllOperation.getBaseEvent()).thenReturn(mockEntryEventImpl); assertThat(mockDistributedRemoveAllOperation.getBaseEvent()).isSameAs(mockEntryEventImpl); }