@Test
  public void syncPersistentWithAutoCompact() {
    DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
    diskStoreFactory.setAutoCompact(true);
    diskStoreFactory.setDiskDirsAndSizes(diskDirs, diskDirSizes);

    createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, MAX_OPLOG_SIZE_IN_BYTES);

    RegionFactory<Object, Object> regionFactory = cache.createRegionFactory(LOCAL);
    regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
    regionFactory.setDiskStoreName(diskStoreName);
    regionFactory.setDiskSynchronous(true);

    Region region = regionFactory.create(regionName);

    assertThat(region.getAttributes().isDiskSynchronous()).isEqualTo(true);
    verifyRegionAndDiskStoreAttributes(true, MAX_OPLOG_SIZE_IN_BYTES, 0, -1);
  }
Extracted and exploded {@code testDiskRegDWAttrbts} from {@link DiskRegionJUnitTest}.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionAttributesIntegrationTest.java