@Test
  public void testBug41822() {
    DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
    diskRegionProperties.setRegionName(regionName);
    diskRegionProperties.setRolling(false);
    diskRegionProperties.setDiskDirs(diskDirs);
    diskRegionProperties.setMaxOplogSize(500);

    DiskStoreFactory diskStoreFactory = toDiskStoreFactory(diskRegionProperties);

    DiskStore diskStore = createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, 500);

    Region<String, Object> region =
        createRegion(regionName, diskStoreName, true, true, false, false, 0);

    byte[] payload = new byte[100];

    region.put("key0", payload);
    assertThat(getDiskRegion(region).testHook_getChild().getDirectoryHolder().getDir())
        .isEqualTo(diskDirs[0]);

    region.close();
    closeDiskStore(diskStore);

    diskStore = createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, 500);
    region = createRegion(regionName, diskStoreName, true, true, false, false, 0);
    region.put("key1", payload);

    assertThat(getDiskRegion(region).testHook_getChild().getDirectoryHolder().getDir())
        .isEqualTo(diskDirs[1]);

    region.close();
    closeDiskStore(diskStore);

    diskStore = createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, 500);
    region = createRegion(regionName, diskStoreName, true, true, false, false, 0);
    region.put("key2", payload);

    assertThat(getDiskRegion(region).testHook_getChild().getDirectoryHolder().getDir())
        .isEqualTo(diskDirs[2]);

    region.close();
    closeDiskStore(diskStore);

    diskStore = createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, 500);
    region = createRegion(regionName, diskStoreName, true, true, false, false, 0);
    region.put("key3", payload);

    assertThat(getDiskRegion(region).testHook_getChild().getDirectoryHolder().getDir())
        .isEqualTo(diskDirs[3]);

    region.close();
    closeDiskStore(diskStore);

    diskStore = createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory, 500);
    region = createRegion(regionName, diskStoreName, true, true, false, false, 0);
    region.put("key4", payload);

    assertThat(getDiskRegion(region).testHook_getChild().getDirectoryHolder().getDir())
        .isEqualTo(diskDirs[0]);
  }
Regression test for TRAC #41822: Only one disk directory is being used when multiple
directories are specified

<p>
Make sure oplog created by recovery goes in the proper directory
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java