RegionMapPut extends AbstractRegionMapPut { boolean isCacheWrite() { return cacheWrite; } RegionMapPut(FocusedRegionMap focusedRegionMap, InternalRegion owner,
      CacheModificationLock cacheModificationLock, EntryEventSerialization entryEventSerialization,
      EntryEventImpl event, boolean ifNew, boolean ifOld, boolean overwriteDestroyed,
      boolean requireOldValue, Object expectedOldValue);   }
@Test public void cacheWriteDefaultToFalse() { createInstance(); assertThat(instance.isCacheWrite()).isFalse(); }
@Test public void cacheWriteIsFalseIfGenerateCallbacksButNotDistributedEtc() { when(event.isGenerateCallbacks()).thenReturn(true); createInstance(); assertThat(instance.isCacheWrite()).isFalse(); }
@Test public void cacheWriteIsTrueIfGenerateCallbacksAndDistributed() { when(event.isGenerateCallbacks()).thenReturn(true); when(internalRegion.getScope()).thenReturn(Scope.DISTRIBUTED_ACK); createInstance(); assertThat(instance.isCacheWrite()).isTrue(); }
@Test public void cacheWriteIsTrueIfGenerateCallbacksAndServerProxy() { when(event.isGenerateCallbacks()).thenReturn(true); when(internalRegion.hasServerProxy()).thenReturn(true); createInstance(); assertThat(instance.isCacheWrite()).isTrue(); }
@Test public void cacheWriteIsTrueIfGenerateCallbacksAndCacheWriter() { when(event.isGenerateCallbacks()).thenReturn(true); when(internalRegion.basicGetWriter()).thenReturn(mock(CacheWriter.class)); createInstance(); assertThat(instance.isCacheWrite()).isTrue(); }
@Test public void isOriginRemoteCausesCacheWriteToBeFalse() { when(event.isOriginRemote()).thenReturn(true); when(event.isGenerateCallbacks()).thenReturn(true); when(internalRegion.basicGetWriter()).thenReturn(mock(CacheWriter.class)); createInstance(); assertThat(instance.isCacheWrite()).isFalse(); }
@Test public void netSearchCausesCacheWriteToBeFalse() { when(event.isNetSearch()).thenReturn(true); when(event.isGenerateCallbacks()).thenReturn(true); when(internalRegion.basicGetWriter()).thenReturn(mock(CacheWriter.class)); createInstance(); assertThat(instance.isCacheWrite()).isFalse(); }