@Test
  public void storeInitializeLoadTests() throws IOException, StoreException {
    // Since store creation can fail in this test before the metric has initialized, set the memory usage metric to false.
    properties.put("store.enable.index.direct.memory.usage.metric", "false");
    enableIndexDirectMemoryUsageMetric = false;

    String nonExistentDir = new File(tempDir, TestUtils.getRandomString(10)).getAbsolutePath();
    File createdDir = new File(nonExistentDir);

    ReplicaId replicaIdWithNonExistentDir = getMockReplicaId(nonExistentDir);
    // create directory if it does not exist
    BlobStore blobStore = createBlobStore(replicaIdWithNonExistentDir);
    blobStore.initialize();
    verifyLoadSuccess(blobStore);

    assertTrue("Directory could not be deleted", cleanDirectory(createdDir, true));

    // should not be able to load the uninitialized blobstore
    blobStore = createBlobStore(replicaIdWithNonExistentDir);
    verifyLoadFailure(blobStore, StoreErrorCodes.StoreNotInitialized);

    blobStore.initialize();
    blobStore.load();

    verifyStartupFailure(blobStore, StoreErrorCodes.StoreAlreadyStarted);

    assertTrue("Directory could not be deleted", cleanDirectory(createdDir, true));

    // should not be able to load an already started blobstore
    blobStore = createBlobStore(replicaIdWithNonExistentDir);
    blobStore.start();
    verifyLoadFailure(blobStore, StoreErrorCodes.StoreAlreadyStarted);
    blobStore.shutdown();
    assertTrue("Directory could not be deleted", cleanDirectory(createdDir, true));

    // should not be able load an store twice
    blobStore = createBlobStore(replicaIdWithNonExistentDir);
    blobStore.initialize();
    blobStore.load();
    verifyLoadFailure(blobStore, StoreErrorCodes.StoreAlreadyStarted);
    blobStore.shutdown();
    assertTrue("Directory could not be deleted", cleanDirectory(createdDir, true));
  }
Tests {@link BlobStore#initialize()} for corner cases and error cases.
1. Checks if store will be loaded after initialized
Error cases
1. Start an uninitialized store
2. Start an already loaded store
3. Load an started store
4. Load an store twice
@throws IOException
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java