@Test
  public void initializeBlobStoreFailureTest() throws Exception {
    generateConfigs(true, false);
    MockDataNodeId localNode = clusterMap.getDataNodes().get(0);
    List<ReplicaId> localReplicas = clusterMap.getReplicaIds(localNode);

    // Create a new partition
    PartitionId newPartition =
        new MockPartitionId(11L, MockClusterMap.DEFAULT_PARTITION_CLASS, clusterMap.getDataNodes(), 0);

    // Make the directory unreadable
    String newReplicaPath = newPartition.getReplicaIds().get(0).getReplicaPath();
    File newReplicaPathFile = new File(newReplicaPath);
    assertTrue("Could not set readable state to false", newReplicaPathFile.setReadable(false));

    // Start StorageManager
    StorageManager storageManager = createStorageManager(localNode, metricRegistry, null);
    storageManager.start();

    // Attempt to initialize the blob store
    assertFalse("Blob store should not initialize on inaccessible mount path",
        storageManager.initializeBlobStore(newPartition.getReplicaIds().get(0)));

    // Make directory readable
    assertTrue("Could not set readable state to true", newReplicaPathFile.setReadable(true));

    // Retry initialization, which should now succeed
    assertTrue("Blob store should be initialized successfully",
        storageManager.initializeBlobStore(newPartition.getReplicaIds().get(0)));
    assertNotNull("Blob store should be accessible with skipping state check",
        storageManager.getStore(newPartition, true));

    // Shutdown and validate
    localReplicas.add(newPartition.getReplicaIds().get(0));
    shutdownAndAssertStoresInaccessible(storageManager, localReplicas);
  }
Starts the {@link StorageManager}
Creates a new partition and sets directory inaccessible
Attempts to initialize the blob store for partition and validates failure
Sets directory accessible, attempts initialization and validates success
@throws Exception exception
ambry-store/src/test/java/com/github/ambry/store/StorageManagerTest.java