use of org.apache.geode.cache.DataPolicy in project geode by apache.
the class Fakes method region.
/**
* A fake region, which contains a fake cache and some other fake attributes
*/
public static Region region(String name, Cache cache) {
Region region = mock(Region.class);
RegionAttributes attributes = mock(RegionAttributes.class);
DataPolicy policy = mock(DataPolicy.class);
when(region.getAttributes()).thenReturn(attributes);
when(attributes.getDataPolicy()).thenReturn(policy);
when(region.getCache()).thenReturn(cache);
when(region.getRegionService()).thenReturn(cache);
return region;
}
Aggregations