@Test
  public void testUnsegmentedLogInitWithNoSegment() throws Exception {
    DiskSpaceAllocator mockDiskSpaceAllocator = mock(DiskSpaceAllocator.class);
    StoreConfig storeConfig = createStoreConfig(SEGMENT_CAPACITY, setFilePermissionEnabled);

    Log log =
        new Log(tempDir.getAbsolutePath(), SEGMENT_CAPACITY, mockDiskSpaceAllocator, storeConfig, metrics, null, false);
    assertEquals("Remaining unallocated segments mismatch", 1, log.getRemainingUnallocatedSegments());
  }
Tests the initialization of an unsegmented log when no segment exists in the directory.
Verifies that the remaining unallocated segments is set to 1, as the log is unsegmented.
@throws Exception if an error occurs during the test.
ambry-store/src/test/java/com/github/ambry/store/LogTest.java