@Test
  public void testSegmentedLogInitWithNoSegments() throws Exception {
    int totalSegments = 2;
    long totalCapacity = totalSegments * SEGMENT_CAPACITY;

    DiskSpaceAllocator mockDiskSpaceAllocator = mock(DiskSpaceAllocator.class);
    StoreConfig storeConfig = createStoreConfig(SEGMENT_CAPACITY, setFilePermissionEnabled);

    Log log =
        new Log(tempDir.getAbsolutePath(), totalCapacity, mockDiskSpaceAllocator, storeConfig, metrics, null, false);
    assertEquals("Remaining unallocated segments mismatch", totalSegments, log.getRemainingUnallocatedSegments());
  }
Tests the initialization of a segmented log when no segments exist in the directory.
@throws Exception if an error occurs during the test.
ambry-store/src/test/java/com/github/ambry/store/LogTest.java