verify(mockRegionAttributes, times(2)).getPartitionAttributes();
}
@Test
public void testMergePartitionAttributesWithPartitionRedundantPersistentOverflow() throws Exception {
PartitionAttributes testPartitionAttributes = createPartitionAttributes("TestRegion", 512000, 15000l, 3,
30000l, 1024000l, 51);
RegionAttributes mockRegionAttributes = mock(RegionAttributes.class);
RegionFactory mockRegionFactory = createTestRegionFactory();
when(mockRegionAttributes.getPartitionAttributes()).thenReturn(testPartitionAttributes);
factoryBean.setShortcut(RegionShortcut.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW);
factoryBean.mergePartitionAttributes(mockRegionFactory, mockRegionAttributes);
RegionAttributes regionAttributes = TestUtils.readField("regionAttributes",
TestUtils.readField("attrsFactory", mockRegionFactory));
PartitionAttributes actualPartitionAttributes = regionAttributes.getPartitionAttributes();
assertNotNull(actualPartitionAttributes);
assertNotSame(testPartitionAttributes, actualPartitionAttributes);
assertEquals("TestRegion", actualPartitionAttributes.getColocatedWith());
assertEquals(512000, actualPartitionAttributes.getLocalMaxMemory());
assertEquals(15000l, actualPartitionAttributes.getRecoveryDelay());
assertEquals(3, actualPartitionAttributes.getRedundantCopies());
assertEquals(30000l, actualPartitionAttributes.getStartupRecoveryDelay());
assertEquals(1024000l, actualPartitionAttributes.getTotalMaxMemory());
assertEquals(51, actualPartitionAttributes.getTotalNumBuckets());
verify(mockRegionAttributes, times(2)).getPartitionAttributes();
}