@Test
  public void diskSpaceRequirementsTest() throws Exception {
    if(isLogSegmented) {
      // This test is only applicable when the log is segmented
      // expect three log segments to be already allocated (from setup process)
      int segmentsAllocated = 3;
      doDiskSpaceRequirementsTest(store, segmentsAllocated, 0);

      // try adding fake swap segment log segment.
      File tempFile =
          File.createTempFile("sample-swap", LogSegmentName.SUFFIX + BlobStoreCompactor.TEMP_LOG_SEGMENT_NAME_SUFFIX,
              tempDir);
      doDiskSpaceRequirementsTest(store, segmentsAllocated, 1);
      assertTrue("Could not delete temp file", tempFile.delete());

      addCuratedData(SEGMENT_CAPACITY, true);
      segmentsAllocated += 1;
      doDiskSpaceRequirementsTest(store, segmentsAllocated, 0);

      File.createTempFile("sample-swap", LogSegmentName.SUFFIX + BlobStoreCompactor.TEMP_LOG_SEGMENT_NAME_SUFFIX,
          tempDir).deleteOnExit();
      File.createTempFile("sample-swap", LogSegmentName.SUFFIX + BlobStoreCompactor.TEMP_LOG_SEGMENT_NAME_SUFFIX,
          tempDir).deleteOnExit();
      addCuratedData(SEGMENT_CAPACITY, true);
      segmentsAllocated += 1;
      doDiskSpaceRequirementsTest(store, segmentsAllocated, 2);
    } else {
      // This test is only applicable when the log is not segmented
      // expect log is already present (from setup process)
      int segmentsAllocated = 1;
      doDiskSpaceRequirementsTest(store, segmentsAllocated, 0);
      // try adding fake swap segment log segment.
      File tempFile =
          File.createTempFile("sample-swap", LogSegmentName.SUFFIX + BlobStoreCompactor.TEMP_LOG_SEGMENT_NAME_SUFFIX,
              tempDir);
      doDiskSpaceRequirementsTest(store, segmentsAllocated, 1);
      assertTrue("Could not delete temp file", tempFile.delete());
    }
  }
Tests that {@link BlobStore#getDiskSpaceRequirements()} functions as expected.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java