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

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

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

    // Initialize the blob store
    ReplicaId replica = newPartition.getReplicaIds().get(0);
    assertTrue("Blob store initialization should succeed", storageManager.initializeBlobStore(replica));

    // Stop the compaction on blob store
    storageManager.controlCompactionForBlobStore(newPartition, false);

    // Shutdown the blob store
    assertTrue("Blob store shutdown should succeed", storageManager.shutdownBlobStore(newPartition));
    // Remove the blob store after shutdown, which should succeed
    assertTrue("Blob store removal should succeed after shutdown", storageManager.removeBlobStore(newPartition));
    assertNull("Blob store should not exist after removal", storageManager.getStore(newPartition, true));

    localReplicas.add(replica);

    // Create another Partition
    PartitionId newPartition1 =
        new MockPartitionId(11L, MockClusterMap.DEFAULT_PARTITION_CLASS, clusterMap.getDataNodes(), 0);

    // Stop the compaction on blob store
    storageManager.controlCompactionForBlobStore(newPartition1, false);
    ReplicaId replica1 = newPartition1.getReplicaIds().get(0);

    assertFalse("Blob store removal should fail without shutting it down",
        storageManager.removeBlobStore(newPartition1));

    localReplicas.add(replica1);
    shutdownAndAssertStoresInaccessible(storageManager, localReplicas);
  }
Starts the {@link StorageManager}
Creates a new Partition
Initializes the blob store for Partition
shutdowns the blob store and then removes the blob store
Creates another Partition and then tries to remove the blob store without shutdown
@throws Exception exception
ambry-store/src/test/java/com/github/ambry/store/StorageManagerTest.java